45 _lastOpenedBy(0), _lastClosedBy(0), _lastUsedBy(0) {
73 _model->setPosition(x, y, z);
81 _model->setOrientation(x, y, z, angle);
94 _model->playAnimation(anim, restart, length, speed);
168 float bearing = instance.
getDouble(
"Bearing");
204 if (portraitID != 0) {
208 if (!portrait.
empty())
Class to hold the two-dimensional array of a 2DA file.
Handling version V3.2/V3.3 of BioWare's GFFs (generic file format).
virtual void show()
Show the object.
bool testCollision(const glm::vec3 &orig, const glm::vec3 &dest) const
virtual void getPosition(float &x, float &y, float &z) const
Return the object's position within its area.
virtual void hide()
Hide the object.
const Common::UString & getString(size_t column) const
Return the contents of a cell as a string.
bool getBool(const Common::UString &field, bool def=false) const
Object * getLastOpenedBy() const
Return the object that last opened this situated object.
A class holding an UTF-8 string.
void reset(PointerType o=0)
Resets the pointer with the new value.
Object * getLastUsedBy() const
Return the object that last used this situated object.
void loadProperties(const Aurora::GFF3Struct &gff)
virtual void loadObject(const Aurora::GFF3Struct &gff)=0
Load object-specific properties.
virtual void setPosition(float x, float y, float z)
Set the object's position within its area.
Common::UString _soundClosed
The sound the object makes when closed.
void setPosition(float x, float y, float z)
Set the situated object's position.
uint64 getUint(const Common::UString &field, uint64 def=0) const
bool _usable
Is the object usable?
void show()
Show the situated object's model.
virtual void getOrientation(float &x, float &y, float &z, float &angle) const
Return the object's orientation.
Common::UString _soundUsed
The sound the object makes when used.
uint32 _appearanceID
The index within the situated appearance 2DA.
Object * _lastOpenedBy
The object that last opened this situated object.
void loadPortrait(const Aurora::GFF3Struct &gff)
Object * _lastUsedBy
The object that last used this situated object.
void setInvisible(bool invisible)
Basic exceptions to throw.
bool isClickable() const
Can the player click the object?
const char * c_str() const
Return the (utf8 encoded) string data.
Common::UString _soundLocked
The sound the object makes when locked.
std::list< uint32 > _ids
The object's model IDs.
Common::UString _name
The object's display name.
Utility templates and functions.
Common::ScopedPtr< Graphics::Aurora::Model > _model
The situated object's model.
double getDouble(const Common::UString &field, double def=0.0) const
Common::UString _portrait
The object's portrait.
Handling BioWare's 2DAs (two-dimensional array).
Situated(ObjectType type)
bool _locked
Is the situated object locked?
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,...)
void hide()
Hide the situated object's model.
Engines::KotOR::Walkmesh _walkmesh
A situated object in a Star Wars: Knights of the Old Republic II - The Sith Lords area...
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.
void playAnimation(const Common::UString &anim, bool restart=true, float length=0.0f, float speed=1.0f)
ObjectType
Object type, matches the bitfield in nwscript.nss.
virtual void loadAppearance()=0
Load appearance-specific properties.
Common::UString _soundDestroyed
The sound the object makes when destroyed.
void setWalkmeshInvisible(bool invisible)
Common::UString _soundOpened
The sound the object makes when opened.
virtual void setLocked(bool locked)
Lock/Unlock the situated object.
static const uint32 kFieldIDInvalid
virtual void setOrientation(float x, float y, float z, float angle)
Set the object's orientation.
bool _static
Is the object static?
Common::UString getString(const Common::UString &field, const Common::UString &def="") const
static float rad2deg(float rad)
void readScripts(const Aurora::GFF3Struct &gff)
Object * _lastClosedBy
The object that last closed this situated object.
Graphics::Aurora::Model * loadModelObject(const Common::UString &resref, const Common::UString &texture)
void setOrientation(float x, float y, float z, float angle)
Set the situated object's orientation.
Common::UString _modelName
The model's resource name.
bool isVisible() const
Is the situated object's model visible?
Common::UString _description
The object's description.
Object * getLastClosedBy() const
Return the object that last closed this situated object.
virtual bool testCollision(const glm::vec3 &orig, const glm::vec3 &dest) const
Generic Aurora engines model functions.