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

#include <object.h>

Inheritance diagram for Engines::KotOR2::Object:
Inheritance graph
[legend]
Collaboration diagram for Engines::KotOR2::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...
 
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::KotOR2::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...
 
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::KotOR2::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::KotOR2::ScriptContainer
void clearScripts ()
 
void readScripts (const Aurora::GFF3Struct &gff)
 
void readScripts (const ScriptContainer &container)
 

Detailed Description

Definition at line 47 of file object.h.

Constructor & Destructor Documentation

◆ Object()

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

Definition at line 40 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::KotOR2::Object::~Object ( )
virtual

Reimplemented from Aurora::NWScript::Object.

Definition at line 57 of file object.cpp.

References ObjectMan.

Member Function Documentation

◆ click()

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

The object was clicked.

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

Definition at line 161 of file object.cpp.

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

Here is the caller graph for this function:

◆ enter()

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

The cursor entered the object.

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

Definition at line 152 of file object.cpp.

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

Here is the caller graph for this function:

◆ getDescription()

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

Return the object's description.

Definition at line 83 of file object.cpp.

References _description.

◆ getIDs()

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

Return the object's model IDs.

Definition at line 103 of file object.cpp.

References _ids.

◆ getName()

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

Return the object's name.

Definition at line 79 of file object.cpp.

References _name.

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

Here is the caller graph for this function:

◆ getOrientation()

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

Return the object's orientation.

Definition at line 113 of file object.cpp.

References _orientation.

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

Here is the caller graph for this function:

◆ getPortrait()

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

Return the object's portrait.

Definition at line 87 of file object.cpp.

References _portrait.

◆ getPosition()

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

◆ getRoom()

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

Get a room the object is in.

Definition at line 144 of file object.cpp.

References _room.

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

Here is the caller graph for this function:

◆ getType()

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

Return the exact type of the object.

Definition at line 61 of file object.cpp.

References _type.

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

Here is the caller graph for this function:

◆ hide()

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

Hide the object's model(s).

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

Definition at line 68 of file object.cpp.

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

Here is the caller graph for this function:

◆ hideSoft()

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

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

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

Definition at line 71 of file object.cpp.

References hide().

Here is the call graph for this function:

◆ highlight()

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

(Un)Highlight the object.

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

Definition at line 158 of file object.cpp.

◆ isClickable()

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

Can the player click the object?

Definition at line 99 of file object.cpp.

References _static, and _usable.

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

Here is the caller graph for this function:

◆ isStatic()

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

Is the object static (not manipulable at all)?

Definition at line 91 of file object.cpp.

References _static.

Referenced by Engines::KotOR2::Area::loadObject().

Here is the caller graph for this function:

◆ isUsable()

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

Can the object be used by the PC?

Definition at line 95 of file object.cpp.

References _usable.

◆ isVisible()

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

Is the object's model(s) visible?

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

Definition at line 75 of file object.cpp.

◆ leave()

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

The cursor left the object.

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

Definition at line 155 of file object.cpp.

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

Here is the caller graph for this function:

◆ makeLookAt() [1/2]

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

Definition at line 134 of file object.cpp.

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

Referenced by makeLookAt(), and Engines::KotOR2::DialogGUI::makeLookAtPC().

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

◆ makeLookAt() [2/2]

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

Definition at line 140 of file object.cpp.

References _position, and makeLookAt().

Here is the call graph for this function:

◆ playAnimation()

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

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

Definition at line 177 of file object.cpp.

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

Here is the caller graph for this function:

◆ playSound()

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

◆ setOrientation()

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

Set the object's orientation.

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

Definition at line 127 of file object.cpp.

References _orientation.

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

Here is the caller graph for this function:

◆ setPosition()

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

Set the object's position within its area.

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

Definition at line 121 of file object.cpp.

References _position.

Referenced by Engines::KotOR2::Trigger::load(), Engines::KotOR2::Waypoint::load(), Engines::KotOR2::Creature::setPosition(), and Engines::KotOR2::Situated::setPosition().

Here is the caller graph for this function:

◆ setRoom()

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

Set a room the object is in.

Definition at line 148 of file object.cpp.

References _room.

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

Here is the caller graph for this function:

◆ show()

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

Show the object's model(s).

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

Definition at line 65 of file object.cpp.

◆ stopSound()

void Engines::KotOR2::Object::stopSound ( )

Stop the current object sound.

Definition at line 165 of file object.cpp.

References _sound, and SoundMan.

Referenced by playSound().

Here is the caller graph for this function:

Member Data Documentation

◆ _description

Common::UString Engines::KotOR2::Object::_description
protected

The object's description.

Definition at line 130 of file object.h.

Referenced by getDescription(), Engines::KotOR2::Situated::loadProperties(), and Engines::KotOR2::Creature::loadProperties().

◆ _ids

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

The object's model IDs.

Definition at line 137 of file object.h.

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

◆ _name

Common::UString Engines::KotOR2::Object::_name
protected

◆ _orientation

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

The object's orientation.

Definition at line 140 of file object.h.

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

◆ _portrait

Common::UString Engines::KotOR2::Object::_portrait
protected

The object's portrait.

Definition at line 132 of file object.h.

Referenced by getPortrait(), Engines::KotOR2::Situated::loadPortrait(), and Engines::KotOR2::Creature::loadPortrait().

◆ _position

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

The object's position.

Definition at line 139 of file object.h.

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

◆ _room

Room* Engines::KotOR2::Object::_room
protected

Room the object is in.

Definition at line 144 of file object.h.

Referenced by getRoom(), and setRoom().

◆ _sound

Sound::ChannelHandle Engines::KotOR2::Object::_sound
protected

The currently playing object sound.

Definition at line 142 of file object.h.

Referenced by playSound(), and stopSound().

◆ _static

bool Engines::KotOR2::Object::_static
protected

◆ _type

ObjectType Engines::KotOR2::Object::_type
protected

The object's type.

Definition at line 127 of file object.h.

Referenced by getType().

◆ _usable

bool Engines::KotOR2::Object::_usable
protected

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