Skyscraper 2.0
SBS::Primitive Class Reference

#include <primitive.h>

Inheritance diagram for SBS::Primitive:
Collaboration diagram for SBS::Primitive:

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 ()
 
MeshObjectGetMeshObject ()
 
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)
 
- 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
 
int collider_type
 
- 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 primitive.h.

Constructor & Destructor Documentation

◆ Primitive()

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().

Here is the call graph for this function:

◆ ~Primitive()

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.

Here is the call graph for this function:

Member Function Documentation

◆ AddToParent()

void SBS::Primitive::AddToParent ( )
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().

Here is the call graph for this function:

◆ Attach()

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 )

◆ Drop()

◆ Enabled()

void SBS::Primitive::Enabled ( bool value)
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().

Here is the call graph for this function:

◆ GetKeyID()

int SBS::Primitive::GetKeyID ( )

◆ GetMeshObject()

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

Definition at line 49 of file primitive.h.

◆ IsEnabled()

bool SBS::Primitive::IsEnabled ( )

Definition at line 76 of file primitive.cpp.

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

Here is the call graph for this function:

◆ IsKey()

bool SBS::Primitive::IsKey ( )

◆ IsPhysical()

bool SBS::Primitive::IsPhysical ( )

Definition at line 81 of file primitive.cpp.

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

Here is the call graph for this function:

◆ IsPickedUp()

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().

Here is the call graph for this function:

◆ Loop()

◆ OnClick()

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

Reimplemented from SBS::Object.

Definition at line 236 of file primitive.cpp.

◆ PickUp()

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.

Here is the call graph for this function:

◆ RemoveFromParent()

void SBS::Primitive::RemoveFromParent ( )
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().

Here is the call graph for this function:

◆ SetKey()

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

◆ SetTexture()

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().

Here is the call graph for this function:

Member Data Documentation

◆ always_visible

bool SBS::Primitive::always_visible

◆ collider_type

int SBS::Primitive::collider_type

◆ global

bool SBS::Primitive::global
private

Definition at line 62 of file primitive.h.

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

◆ is_key

bool SBS::Primitive::is_key
private

Definition at line 60 of file primitive.h.

Referenced by Primitive().

◆ KeyID

int SBS::Primitive::KeyID
private

Definition at line 61 of file primitive.h.

Referenced by Primitive().

◆ mesh

MeshObject* SBS::Primitive::mesh
private

Definition at line 58 of file primitive.h.

Referenced by Attach(), Enabled(), IsEnabled(), IsPhysical(), Primitive(), SetTexture(), and ~Primitive().

◆ Offset

Vector3 SBS::Primitive::Offset
private

Definition at line 59 of file primitive.h.

Referenced by Primitive().


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