Skyscraper 2.0
SBS::Model Class Reference

#include <model.h>

Inheritance diagram for SBS::Model:
Collaboration diagram for SBS::Model:

Public Member Functions

 Model (Object *parent, const std::string &name, const std::string &filename, bool center, 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)
 
 ~Model ()
 
bool IsEnabled ()
 
void Enabled (bool value)
 
bool IsKey ()
 
int GetKeyID ()
 
void SetKey (int keyid)
 
bool IsPhysical ()
 
void Loop ()
 
void PickUp ()
 
void Drop ()
 
bool IsPickedUp ()
 
MeshObjectGetMeshObject ()
 
void OnInit ()
 
bool IsCustom ()
 
void OnClick (Vector3 &position, bool shift, bool ctrl, bool alt, bool right)
 
- Public Member Functions inherited from SBS::Object
 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)
 
ObjectGetChild (int index)
 
int GetChildrenCount ()
 
void RemoveChild (Object *object)
 
SceneNodeGetSceneNode ()
 
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)
 
void RegisterLoop (Object *object)
 
void UnregisterLoop (Object *object)
 
std::string GetNameBase ()
 
template<typename T >
bool IsType ()
 
template<typename T >
T * ConvertTo ()
 
- Public Member Functions inherited from SBS::ObjectBase
 ObjectBase (Object *parent)
 
virtual ~ObjectBase ()
 
ObjectGetParent ()
 
SBSGetRoot ()
 
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 load_error
 
- Public Attributes inherited from SBS::Object
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

MeshObjectmesh
 
Vector3 Offset
 
bool is_key
 
int KeyID
 
bool global
 
bool center
 
bool custom
 

Additional Inherited Members

- Protected Member Functions inherited from SBS::Object
void EnableLoop (bool value)
 
void LoopChildren ()
 
bool SelfDestruct ()
 
- Protected Attributes inherited from SBS::ObjectBase
SBSsbs
 

Detailed Description

Definition at line 29 of file model.h.

Constructor & Destructor Documentation

◆ Model()

SBS::Model::Model ( Object * parent,
const std::string & name,
const std::string & filename,
bool center,
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 )

◆ ~Model()

SBS::Model::~Model ( )

Definition at line 75 of file model.cpp.

References SBS::SBS::FastDelete, mesh, SBS::Object::parent_deleting, RemoveFromParent(), and SBS::ObjectBase::sbs.

Here is the call graph for this function:

Member Function Documentation

◆ AddToParent()

void SBS::Model::AddToParent ( )
private

Definition at line 137 of file model.cpp.

References SBS::SBS::AddModel(), SBS::ObjectBase::GetParent(), SBS::Object::GetType(), and SBS::ObjectBase::sbs.

Referenced by Drop(), and Loop().

Here is the call graph for this function:

◆ Drop()

◆ Enabled()

void SBS::Model::Enabled ( bool value)
virtual

Reimplemented from SBS::Object.

Definition at line 89 of file model.cpp.

References SBS::MeshObject::Enabled(), SBS::Object::EnableLoop(), and mesh.

Referenced by Model().

Here is the call graph for this function:

◆ GetKeyID()

int SBS::Model::GetKeyID ( )

Definition at line 105 of file model.cpp.

References KeyID.

Referenced by OnClick().

◆ GetMeshObject()

MeshObject * SBS::Model::GetMeshObject ( )
inline

Definition at line 47 of file model.h.

Referenced by Skyscraper::ScriptProcessor::Section::GetMeshObject().

◆ IsCustom()

bool SBS::Model::IsCustom ( )
inline

Definition at line 49 of file model.h.

Referenced by Skyscraper::ScriptProcessor::Section::GetMeshObject().

◆ IsEnabled()

bool SBS::Model::IsEnabled ( )

Definition at line 95 of file model.cpp.

References SBS::MeshObject::IsEnabled(), and mesh.

Here is the call graph for this function:

◆ IsKey()

bool SBS::Model::IsKey ( )

Definition at line 100 of file model.cpp.

References is_key.

Referenced by OnClick().

◆ IsPhysical()

bool SBS::Model::IsPhysical ( )

Definition at line 116 of file model.cpp.

References SBS::MeshObject::IsPhysical(), and mesh.

Referenced by SBS::Camera::PickUpModel().

Here is the call graph for this function:

◆ IsPickedUp()

bool SBS::Model::IsPickedUp ( )

Definition at line 266 of file model.cpp.

References SBS::SBS::camera, SBS::ObjectBase::GetParent(), and SBS::ObjectBase::sbs.

Referenced by Drop(), and PickUp().

Here is the call graph for this function:

◆ Loop()

◆ OnClick()

void SBS::Model::OnClick ( Vector3 & position,
bool shift,
bool ctrl,
bool alt,
bool right )
virtual

Reimplemented from SBS::Object.

Definition at line 282 of file model.cpp.

References SBS::SBS::AddKey(), GetKeyID(), SBS::ObjectBase::GetName(), IsKey(), SBS::ObjectBase::sbs, and SBS::Object::SelfDestruct().

Here is the call graph for this function:

◆ OnInit()

void SBS::Model::OnInit ( )
virtual

Reimplemented from SBS::Object.

Definition at line 271 of file model.cpp.

References center, SBS::MeshObject::GetOffset(), mesh, SBS::Object::Move(), and Offset.

Here is the call graph for this function:

◆ PickUp()

void SBS::Model::PickUp ( )

Definition at line 213 of file model.cpp.

References SBS::SBS::camera, SBS::Object::ChangeParent(), IsPickedUp(), RemoveFromParent(), and SBS::ObjectBase::sbs.

Referenced by SBS::Camera::PickUpModel().

Here is the call graph for this function:

◆ RemoveFromParent()

void SBS::Model::RemoveFromParent ( )
private

Definition at line 121 of file model.cpp.

References SBS::ObjectBase::GetParent(), SBS::Object::GetType(), SBS::SBS::RemoveModel(), and SBS::ObjectBase::sbs.

Referenced by Loop(), PickUp(), and ~Model().

Here is the call graph for this function:

◆ SetKey()

Member Data Documentation

◆ center

bool SBS::Model::center
private

Definition at line 61 of file model.h.

Referenced by Model(), and OnInit().

◆ custom

bool SBS::Model::custom
private

Definition at line 62 of file model.h.

Referenced by Model().

◆ global

bool SBS::Model::global
private

Definition at line 60 of file model.h.

Referenced by Drop(), Loop(), and Model().

◆ is_key

bool SBS::Model::is_key
private

Definition at line 58 of file model.h.

Referenced by IsKey(), Model(), and SetKey().

◆ KeyID

int SBS::Model::KeyID
private

Definition at line 59 of file model.h.

Referenced by GetKeyID(), Model(), and SetKey().

◆ load_error

◆ mesh

MeshObject* SBS::Model::mesh
private

Definition at line 56 of file model.h.

Referenced by Enabled(), IsEnabled(), IsPhysical(), Model(), OnInit(), and ~Model().

◆ Offset

Vector3 SBS::Model::Offset
private

Definition at line 57 of file model.h.

Referenced by Model(), and OnInit().


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