49 _lastOpenedBy(0), _lastClosedBy(0), _lastUsedBy(0) {
51 for (
int i = 0; i < 3; i++)
52 for (
int j = 0; j < 4; j++)
75 dynamic_cast<Graphics::Aurora::Model_NWN2 &>(*_model).setTint(
_tint);
116 _model->setPosition(x, y, z);
124 _model->setOrientation(x, y, z, angle);
177 if (instance.
hasField(
"Position")) {
189 float bearing = instance.
getDouble(
"Bearing");
196 if (instance.
hasField(
"Orientation")) {
Class to hold the two-dimensional array of a 2DA file.
Handling version V3.2/V3.3 of BioWare's GFFs (generic file format).
bool isClickable() const
Can the player click the object?
Neverwinter Nights 2 utility functions.
uint32 _soundAppType
The index within the situated sounds 2DA.
Situated(ObjectType type)
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
void reset(PointerType o=0)
Resets the pointer with the new value.
The global config manager.
bool hasField(const Common::UString &field) const
Does this specific field exist?
virtual void getOrientation(float &x, float &y, float &z, float &angle) const
Return the object's orientation.
void loadModel()
Load the situated object's model.
uint64 getUint(const Common::UString &field, uint64 def=0) const
Common::UString _name
The object's display name.
bool isLocked() const
Is the situated object locked?
An object within a NWN2 area.
void readVarTable(const Aurora::GFF3List &varTable)
Read the object's variable table.
void setPosition(float x, float y, float z)
Set the situated object's position.
Object * _lastOpenedBy
The object that last opened this situated object.
Common::UString _soundClosed
The sound the object makes when closed.
Object * getLastOpenedBy() const
Return the object that last opened this situated object.
bool _usable
Is the object usable?
bool _locked
Is the situated object locked?
std::list< uint32 > _ids
The object's model IDs.
Basic exceptions to throw.
Common::UString _modelName
The model's resource name.
const char * c_str() const
Return the (utf8 encoded) string data.
void show()
Show the situated object's model.
#define ConfigMan
Shortcut for accessing the config manager.
void readScripts(const Aurora::GFF3Struct &gff)
Utility templates and functions.
double getDouble(const Common::UString &field, double def=0.0) const
Handling BioWare's 2DAs (two-dimensional array).
void unloadModel()
Unload the situated object's model.
Common::UString _conversation
The object's default conversation.
bool empty() const
Is the string empty?
#define TwoDAReg
Shortcut for accessing the 2da registry.
void warning(const char *s,...)
void loadProperties(const Aurora::GFF3Struct &gff)
Common::ScopedPtr< Graphics::Aurora::Model > _model
The situated object's model.
uint32 _appearanceID
The index within the situated appearance 2DA.
virtual void setOrientation(float x, float y, float z, float angle)
Set the object's orientation.
Common::UString _soundUsed
The sound the object makes when used.
const TwoDARow & getRow(size_t row) const
Get a row.
virtual void setPosition(float x, float y, float z)
Set the object's position within its area.
bool readTint(const Aurora::GFF3Struct &gff, float t[3][4])
A situated object in a Neverwinter Nights 2 area.
const GFF3Struct & getStruct(const Common::UString &field) const
Object * _lastClosedBy
The object that last closed this situated object.
Object * getLastUsedBy() const
Return the object that last used this situated object.
static const uint32 kFieldIDInvalid
virtual void getPosition(float &x, float &y, float &z) const
Return the object's position within its area.
Common::UString getString(const Common::UString &field, const Common::UString &def="") const
bool _static
Is the object static?
Object * _lastUsedBy
The object that last used this situated object.
static float rad2deg(float rad)
virtual void loadObject(const Aurora::GFF3Struct &gff)=0
Load object-specific properties.
Common::UString _soundDestroyed
The sound the object makes when destroyed.
Generic Aurora engines utility functions.
ObjectType
Object type, matches the bitfield in nwscript.nss.
Object * getLastClosedBy() const
Return the object that last closed this situated object.
void load(const Aurora::GFF3Struct &instance, const Aurora::GFF3Struct *blueprint=0)
Load the situated object from an instance and its blueprint.
Loading MDB files found in Neverwinter Nights 2.
void hide()
Hide the situated object's model.
Graphics::Aurora::Model * loadModelObject(const Common::UString &resref, const Common::UString &texture)
virtual void setLocked(bool locked)
Lock/Unlock the situated object.
Common::UString _soundOpened
The sound the object makes when opened.
Common::UString _soundLocked
The sound the object makes when locked.
void setOrientation(float x, float y, float z, float angle)
Set the situated object's orientation.
Common::UString _description
The object's description.
virtual void loadAppearance()=0
Load appearance-specific properties.
Generic Aurora engines model functions.