xoreos
0.0.5
|
#include <creature.h>
Classes | |
struct | PartModels |
Parts of a creature's body. More... | |
Public Member Functions | |
Creature () | |
Create a dummy creature instance. More... | |
Creature (const Aurora::GFF3Struct &creature) | |
Load from a creature instance. More... | |
~Creature () | |
void | createFakePC () |
Create a fake player character creature for testing purposes. More... | |
void | createPC (const CharacterGenerationInfo &info) |
Create a player character creature. More... | |
void | show () |
Show the creature's model. More... | |
void | hide () |
Hide the creature's model. More... | |
bool | isVisible () const |
Is the creature's model visible? More... | |
bool | isPC () const |
Is the creature a player character? More... | |
bool | isPartyMember () const |
void | setPosition (float x, float y, float z) |
Set the creature's position. More... | |
void | setOrientation (float x, float y, float z, float angle) |
Set the creature's orientation. More... | |
void | enter () |
The cursor entered the creature. More... | |
void | leave () |
The cursor left the creature. More... | |
void | highlight (bool enabled) |
(Un)Highlight the creature. More... | |
bool | click (Object *triggerer=0) |
The creature was clicked. More... | |
const Common::UString & | getConversation () const |
float | getCameraHeight () const |
void | playDefaultAnimation () |
void | playDefaultHeadAnimation () |
void | playAnimation (const Common::UString &anim, bool restart=true, float length=0.0f, float speed=1.0f) |
void | playHeadAnimation (const Common::UString &anim, bool restart=true, float length=0.0f, float speed=1.0f) |
Public Member Functions inherited from Engines::KotOR2::Object | |
Object (ObjectType type=kObjectTypeInvalid) | |
virtual | ~Object () |
ObjectType | getType () const |
Return the exact type of the object. More... | |
virtual void | hideSoft () |
Hide the object's model(s) if applicable. More... | |
const std::list< uint32 > & | getIDs () const |
Return the object's model IDs. More... | |
const Common::UString & | getName () const |
Return the object's name. More... | |
const Common::UString & | getDescription () const |
Return the object's description. More... | |
const Common::UString & | getPortrait () 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... | |
void | makeLookAt (float x, float y) |
void | makeLookAt (Object *target) |
Room * | getRoom () |
Get a room the object is in. More... | |
void | setRoom (Room *room) |
Set a room the object is in. More... | |
void | stopSound () |
Stop the current object sound. More... | |
void | playSound (const Common::UString &sound, bool pitchVariance=false) |
Play an object sound. More... | |
Public Member Functions inherited from Aurora::NWScript::Object | |
Object () | |
uint32 | getID () const |
const Common::UString & | getTag () const |
Public Member Functions inherited from Aurora::NWScript::VariableContainer | |
VariableContainer () | |
virtual | ~VariableContainer () |
bool | hasVariable (const Common::UString &var) const |
Variable & | getVariable (const Common::UString &var, Type type=kTypeVoid) |
const Variable & | getVariable (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::UString & | getScript (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()) |
Private Member Functions | |
void | init () |
void | load (const Aurora::GFF3Struct &creature) |
void | load (const Aurora::GFF3Struct &instance, const Aurora::GFF3Struct *blueprint) |
void | loadProperties (const Aurora::GFF3Struct &gff) |
void | loadPortrait (const Aurora::GFF3Struct &gff) |
void | loadAppearance () |
void | getPartModels (PartModels &parts, uint32 state='a') |
void | loadBody (PartModels &parts) |
void | loadHead (PartModels &parts) |
void | setDefaultAnimations () |
Private Attributes | |
bool | _isPC |
Is the creature a PC? More... | |
uint32 | _appearance |
The creature's general appearance. More... | |
Common::ScopedPtr< Graphics::Aurora::Model > | _model |
The creature's model. More... | |
Common::UString | _conversation |
Common::UString | _modelType |
Definition at line 44 of file creature.h.
Engines::KotOR2::Creature::Creature | ( | ) |
Create a dummy creature instance.
Not playable as it is.
Definition at line 54 of file creature.cpp.
References init().
Engines::KotOR2::Creature::Creature | ( | const Aurora::GFF3Struct & | creature | ) |
Load from a creature instance.
Definition at line 49 of file creature.cpp.
References init(), and load().
Engines::KotOR2::Creature::~Creature | ( | ) |
Definition at line 58 of file creature.cpp.
|
virtual |
The creature was clicked.
Reimplemented from Engines::KotOR2::Object.
Definition at line 298 of file creature.cpp.
References Engines::KotOR2::ScriptContainer::hasScript(), Engines::KotOR2::kScriptClick, Engines::KotOR2::kScriptDialogue, and Engines::KotOR2::ScriptContainer::runScript().
void Engines::KotOR2::Creature::createFakePC | ( | ) |
Create a fake player character creature for testing purposes.
Definition at line 263 of file creature.cpp.
References _isPC, Engines::KotOR2::Object::_name, Aurora::NWScript::Object::_tag, Common::UString::c_str(), and Common::UString::format().
void Engines::KotOR2::Creature::createPC | ( | const CharacterGenerationInfo & | info | ) |
Create a player character creature.
Definition at line 270 of file creature.cpp.
References _isPC, Engines::KotOR2::Object::_name, Engines::KotOR2::Creature::PartModels::body, Engines::KotOR2::Creature::PartModels::bodyTexture, Engines::KotOR2::Creature::PartModels::head, info(), loadBody(), loadHead(), and setDefaultAnimations().
|
virtual |
The cursor entered the creature.
Reimplemented from Engines::KotOR2::Object.
Definition at line 286 of file creature.cpp.
References highlight().
float Engines::KotOR2::Creature::getCameraHeight | ( | ) | const |
Definition at line 314 of file creature.cpp.
References _model, and Graphics::Aurora::ModelNode::getPosition().
const Common::UString & Engines::KotOR2::Creature::getConversation | ( | ) | const |
Definition at line 310 of file creature.cpp.
References _conversation.
Referenced by Engines::KotOR2::Module::clickObject(), and Engines::KotOR2::Module::startConversation().
|
private |
Definition at line 208 of file creature.cpp.
References _appearance, _modelType, Common::UString::beginsWith(), Engines::KotOR2::Creature::PartModels::body, Engines::KotOR2::Creature::PartModels::bodyTexture, Aurora::TwoDARow::getInt(), Aurora::TwoDAFile::getRow(), Aurora::TwoDARow::getString(), Engines::KotOR2::Creature::PartModels::head, and TwoDAReg.
Referenced by loadAppearance().
|
virtual |
Hide the creature's model.
Reimplemented from Engines::KotOR2::Object.
Definition at line 72 of file creature.cpp.
References _model.
|
virtual |
(Un)Highlight the creature.
Reimplemented from Engines::KotOR2::Object.
Definition at line 294 of file creature.cpp.
References _model.
Referenced by enter(), and leave().
|
private |
Definition at line 61 of file creature.cpp.
References _appearance, _isPC, and Aurora::kFieldIDInvalid.
Referenced by Creature().
bool Engines::KotOR2::Creature::isPartyMember | ( | ) | const |
Definition at line 85 of file creature.cpp.
References _isPC.
Referenced by Engines::KotOR2::ObjectContainer::toPartyMember().
bool Engines::KotOR2::Creature::isPC | ( | ) | const |
Is the creature a player character?
Definition at line 81 of file creature.cpp.
References _isPC.
Referenced by Engines::KotOR2::ObjectContainer::toPC().
|
virtual |
Is the creature's model visible?
Reimplemented from Engines::KotOR2::Object.
Definition at line 77 of file creature.cpp.
References _model.
|
virtual |
The cursor left the creature.
Reimplemented from Engines::KotOR2::Object.
Definition at line 290 of file creature.cpp.
References highlight().
|
private |
Definition at line 105 of file creature.cpp.
References Aurora::NWScript::Object::_tag, Common::UString::c_str(), Common::UString::empty(), Aurora::GFF3Struct::getString(), Aurora::kFileTypeUTC, Engines::loadOptionalGFF3(), MKTAG, Common::ScopedPtrBase< T, Deallocator >::reset(), and warning().
Referenced by Creature().
|
private |
Definition at line 118 of file creature.cpp.
References _appearance, Aurora::GFF3Struct::getDouble(), Aurora::kFieldIDInvalid, loadAppearance(), loadProperties(), Common::rad2deg(), setOrientation(), and setPosition().
|
private |
Definition at line 191 of file creature.cpp.
References _modelType, Aurora::NWScript::Object::_tag, Engines::KotOR2::Creature::PartModels::body, Common::UString::c_str(), Common::UString::empty(), getPartModels(), loadBody(), loadHead(), setDefaultAnimations(), and warning().
Referenced by load().
|
private |
Definition at line 238 of file creature.cpp.
References Engines::KotOR2::Object::_ids, _model, _modelType, Aurora::NWScript::Object::_tag, Engines::KotOR2::Creature::PartModels::body, Engines::KotOR2::Creature::PartModels::bodyTexture, Engines::KotOR2::Object::isClickable(), Graphics::Aurora::kAnimationChannelHead, Engines::loadModelObject(), and Common::ScopedPtrBase< T, Deallocator >::reset().
Referenced by createPC(), and loadAppearance().
|
private |
Definition at line 252 of file creature.cpp.
References _model, Common::UString::empty(), Engines::KotOR2::Creature::PartModels::head, and Engines::loadModelObject().
Referenced by createPC(), and loadAppearance().
|
private |
Definition at line 178 of file creature.cpp.
References Engines::KotOR2::Object::_portrait, Common::UString::empty(), Aurora::TwoDAFile::getRow(), Aurora::TwoDARow::getString(), Aurora::GFF3Struct::getString(), Aurora::GFF3Struct::getUint(), and TwoDAReg.
Referenced by loadProperties().
|
private |
Definition at line 147 of file creature.cpp.
References _appearance, _conversation, Engines::KotOR2::Object::_description, _isPC, Engines::KotOR2::Object::_name, Engines::KotOR2::Object::_static, Aurora::NWScript::Object::_tag, Engines::KotOR2::Object::_usable, Aurora::GFF3Struct::getBool(), Aurora::GFF3Struct::getString(), Aurora::GFF3Struct::getUint(), loadPortrait(), and Engines::KotOR2::ScriptContainer::readScripts().
Referenced by load().
|
virtual |
Reimplemented from Engines::KotOR2::Object.
Definition at line 349 of file creature.cpp.
References _model.
Referenced by Engines::KotOR2::DialogGUI::playTalkAnimations().
void Engines::KotOR2::Creature::playDefaultAnimation | ( | ) |
Definition at line 327 of file creature.cpp.
References _model.
Referenced by Engines::KotOR2::DialogGUI::playDefaultAnimations().
void Engines::KotOR2::Creature::playDefaultHeadAnimation | ( | ) |
Definition at line 332 of file creature.cpp.
References _model, _modelType, Graphics::Aurora::Model::getAnimationChannel(), Graphics::Aurora::kAnimationChannelAll, Graphics::Aurora::kAnimationChannelHead, and Graphics::Aurora::AnimationChannel::playDefaultAnimation().
Referenced by Engines::KotOR2::Module::playAnimationOnActiveObject(), and Engines::KotOR2::DialogGUI::playDefaultAnimations().
void Engines::KotOR2::Creature::playHeadAnimation | ( | const Common::UString & | anim, |
bool | restart = true , |
||
float | length = 0.0f , |
||
float | speed = 1.0f |
||
) |
Definition at line 354 of file creature.cpp.
References _model, _modelType, Graphics::Aurora::Model::getAnimationChannel(), Graphics::Aurora::kAnimationChannelAll, Graphics::Aurora::kAnimationChannelHead, and Graphics::Aurora::AnimationChannel::playAnimation().
Referenced by Engines::KotOR2::Module::playAnimationOnActiveObject(), and Engines::KotOR2::DialogGUI::playTalkAnimations().
|
private |
Definition at line 371 of file creature.cpp.
References _model, and _modelType.
Referenced by createPC(), and loadAppearance().
|
virtual |
Set the creature's orientation.
Reimplemented from Engines::KotOR2::Object.
Definition at line 97 of file creature.cpp.
References _model, Engines::KotOR2::Object::getOrientation(), and Engines::KotOR2::Object::setOrientation().
Referenced by load().
|
virtual |
Set the creature's position.
Reimplemented from Engines::KotOR2::Object.
Definition at line 89 of file creature.cpp.
References _model, Engines::KotOR2::Object::getPosition(), and Engines::KotOR2::Object::setPosition().
Referenced by load().
|
virtual |
Show the creature's model.
Reimplemented from Engines::KotOR2::Object.
Definition at line 67 of file creature.cpp.
References _model.
|
private |
The creature's general appearance.
Definition at line 118 of file creature.h.
Referenced by getPartModels(), init(), load(), and loadProperties().
|
private |
Definition at line 121 of file creature.h.
Referenced by getConversation(), and loadProperties().
|
private |
Is the creature a PC?
Definition at line 116 of file creature.h.
Referenced by createFakePC(), createPC(), init(), isPartyMember(), isPC(), and loadProperties().
|
private |
The creature's model.
Definition at line 120 of file creature.h.
Referenced by getCameraHeight(), hide(), highlight(), isVisible(), loadBody(), loadHead(), playAnimation(), playDefaultAnimation(), playDefaultHeadAnimation(), playHeadAnimation(), setDefaultAnimations(), setOrientation(), setPosition(), and show().
|
private |
Definition at line 122 of file creature.h.
Referenced by getPartModels(), loadAppearance(), loadBody(), playDefaultHeadAnimation(), playHeadAnimation(), and setDefaultAnimations().