25 #include "glm/gtc/type_ptr.hpp" 26 #include "glm/gtc/matrix_transform.hpp" 72 transform = glm::translate(transform, glm::make_vec3(
_position));
139 _model->drawBound(enabled);
151 return open(triggerer);
164 return close(triggerer);
186 _model->playAnimation(
"opening1");
Class to hold the two-dimensional array of a 2DA file.
Handling version V3.2/V3.3 of BioWare's GFFs (generic file format).
void loadAppearance()
Load appearance-specific properties.
#define MKTAG(a0, a1, a2, a3)
A wrapper macro used around four character constants, like 'DATA', to ensure portability.
LinkedToFlag _linkedToFlag
Does this door link to anything?
bool testCollision(const glm::vec3 &orig, const glm::vec3 &dest) const
ObjectType _linkedToType
The type of the object this door links to.
Module * _module
The module the door is in.
const Common::UString & getString(size_t column) const
Return the contents of a cell as a string.
void leave()
The cursor left the door.
A class holding an UTF-8 string.
void reset(PointerType o=0)
Resets the pointer with the new value.
void load(const Aurora::GFF3Struct &door)
Load from a door instance.
float _position[3]
The object's position.
void enter()
The cursor entered the door.
float _orientation[4]
The object's orientation.
void movePC(float x, float y, float z)
Move the player character to this position within the current area.
Common::UString _soundClosed
The sound the object makes when closed.
uint64 getUint(const Common::UString &field, uint64 def=0) const
Aurora::GFF3File * loadOptionalGFF3(const Common::UString &gff3, Aurora::FileType type, uint32 id, bool repairNWNPremium)
Load a GFF3, but return 0 instead of throwing on error.
uint32 _appearanceID
The index within the situated appearance 2DA.
Object * _lastOpenedBy
The object that last opened this situated object.
A simple scoped smart pointer template.
Door(Module &module, const Aurora::GFF3Struct &door)
Load from a door instance.
Object * _lastUsedBy
The object that last used this situated object.
uint32 _genericType
Index into the generic door types.
A door in a Star Wars: Knights of the Old Republic II - The Sith Lords area.
Basic exceptions to throw.
const char * c_str() const
Return the (utf8 encoded) string data.
void highlight(bool enabled)
(Un)Highlight the door.
Common::UString _soundLocked
The sound the object makes when locked.
Utility templates and functions.
void hide()
Hide the door's model.
Common::ScopedPtr< Graphics::Aurora::Model > _model
The situated object's model.
Handling BioWare's 2DAs (two-dimensional array).
bool runScript(Script script, const Aurora::NWScript::ObjectReference owner=Aurora::NWScript::ObjectReference(), const Aurora::NWScript::ObjectReference triggerer=Aurora::NWScript::ObjectReference())
bool open(Object *opener)
The opener object opens this door.
bool empty() const
Is the string empty?
#define TwoDAReg
Shortcut for accessing the 2da registry.
bool isLocked() const
Is the situated object locked?
uint32 _soundAppType
The index within the situated sounds 2DA.
void warning(const char *s,...)
bool isOpen() const
Is the door open?
int32 getInt(size_t column) const
Return the contents of a cell as an int.
Common::UString _linkedToModule
The module the object this door links to is in.
Common::UString _linkedTo
The object tag this door links to.
State _state
The current state of the door.
void playSound(const Common::UString &sound, bool pitchVariance=false)
Play an object sound.
Opened in the other direction (normally counter-clock-wise).
void hide()
Hide the situated object's model.
The context needed to run a Star Wars: Knights of the Old Republic II - The Sith Lords module...
bool testCollision(const glm::vec3 &orig, const glm::vec3 &dest) const
Engines::KotOR::Walkmesh _walkmesh
void load(const Aurora::GFF3Struct &instance, const Aurora::GFF3Struct *blueprint=0)
Load the situated object from an instance and its blueprint.
const TwoDARow & getRow(size_t row) const
Get a row.
ObjectType
Object type, matches the bitfield in nwscript.nss.
Common::UString _soundOpened
The sound the object makes when opened.
static const uint32 kFieldIDInvalid
Door template (user), GFF.
Common::UString getString(const Common::UString &field, const Common::UString &def="") const
Generic Aurora engines utility functions.
State
The state of a door.
bool click(Object *triggerer=0)
The door was clicked.
void loadObject(const Aurora::GFF3Struct &gff)
Load door-specific properties.
Object * _lastClosedBy
The object that last closed this situated object.
bool hasScript(Script script) const
Opened in one direction (normally clock-wise).
static float deg2rad(float deg)
Common::UString _modelName
The model's resource name.
void hideSoft()
Hide the door's model if applicable.
size_t headerToColumn(const Common::UString &header) const
Translate a column header to a column index.
void load(const Common::UString &resRef, ::Aurora::FileType type=::Aurora::kFileTypeWOK, const glm::mat4 &transform=glm::mat4())
bool close(Object *closer)
The closer object closes this door.
Common::UString _transitionDestination
A localized string describing where this door leads to.