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