Skyscraper 2.0
|
#include <primitive.h>
Public Member Functions | |
Primitive (Object *parent, const std::string &name) | |
~Primitive () | |
bool | IsEnabled () |
void | Enabled (bool value) |
bool | IsKey () |
int | GetKeyID () |
void | SetKey (int keyid) |
bool | IsPhysical () |
void | Loop () |
void | PickUp () |
void | Drop () |
bool | IsPickedUp () |
MeshObject * | GetMeshObject () |
void | OnClick (Vector3 &position, bool shift, bool ctrl, bool alt, bool right) |
bool | Attach (const std::string &meshname, const Vector3 &position, const Vector3 &rotation, Real max_render_distance=0, Real scale_multiplier=1, bool enable_physics=false, Real restitution=0, Real friction=0, Real mass=0) |
void | SetTexture (const std::string &texture) |
![]() | |
Object (Object *parent) | |
virtual | ~Object () |
void | SetValues (const std::string &type, const std::string &name, bool is_permanent, bool is_movable=true) |
bool | IsPermanent () |
bool | IsMovable () |
const std::string & | GetType () |
int | GetNumber () |
void | AddChild (Object *object) |
Object * | GetChild (int index) |
int | GetChildrenCount () |
void | RemoveChild (Object *object) |
SceneNode * | GetSceneNode () |
void | ShowBoundingBox (bool value) |
virtual void | Move (const Vector3 &vector, Real speed=1.0) |
virtual void | Move (Real X, Real Y, Real Z, Real speed=1.0) |
virtual void | SetPosition (const Vector3 &position) |
void | SetPositionRelative (const Vector3 &position) |
virtual void | SetPosition (Real X, Real Y, Real Z) |
void | SetPositionRelative (Real X, Real Y, Real Z) |
virtual void | SetPositionY (Real value) |
virtual Vector3 | GetPosition (bool relative=false) |
virtual void | Rotate (const Vector3 &vector, Real speed=1.0) |
virtual void | Rotate (Real X, Real Y, Real Z, Real speed=1.0) |
virtual void | SetRotation (const Vector3 &rotation) |
virtual void | SetRotation (Real X, Real Y, Real Z) |
virtual Vector3 | GetRotation () |
Quaternion | GetOrientation (bool relative=false) |
void | SetOrientation (const Quaternion &q, bool relative=false) |
virtual void | OnMove (bool parent) |
virtual void | OnRotate (bool parent) |
virtual void | OnUnclick (bool right) |
virtual void | OnHit () |
void | NotifyMove (bool parent=false) |
void | NotifyRotate (bool parent=false) |
virtual void | ResetState () |
void | ChangeParent (Object *new_parent) |
bool | IsGlobal () |
void | Init (bool children=true) |
virtual void | OnInit () |
void | RegisterLoop (Object *object) |
void | UnregisterLoop (Object *object) |
std::string | GetNameBase () |
template<typename T > | |
bool | IsType () |
template<typename T > | |
T * | ConvertTo () |
![]() | |
ObjectBase (Object *parent) | |
virtual | ~ObjectBase () |
Object * | GetParent () |
SBS * | GetRoot () |
void | SetName (const std::string &name) |
const std::string & | GetName () |
std::string | GetNameBase () |
virtual void | Report (const std::string &message) |
virtual bool | ReportError (const std::string &message) |
Public Attributes | |
bool | always_visible |
int | collider_type |
![]() | |
std::string | command |
std::string | command_processed |
std::string | context |
int | linenum |
std::string | includefile |
bool | parent_deleting |
Private Member Functions | |
void | RemoveFromParent () |
void | AddToParent () |
Private Attributes | |
MeshObject * | mesh |
Vector3 | Offset |
bool | is_key |
int | KeyID |
bool | global |
Additional Inherited Members | |
![]() | |
void | EnableLoop (bool value) |
void | LoopChildren () |
bool | SelfDestruct () |
![]() | |
SBS * | sbs |
Definition at line 29 of file primitive.h.
SBS::Primitive::Primitive | ( | Object * | parent, |
const std::string & | name ) |
Definition at line 38 of file primitive.cpp.
References always_visible, collider_type, global, is_key, SBS::Object::IsGlobal(), KeyID, mesh, Offset, and SBS::Object::SetValues().
SBS::Primitive::~Primitive | ( | ) |
Definition at line 53 of file primitive.cpp.
References SBS::SBS::FastDelete, mesh, SBS::Object::parent_deleting, RemoveFromParent(), and SBS::ObjectBase::sbs.
|
private |
Definition at line 102 of file primitive.cpp.
References SBS::SBS::AddPrimitive(), SBS::ObjectBase::GetParent(), SBS::Object::GetType(), and SBS::ObjectBase::sbs.
Referenced by Drop(), and Loop().
bool SBS::Primitive::Attach | ( | const std::string & | meshname, |
const Vector3 & | position, | ||
const Vector3 & | rotation, | ||
Real | max_render_distance = 0, | ||
Real | scale_multiplier = 1, | ||
bool | enable_physics = false, | ||
Real | restitution = 0, | ||
Real | friction = 0, | ||
Real | mass = 0 ) |
Definition at line 244 of file primitive.cpp.
References collider_type, Enabled(), SBS::MeshObject::EnablePhysics(), SBS::ObjectBase::GetName(), SBS::Object::Init(), mesh, SBS::Object::Move(), and SBS::Object::SetRotation().
Referenced by Skyscraper::ScriptProcessor::CommandsSection::Run().
void SBS::Primitive::Drop | ( | ) |
Definition at line 190 of file primitive.cpp.
References AddToParent(), SBS::Object::ChangeParent(), SBS::SBS::GetElevator(), SBS::SBS::GetElevatorCount(), SBS::SBS::GetFloor(), SBS::SBS::GetFloorNumber(), SBS::Object::GetPosition(), global, SBS::Elevator::IsInElevator(), IsPickedUp(), and SBS::ObjectBase::sbs.
|
virtual |
Reimplemented from SBS::Object.
Definition at line 67 of file primitive.cpp.
References always_visible, SBS::MeshObject::Enabled(), SBS::Object::EnableLoop(), and mesh.
Referenced by Attach().
int SBS::Primitive::GetKeyID | ( | ) |
|
inline |
Definition at line 49 of file primitive.h.
bool SBS::Primitive::IsEnabled | ( | ) |
Definition at line 76 of file primitive.cpp.
References SBS::MeshObject::IsEnabled(), and mesh.
bool SBS::Primitive::IsKey | ( | ) |
bool SBS::Primitive::IsPhysical | ( | ) |
Definition at line 81 of file primitive.cpp.
References SBS::MeshObject::IsPhysical(), and mesh.
bool SBS::Primitive::IsPickedUp | ( | ) |
Definition at line 231 of file primitive.cpp.
References SBS::SBS::camera, SBS::ObjectBase::GetParent(), and SBS::ObjectBase::sbs.
Referenced by Drop(), and PickUp().
|
virtual |
Reimplemented from SBS::Object.
Definition at line 118 of file primitive.cpp.
References AddToParent(), SBS::Object::ChangeParent(), SBS::Object::ConvertTo(), SBS::SBS::GetElevator(), SBS::SBS::GetElevatorCount(), SBS::SBS::GetFloor(), SBS::SBS::GetFloorNumber(), SBS::ObjectBase::GetParent(), SBS::Object::GetPosition(), global, SBS::Elevator::IsInElevator(), RemoveFromParent(), SBS::ObjectBase::sbs, and SBS_PROFILE.
|
virtual |
Reimplemented from SBS::Object.
Definition at line 236 of file primitive.cpp.
void SBS::Primitive::PickUp | ( | ) |
Definition at line 178 of file primitive.cpp.
References SBS::SBS::camera, SBS::Object::ChangeParent(), IsPickedUp(), RemoveFromParent(), and SBS::ObjectBase::sbs.
|
private |
Definition at line 86 of file primitive.cpp.
References SBS::ObjectBase::GetParent(), SBS::Object::GetType(), SBS::SBS::RemovePrimitive(), and SBS::ObjectBase::sbs.
Referenced by Loop(), PickUp(), and ~Primitive().
void SBS::Primitive::SetKey | ( | int | keyid | ) |
void SBS::Primitive::SetTexture | ( | const std::string & | texture | ) |
Definition at line 267 of file primitive.cpp.
References mesh, and SBS::MeshObject::SetMaterial().
Referenced by Skyscraper::ScriptProcessor::CommandsSection::Run().
bool SBS::Primitive::always_visible |
Definition at line 33 of file primitive.h.
Referenced by Enabled(), Primitive(), and Skyscraper::ScriptProcessor::CommandsSection::Run().
int SBS::Primitive::collider_type |
Definition at line 34 of file primitive.h.
Referenced by Attach(), Primitive(), and Skyscraper::ScriptProcessor::CommandsSection::Run().
|
private |
Definition at line 62 of file primitive.h.
Referenced by Drop(), Loop(), and Primitive().
|
private |
Definition at line 60 of file primitive.h.
Referenced by Primitive().
|
private |
Definition at line 61 of file primitive.h.
Referenced by Primitive().
|
private |
Definition at line 58 of file primitive.h.
Referenced by Attach(), Enabled(), IsEnabled(), IsPhysical(), Primitive(), SetTexture(), and ~Primitive().
|
private |
Definition at line 59 of file primitive.h.
Referenced by Primitive().