xoreos  0.0.5
Public Member Functions | Protected Attributes | List of all members
Engines::KotOR::Object Class Reference

#include <object.h>

Inheritance diagram for Engines::KotOR::Object:
Inheritance graph
[legend]
Collaboration diagram for Engines::KotOR::Object:
Collaboration graph
[legend]

Public Member Functions

 Object (ObjectType type=kObjectTypeInvalid)
 
virtual ~Object ()
 
ObjectType getType () const
 Return the exact type of the object. More...
 
virtual void show ()
 Show the object's model(s). More...
 
virtual void hide ()
 Hide the object's model(s). More...
 
virtual void hideSoft ()
 Hide the object's model(s) if applicable. More...
 
virtual bool isVisible () const
 Is the object's model(s) visible? More...
 
const std::list< uint32 > & getIDs () const
 Return the object's model IDs. More...
 
const Common::UStringgetName () const
 Return the object's name. More...
 
const Common::UStringgetDescription () const
 Return the object's description. More...
 
const Common::UStringgetPortrait () const
 Return the object's portrait. More...
 
void setMaxHitPoints (int maxHP)
 Set the maximum hit points for the objects. More...
 
int getMaxHitPoints ()
 Get the maximum hit points for the objects. More...
 
void setCurrentHitPoints (int hitpoints)
 Set the current hitpoints. More...
 
int getCurrentHitPoints ()
 Return the objects current hitpoints. More...
 
void setMinOneHitPoints (bool enabled)
 Set if the object has a minimum of one hp. More...
 
bool getMinOneHitPoints () const
 Get if the object has a minimum of one hp. More...
 
bool isStatic () const
 Is the object static (not manipulable at all)? More...
 
bool isUsable () const
 Can the object be used by the PC? More...
 
bool isClickable () const
 Can the player click the object? More...
 
virtual void getPosition (float &x, float &y, float &z) const
 Return the object's position within its area. More...
 
virtual void getOrientation (float &x, float &y, float &z, float &angle) const
 Return the object's orientation. More...
 
virtual void setPosition (float x, float y, float z)
 Set the object's position within its area. More...
 
virtual void setOrientation (float x, float y, float z, float angle)
 Set the object's orientation. More...
 
void makeLookAt (float x, float y)
 
void makeLookAt (Object *target)
 
RoomgetRoom ()
 Get a room the object is in. More...
 
void setRoom (Room *room)
 Set a room the object is in. More...
 
virtual void enter ()
 The cursor entered the object. More...
 
virtual void leave ()
 The cursor left the object. More...
 
virtual void highlight (bool enabled)
 (Un)Highlight the object. More...
 
virtual bool click (Object *triggerer=0)
 The object was clicked. More...
 
void stopSound ()
 Stop the current object sound. More...
 
void playSound (const Common::UString &sound, bool pitchVariance=false)
 Play an object sound. More...
 
virtual void playAnimation (const Common::UString &anim, bool restart=true, float length=0.0f, float speed=1.0f)
 
- Public Member Functions inherited from Aurora::NWScript::Object
 Object ()
 
uint32 getID () const
 
const Common::UStringgetTag () const
 
- Public Member Functions inherited from Aurora::NWScript::VariableContainer
 VariableContainer ()
 
virtual ~VariableContainer ()
 
bool hasVariable (const Common::UString &var) const
 
VariablegetVariable (const Common::UString &var, Type type=kTypeVoid)
 
const VariablegetVariable (const Common::UString &var) const
 
void setVariable (const Common::UString &var, const Variable &value)
 
void removeVariable (const Common::UString &var)
 
void clearVariables ()
 
- Public Member Functions inherited from Engines::KotOR::ScriptContainer
 ScriptContainer ()
 
 ~ScriptContainer ()
 
const Common::UStringgetScript (Script script) const
 
bool hasScript (Script script) const
 
bool runScript (Script script, const Aurora::NWScript::ObjectReference owner=Aurora::NWScript::ObjectReference(), const Aurora::NWScript::ObjectReference triggerer=Aurora::NWScript::ObjectReference())
 

Protected Attributes

ObjectType _type
 The object's type. More...
 
Common::UString _name
 The object's display name. More...
 
Common::UString _description
 The object's description. More...
 
Common::UString _portrait
 The object's portrait. More...
 
bool _static
 Is the object static? More...
 
bool _usable
 Is the object usable? More...
 
int _currentHitPoints
 The current hitpoints of the object. More...
 
int _maxHitPoints
 The maximum hitpoints of the object. More...
 
bool _minOneHitPoint
 If the object should have at least one hitpoint. More...
 
std::list< uint32_ids
 The object's model IDs. More...
 
float _position [3]
 The object's position. More...
 
float _orientation [4]
 The object's orientation. More...
 
Sound::ChannelHandle _sound
 The currently playing object sound. More...
 
Room_room
 Room the object is in. More...
 
- Protected Attributes inherited from Aurora::NWScript::Object
uint32 _id
 
Common::UString _tag
 

Additional Inherited Members

- Static Public Member Functions inherited from Engines::KotOR::ScriptContainer
static bool runScript (const Common::UString &script, const Aurora::NWScript::ObjectReference owner=Aurora::NWScript::ObjectReference(), const Aurora::NWScript::ObjectReference triggerer=Aurora::NWScript::ObjectReference())
 
static bool runScript (const Common::UString &script, const Aurora::NWScript::ScriptState &state, const Aurora::NWScript::ObjectReference owner=Aurora::NWScript::ObjectReference(), const Aurora::NWScript::ObjectReference triggerer=Aurora::NWScript::ObjectReference())
 
- Protected Member Functions inherited from Engines::KotOR::ScriptContainer
void clearScripts ()
 
void readScripts (const Aurora::GFF3Struct &gff, bool clear=true)
 
void readScripts (const ScriptContainer &container)
 

Detailed Description

Definition at line 47 of file object.h.

Constructor & Destructor Documentation

◆ Object()

Engines::KotOR::Object::Object ( ObjectType  type = kObjectTypeInvalid)

Definition at line 41 of file object.cpp.

References Aurora::NWScript::Object::_id, _orientation, _position, Common::generateIDNumber(), and ObjectMan.

Here is the call graph for this function:

◆ ~Object()

Engines::KotOR::Object::~Object ( )
virtual

Reimplemented from Aurora::NWScript::Object.

Definition at line 61 of file object.cpp.

References ObjectMan.

Member Function Documentation

◆ click()

bool Engines::KotOR::Object::click ( Object triggerer = 0)
virtual

The object was clicked.

Reimplemented in Engines::KotOR::Creature, Engines::KotOR::Placeable, and Engines::KotOR::Door.

Definition at line 192 of file object.cpp.

Referenced by Engines::KotOR::Area::click().

Here is the caller graph for this function:

◆ enter()

void Engines::KotOR::Object::enter ( )
virtual

The cursor entered the object.

Reimplemented in Engines::KotOR::Module, Engines::KotOR::Creature, Engines::KotOR::Placeable, and Engines::KotOR::Door.

Definition at line 183 of file object.cpp.

Referenced by Engines::KotOR::Area::setActive().

Here is the caller graph for this function:

◆ getCurrentHitPoints()

int Engines::KotOR::Object::getCurrentHitPoints ( )

Return the objects current hitpoints.

Definition at line 110 of file object.cpp.

References _currentHitPoints.

Referenced by Engines::KotOR::Functions::getCurrentHitPoints().

Here is the caller graph for this function:

◆ getDescription()

const Common::UString & Engines::KotOR::Object::getDescription ( ) const

Return the object's description.

Definition at line 87 of file object.cpp.

References _description.

◆ getIDs()

const std::list< uint32 > & Engines::KotOR::Object::getIDs ( ) const

Return the object's model IDs.

Definition at line 134 of file object.cpp.

References _ids.

Referenced by Engines::KotOR::Area::removeObject().

Here is the caller graph for this function:

◆ getMaxHitPoints()

int Engines::KotOR::Object::getMaxHitPoints ( )

Get the maximum hit points for the objects.

Definition at line 99 of file object.cpp.

References _maxHitPoints.

Referenced by Engines::KotOR::Functions::getMaxHitPoints().

Here is the caller graph for this function:

◆ getMinOneHitPoints()

bool Engines::KotOR::Object::getMinOneHitPoints ( ) const

Get if the object has a minimum of one hp.

Definition at line 118 of file object.cpp.

References _minOneHitPoint.

Referenced by Engines::KotOR::Functions::getMinOneHP().

Here is the caller graph for this function:

◆ getName()

const Common::UString & Engines::KotOR::Object::getName ( ) const

Return the object's name.

Definition at line 83 of file object.cpp.

References _name.

Referenced by Engines::KotOR::Module::getName(), and Engines::KotOR::Functions::sendMessageToPC().

Here is the caller graph for this function:

◆ getOrientation()

void Engines::KotOR::Object::getOrientation ( float &  x,
float &  y,
float &  z,
float &  angle 
) const
virtual

Return the object's orientation.

Definition at line 144 of file object.cpp.

References _orientation.

Referenced by Engines::KotOR::Creature::changeBody(), Engines::KotOR::DialogGUI::makeLookAtPC(), Engines::KotOR::Situated::setOrientation(), and Engines::KotOR::Creature::setOrientation().

Here is the caller graph for this function:

◆ getPortrait()

const Common::UString & Engines::KotOR::Object::getPortrait ( ) const

Return the object's portrait.

Definition at line 91 of file object.cpp.

References _portrait.

Referenced by Engines::KotOR::HUD::setPartyLeader(), Engines::KotOR::HUD::setPartyMember1(), and Engines::KotOR::HUD::setPartyMember2().

Here is the caller graph for this function:

◆ getPosition()

void Engines::KotOR::Object::getPosition ( float &  x,
float &  y,
float &  z 
) const
virtual

◆ getRoom()

Room * Engines::KotOR::Object::getRoom ( )

Get a room the object is in.

Definition at line 175 of file object.cpp.

References _room.

Referenced by Engines::KotOR::Console::cmdGetPCRoom(), and Engines::KotOR::Area::notifyPCMoved().

Here is the caller graph for this function:

◆ getType()

ObjectType Engines::KotOR::Object::getType ( ) const

Return the exact type of the object.

Definition at line 65 of file object.cpp.

References _type.

Referenced by Engines::KotOR::Module::getObjectLocation(), and Engines::KotOR::Functions::getParamObject().

Here is the caller graph for this function:

◆ hide()

void Engines::KotOR::Object::hide ( )
virtual

Hide the object's model(s).

Reimplemented in Engines::KotOR::Area, Engines::KotOR::Creature, Engines::KotOR::Placeable, Engines::KotOR::Door, Engines::KotOR::Situated, and Engines::KotOR::Trigger.

Definition at line 72 of file object.cpp.

Referenced by hideSoft(), and Engines::KotOR::Waypoint::~Waypoint().

Here is the caller graph for this function:

◆ hideSoft()

void Engines::KotOR::Object::hideSoft ( )
virtual

Hide the object's model(s) if applicable.

Reimplemented in Engines::KotOR::Door, and Engines::KotOR::Trigger.

Definition at line 75 of file object.cpp.

References hide().

Here is the call graph for this function:

◆ highlight()

void Engines::KotOR::Object::highlight ( bool  enabled)
virtual

(Un)Highlight the object.

Reimplemented in Engines::KotOR::Creature, Engines::KotOR::Placeable, and Engines::KotOR::Door.

Definition at line 189 of file object.cpp.

◆ isClickable()

bool Engines::KotOR::Object::isClickable ( ) const

Can the player click the object?

Definition at line 130 of file object.cpp.

References _static, and _usable.

Referenced by Engines::KotOR::Situated::load(), and Engines::KotOR::Creature::loadBody().

Here is the caller graph for this function:

◆ isStatic()

bool Engines::KotOR::Object::isStatic ( ) const

Is the object static (not manipulable at all)?

Definition at line 122 of file object.cpp.

References _static.

Referenced by Engines::KotOR::Area::loadObject(), and Engines::KotOR::Area::removeObject().

Here is the caller graph for this function:

◆ isUsable()

bool Engines::KotOR::Object::isUsable ( ) const

Can the object be used by the PC?

Definition at line 126 of file object.cpp.

References _usable.

◆ isVisible()

bool Engines::KotOR::Object::isVisible ( ) const
virtual

Is the object's model(s) visible?

Reimplemented in Engines::KotOR::Creature, Engines::KotOR::Situated, and Engines::KotOR::Trigger.

Definition at line 79 of file object.cpp.

◆ leave()

void Engines::KotOR::Object::leave ( )
virtual

The cursor left the object.

Reimplemented in Engines::KotOR::Module, Engines::KotOR::Creature, Engines::KotOR::Placeable, and Engines::KotOR::Door.

Definition at line 186 of file object.cpp.

Referenced by Engines::KotOR::Area::removeFocus(), and Engines::KotOR::Area::setActive().

Here is the caller graph for this function:

◆ makeLookAt() [1/2]

void Engines::KotOR::Object::makeLookAt ( float  x,
float  y 
)

Definition at line 165 of file object.cpp.

References _position, Common::rad2deg(), and setOrientation().

Referenced by makeLookAt(), Engines::KotOR::DialogGUI::makeLookAtPC(), and Engines::KotOR::ActionExecutor::moveTo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeLookAt() [2/2]

void Engines::KotOR::Object::makeLookAt ( Object target)

Definition at line 171 of file object.cpp.

References _position, and makeLookAt().

Here is the call graph for this function:

◆ playAnimation()

void Engines::KotOR::Object::playAnimation ( const Common::UString anim,
bool  restart = true,
float  length = 0.0f,
float  speed = 1.0f 
)
virtual

Reimplemented in Engines::KotOR::Creature, and Engines::KotOR::Situated.

Definition at line 208 of file object.cpp.

Referenced by Engines::KotOR::Module::playAnimationOnActiveObject().

Here is the caller graph for this function:

◆ playSound()

void Engines::KotOR::Object::playSound ( const Common::UString sound,
bool  pitchVariance = false 
)

◆ setCurrentHitPoints()

void Engines::KotOR::Object::setCurrentHitPoints ( int  hitpoints)

Set the current hitpoints.

Definition at line 103 of file object.cpp.

References _currentHitPoints, _maxHitPoints, _minOneHitPoint, and MIN().

Referenced by Engines::KotOR::Functions::setMaxHitPoints().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setMaxHitPoints()

void Engines::KotOR::Object::setMaxHitPoints ( int  maxHP)

Set the maximum hit points for the objects.

Definition at line 95 of file object.cpp.

References _maxHitPoints.

Referenced by Engines::KotOR::Functions::setMaxHitPoints().

Here is the caller graph for this function:

◆ setMinOneHitPoints()

void Engines::KotOR::Object::setMinOneHitPoints ( bool  enabled)

Set if the object has a minimum of one hp.

Definition at line 114 of file object.cpp.

References _minOneHitPoint.

Referenced by Engines::KotOR::Functions::setMinOneHP().

Here is the caller graph for this function:

◆ setOrientation()

void Engines::KotOR::Object::setOrientation ( float  x,
float  y,
float  z,
float  angle 
)
virtual

Set the object's orientation.

Reimplemented in Engines::KotOR::Creature, and Engines::KotOR::Situated.

Definition at line 158 of file object.cpp.

References _orientation.

Referenced by Engines::KotOR::Waypoint::load(), makeLookAt(), Engines::KotOR::Situated::setOrientation(), and Engines::KotOR::Creature::setOrientation().

Here is the caller graph for this function:

◆ setPosition()

void Engines::KotOR::Object::setPosition ( float  x,
float  y,
float  z 
)
virtual

◆ setRoom()

void Engines::KotOR::Object::setRoom ( Room room)

Set a room the object is in.

Definition at line 179 of file object.cpp.

References _room.

Referenced by Engines::KotOR::Area::notifyObjectMoved().

Here is the caller graph for this function:

◆ show()

void Engines::KotOR::Object::show ( )
virtual

Show the object's model(s).

Reimplemented in Engines::KotOR::Area, Engines::KotOR::Creature, Engines::KotOR::Situated, and Engines::KotOR::Trigger.

Definition at line 69 of file object.cpp.

◆ stopSound()

void Engines::KotOR::Object::stopSound ( )

Stop the current object sound.

Definition at line 196 of file object.cpp.

References _sound, and SoundMan.

Referenced by playSound().

Here is the caller graph for this function:

Member Data Documentation

◆ _currentHitPoints

int Engines::KotOR::Object::_currentHitPoints
protected

The current hitpoints of the object.

Definition at line 150 of file object.h.

Referenced by getCurrentHitPoints(), Engines::KotOR::Placeable::loadObject(), Engines::KotOR::Creature::loadProperties(), and setCurrentHitPoints().

◆ _description

Common::UString Engines::KotOR::Object::_description
protected

◆ _ids

std::list<uint32> Engines::KotOR::Object::_ids
protected

The object's model IDs.

Definition at line 154 of file object.h.

Referenced by getIDs(), Engines::KotOR::Situated::load(), and Engines::KotOR::Creature::loadBody().

◆ _maxHitPoints

int Engines::KotOR::Object::_maxHitPoints
protected

◆ _minOneHitPoint

bool Engines::KotOR::Object::_minOneHitPoint
protected

If the object should have at least one hitpoint.

Definition at line 152 of file object.h.

Referenced by getMinOneHitPoints(), Engines::KotOR::Placeable::loadObject(), Engines::KotOR::Creature::loadProperties(), setCurrentHitPoints(), and setMinOneHitPoints().

◆ _name

Common::UString Engines::KotOR::Object::_name
protected

◆ _orientation

float Engines::KotOR::Object::_orientation[4]
protected

The object's orientation.

Definition at line 157 of file object.h.

Referenced by getOrientation(), Engines::KotOR::Placeable::load(), Engines::KotOR::Door::load(), Object(), and setOrientation().

◆ _portrait

Common::UString Engines::KotOR::Object::_portrait
protected

◆ _position

float Engines::KotOR::Object::_position[3]
protected

The object's position.

Definition at line 156 of file object.h.

Referenced by getPosition(), Engines::KotOR::Placeable::load(), Engines::KotOR::Door::load(), makeLookAt(), Object(), and setPosition().

◆ _room

Room* Engines::KotOR::Object::_room
protected

Room the object is in.

Definition at line 161 of file object.h.

Referenced by getRoom(), and setRoom().

◆ _sound

Sound::ChannelHandle Engines::KotOR::Object::_sound
protected

The currently playing object sound.

Definition at line 159 of file object.h.

Referenced by playSound(), and stopSound().

◆ _static

bool Engines::KotOR::Object::_static
protected

Is the object static?

Definition at line 147 of file object.h.

Referenced by isClickable(), isStatic(), Engines::KotOR::Situated::loadProperties(), and Engines::KotOR::Creature::loadProperties().

◆ _type

ObjectType Engines::KotOR::Object::_type
protected

The object's type.

Definition at line 140 of file object.h.

Referenced by getType().

◆ _usable

bool Engines::KotOR::Object::_usable
protected

Is the object usable?

Definition at line 148 of file object.h.

Referenced by isClickable(), isUsable(), Engines::KotOR::Situated::loadProperties(), and Engines::KotOR::Creature::loadProperties().


The documentation for this class was generated from the following files: