25 #include "glm/gtc/type_ptr.hpp" 26 #include "glm/gtc/matrix_transform.hpp" 48 _state(kStateDefault), _hasInventory(false) {
70 transform = glm::translate(transform, glm::make_vec3(
_position));
96 for (Aurora::GFF3List::const_iterator iter = classList.begin(); iter != classList.end(); ++iter) {
132 _model->drawBound(enabled);
161 return close(triggerer);
163 return open(triggerer);
int64 getSint(const Common::UString &field, int64 def=0) const
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 load(const Aurora::GFF3Struct &placeable)
Load from a placeable instance.
#define MKTAG(a0, a1, a2, a3)
A wrapper macro used around four character constants, like 'DATA', to ensure portability.
bool isOpen() const
Is the placeable open?
void highlight(bool enabled)
(Un)Highlight the placeable.
const Common::UString & getString(size_t column) const
Return the contents of a cell as a string.
bool isActivated() const
Is the placeable activated?
bool getBool(const Common::UString &field, bool def=false) const
A class holding an UTF-8 string.
void reset(PointerType o=0)
Resets the pointer with the new value.
bool _hasInventory
Does this placeable have an inventory?
void loadObject(const Aurora::GFF3Struct &gff)
Load placeable-specific properties.
bool hasField(const Common::UString &field) const
Does this specific field exist?
void enter()
The cursor entered the placeable.
uint64 getUint(const Common::UString &field, uint64 def=0) const
bool deactivate(Object *closer)
The user object deactivates this placeable.
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.
Object * _lastClosedBy
The object that last closed this situated object.
A simple scoped smart pointer template.
void loadAppearance()
Load appearance-specific properties.
Common::UString _modelName
The model's resource name.
bool open(Object *opener)
The opener object opens this placeable.
bool close(Object *closer)
The closer object closes this placeable.
const char * c_str() const
Return the (utf8 encoded) string data.
Placeable(const Aurora::GFF3Struct &placeable)
Load from a placeable instance.
Utility templates and functions.
float _position[3]
The object's position.
State _state
The current state of the placeable.
Placeable template (user), GFF.
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.
float _orientation[4]
The object's orientation.
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.
int _currentHitPoints
The current hitpoints of the object.
Object * _lastOpenedBy
The object that last opened this situated object.
void warning(const char *s,...)
#define CursorMan
Shortcut for accessing the cursor manager.
int32 getInt(size_t column) const
Return the contents of a cell as an int.
std::vector< const GFF3Struct * > GFF3List
bool _minOneHitPoint
If the object should have at least one hitpoint.
Inventory & getInventory()
void leave()
The cursor left the placeable.
A placeable in a Star Wars: Knights of the Old Republic area.
The Aurora cursor manager.
void playSound(const Common::UString &sound, bool pitchVariance=false)
Play an object sound.
Common::UString _soundUsed
The sound the object makes when used.
void addItem(const Common::UString &tag, int count=1)
const GFF3List & getList(const Common::UString &field) const
void hide()
Hide the situated object's model.
State
The state of a placeable.
int _maxHitPoints
The maximum hitpoints of the object.
const TwoDARow & getRow(size_t row) const
Get a row.
static const uint32 kFieldIDInvalid
Common::UString getString(const Common::UString &field, const Common::UString &def="") const
Generic Aurora engines utility functions.
bool click(Object *triggerer=0)
The placeable was clicked.
void readScripts(const Aurora::GFF3Struct &gff, bool clear=true)
Common::ScopedPtr< Graphics::Aurora::Model > _model
The situated object's model.
static float deg2rad(float deg)
Inventory _inventory
The current items of this placeable if it has an inventory.
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.
void load(const Common::UString &resRef, ::Aurora::FileType type=::Aurora::kFileTypeWOK, const glm::mat4 &transform=glm::mat4())
bool activate(Object *opener)
The user object activates this placeable.
bool isLocked() const
Is the situated object locked?
void hide()
Hide the placeable's model.