Skyscraper 2.0
SBS::CustomObject Class Reference

#include <custom.h>

Inheritance diagram for SBS::CustomObject:
Collaboration diagram for SBS::CustomObject:

Public Member Functions

 CustomObject (Object *parent, const std::string &name, const Vector3 &position, const Vector3 &rotation, Real max_render_distance=0, Real scale_multiplier=1)
 
 ~CustomObject ()
 
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 OnClick (Vector3 &position, bool shift, bool ctrl, bool alt, bool right)
 
void SetTexture (const std::string &texture)
 
void Finish (bool enable_physics=false, Real restitution=0, Real friction=0, Real mass=0)
 
- 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)
 
virtual void OnInit ()
 
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 always_visible
 
- 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
 

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 custom.h.

Constructor & Destructor Documentation

◆ CustomObject()

SBS::CustomObject::CustomObject ( Object * parent,
const std::string & name,
const Vector3 & position,
const Vector3 & rotation,
Real max_render_distance = 0,
Real scale_multiplier = 1 )

◆ ~CustomObject()

SBS::CustomObject::~CustomObject ( )

Definition at line 57 of file custom.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::CustomObject::AddToParent ( )
private

Definition at line 106 of file custom.cpp.

References SBS::SBS::AddCustomObject(), 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::CustomObject::Enabled ( bool value)
virtual

Reimplemented from SBS::Object.

Definition at line 71 of file custom.cpp.

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

Referenced by Finish().

Here is the call graph for this function:

◆ Finish()

void SBS::CustomObject::Finish ( bool enable_physics = false,
Real restitution = 0,
Real friction = 0,
Real mass = 0 )

Definition at line 254 of file custom.cpp.

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

Here is the call graph for this function:

◆ GetKeyID()

int SBS::CustomObject::GetKeyID ( )

◆ GetMeshObject()

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

Definition at line 48 of file custom.h.

Referenced by Skyscraper::ScriptProcessor::CommandsSection::Run().

◆ IsEnabled()

bool SBS::CustomObject::IsEnabled ( )

Definition at line 80 of file custom.cpp.

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

Here is the call graph for this function:

◆ IsKey()

bool SBS::CustomObject::IsKey ( )

◆ IsPhysical()

bool SBS::CustomObject::IsPhysical ( )

Definition at line 85 of file custom.cpp.

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

Here is the call graph for this function:

◆ IsPickedUp()

bool SBS::CustomObject::IsPickedUp ( )

Definition at line 234 of file custom.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::CustomObject::OnClick ( Vector3 & position,
bool shift,
bool ctrl,
bool alt,
bool right )
virtual

Reimplemented from SBS::Object.

Definition at line 239 of file custom.cpp.

◆ PickUp()

void SBS::CustomObject::PickUp ( )

Definition at line 182 of file custom.cpp.

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

Here is the call graph for this function:

◆ RemoveFromParent()

void SBS::CustomObject::RemoveFromParent ( )
private

Definition at line 90 of file custom.cpp.

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

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

Here is the call graph for this function:

◆ SetKey()

void SBS::CustomObject::SetKey ( int keyid)

◆ SetTexture()

void SBS::CustomObject::SetTexture ( const std::string & texture)

Definition at line 247 of file custom.cpp.

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

Here is the call graph for this function:

Member Data Documentation

◆ always_visible

bool SBS::CustomObject::always_visible

Definition at line 33 of file custom.h.

Referenced by CustomObject(), and Enabled().

◆ global

bool SBS::CustomObject::global
private

Definition at line 61 of file custom.h.

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

◆ is_key

bool SBS::CustomObject::is_key
private

Definition at line 59 of file custom.h.

Referenced by CustomObject().

◆ KeyID

int SBS::CustomObject::KeyID
private

Definition at line 60 of file custom.h.

Referenced by CustomObject().

◆ mesh

MeshObject* SBS::CustomObject::mesh
private

Definition at line 57 of file custom.h.

Referenced by CustomObject(), Enabled(), Finish(), IsEnabled(), IsPhysical(), SetTexture(), and ~CustomObject().

◆ Offset

Vector3 SBS::CustomObject::Offset
private

Definition at line 58 of file custom.h.

Referenced by CustomObject().


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