SO3Engine
Public Types | Public Member Functions | Protected Attributes | List of all members
SO3::SEntity Class Reference

#include <SO3Entity.h>

Inheritance diagram for SO3::SEntity:
SO3::SNode SO3::SData

Public Types

enum  EntityPrefabType { SO3_PREFAB_PLANE , SO3_PREFAB_CUBE , SO3_PREFAB_SPHERE }
 
- Public Types inherited from SO3::SNode
enum  NodeType {
  NODE_TYPE_ID = 0 , ENTITY_TYPE_ID = 1 , CAMERA_TYPE_ID = 2 , LIGHT_TYPE_ID = 3 ,
  SKELETON_TYPE_ID = 4 , BONE_TYPE_ID = 5 , PARTICLE_SYSTEM_TYPE_ID = 6 , DYNAMIC_CUBE_MAP_ID = 7 ,
  DYNAMIC_REFLECTION_MAP_ID = 8 , RENDER_TO_TEXTURE_ID = 9 , LINE_ENTITY_TYPE_ID = 10 , VIRTUAL_POINTER_TYPE_ID = 11
}
 
enum  NodeTransformSpace { SO3_LOCAL_TS = 0 , SO3_PARENT_TS = 1 , SO3_WORLD_TS = 2 }
 

Public Member Functions

 SEntity (SScene *parent, const std::string &groupName, const std::string &entityName, const std::string &meshName, bool loadInBackground=false)
 
 SEntity (SScene *parent, const std::string &entityName, const std::string &groupName, Ogre::MeshPtr meshPointer)
 
 SEntity (SScene *parent, const std::string &entityName, const EntityPrefabType &prefabType)
 
 SEntity (SScene *parent, const std::string &groupName, const std::string &entityName, const SPointFloat &sizev, const SPointInt &seg, const SPointFloat &uv)
 
 SEntity (SScene *parent, const std::string &groupName, const std::string &entityName, const float &radius, const int &rings, const int &segments)
 
 SEntity (SScene *parent, const std::string &groupName, const std::string &entityName, const float &radius, const float &height, const int &segments)
 
 SEntity (SScene *parent, const std::string &groupName, const std::string &entityName, const float &base, const float &bottom, const float &dist)
 
 SEntity ()
 
 ~SEntity ()
 
void LoadAsync ()
 
void FinishAsync ()
 
Ogre::Entity * getOgreEntityPointer ()
 
SSkeletonGetSkeleton ()
 
std::string GetGroupName ()
 
virtual void SetCastShadows (const bool &castShadows)
 
virtual bool GetCastShadows ()
 
virtual void SetRenderingDistance (const float &distance)
 
virtual float GetRenderingDistance ()
 
virtual Ogre::Vector3 GetBoundingBoxSize (const bool &childs=false)
 
virtual Ogre::Vector3 GetBoundingBoxCenter (const bool &childs=false)
 
virtual Ogre::Vector3 GetWorldBoundingBoxSize (const bool &childs=false)
 
virtual Ogre::Vector3 GetWorldBoundingBoxCenter (const bool &childs=false)
 
unsigned int GetPolygonCount ()
 
unsigned int GetVerticesCount ()
 
void SetRenderQueue (const Ogre::RenderQueueGroupID &groupId)
 
unsigned int GetNumSubEntities ()
 
void SetVisibilityFlags (const Ogre::uint32 &flags)
 
Ogre::uint32 GetVisibilityFlags ()
 
void SetVisibilityFlagIndexEnable (const Ogre::uint32 &flagIndex, bool enable)
 
bool GetVisibilityFlagIndexEnable (const Ogre::uint32 &flagIndex)
 
void _SetSkeleton (SSkeleton *newSkeleton)
 
void GenerateLOD (int nbLevels)
 
void SetFreeResource (bool state)
 
void Reload ()
 
bool SetMaterial (SMaterial *mat, int subindex)
 
void SetMinPixelSize (const float &minsize)
 
float GetMinPixelSize ()
 
virtual void loadingComplete (Ogre::Resource *res)
 
- Public Member Functions inherited from SO3::SNode
 SNode (SScene *parent, const std::string &nodeName, const bool &isRootNode=false)
 
virtual ~SNode ()
 
SSceneGetParentScene ()
 
Ogre::SceneNode * GetOgreSceneNodePointer ()
 
Ogre::MovableObject * GetMovableObjectPointer ()
 
bool GetSceneNodeIsMouseForeground ()
 
void SetSceneNodeIsMouseForeground (const bool &mForeground)
 
bool GetSceneNodeIsMouseClick ()
 
void SetSceneNodeIsMouseClick (const bool &mClickable)
 
int GetSceneNodeMouseFlags ()
 
void SetSceneNodeMouseFlags (const int &flags)
 
bool GetSceneNodeHasBody ()
 
SBodyGetSceneNodeBody ()
 
void RestoreStaticGraph ()
 
void SetAsStaticGeometry (const bool &state)
 
bool GetAsStaticGeometry ()
 
Ogre::StaticGeometry * GetStaticGeometry ()
 
void SetFlags (const int &flags)
 
void SetPhysicsOverride (bool state)
 
bool GetPhysicsOverride ()
 
int GetFlags ()
 
void UpdateNodeBody (const bool &bScale)
 
void DisableAutoTarget ()
 
NodeType GetNodeType ()
 
void AttachToParent (SNode *newParentNode)
 
void DetachFromParent ()
 
SNodeGetParentSceneNode ()
 
const SNodeMap GetChildrenNodes () const
 
virtual int GetNumChildren ()
 
void DetachAllChildren ()
 
virtual Ogre::Matrix4 GetTransformationMatrix ()
 
virtual Ogre::Vector3 GetPosition ()
 
virtual void SetPosition (const Ogre::Vector3 &pos)
 
virtual Ogre::Quaternion GetOrientation ()
 
virtual void SetOrientation (const Ogre::Quaternion &quat)
 
virtual void AddOrientation (const Ogre::Quaternion &quat)
 
virtual Ogre::Vector3 GetScale ()
 
virtual void SetScale (const Ogre::Vector3 &scale)
 
virtual Ogre::Vector3 GetGlobalPosition ()
 
virtual void SetGlobalPosition (const Ogre::Vector3 &pos, bool updateBody=true)
 
virtual Ogre::Quaternion GetGlobalOrientation ()
 
virtual void SetGlobalOrientation (const Ogre::Quaternion &quat, bool updateBody=true)
 
virtual Ogre::Vector3 GetGlobalScale ()
 
virtual void SetGlobalScale (const Ogre::Vector3 &scale, bool updateBody=true)
 
virtual void StoreInitialPRS ()
 
virtual void ResetToInitialPRS ()
 
void ResetToInitialPosition ()
 
virtual void ResetToInitialOrientation ()
 
void ResetToInitialScale ()
 
virtual Ogre::Vector3 GetInitialPosition ()
 
virtual Ogre::Quaternion GetInitialOrientation ()
 
virtual Ogre::Vector3 GetInitialScale ()
 
bool GetShowBoundingBox ()
 
void SetShowBoundingBox (const bool &showBounding)
 
void SetAutoTracking (const bool &autoTrack, SNode *targetNode=0, const Ogre::Vector3 &localDirectionVector=Ogre::Vector3::NEGATIVE_UNIT_Z, const Ogre::Vector3 &offset=Ogre::Vector3::ZERO)
 
SNodeGetAutoTrackingTarget ()
 
virtual void Pitch (const float &radianAngle, const SNode::NodeTransformSpace &relativeTo=SNode::SO3_LOCAL_TS)
 
virtual void Yaw (const float &radianAngle, const SNode::NodeTransformSpace &relativeTo=SNode::SO3_LOCAL_TS)
 
virtual void Roll (const float &radianAngle, const SNode::NodeTransformSpace &relativeTo=SNode::SO3_LOCAL_TS)
 
virtual void Rotate (const Ogre::Vector3 &axis, const float &radianAngle, const SNode::NodeTransformSpace &relativeTo=SNode::SO3_LOCAL_TS)
 
virtual void Translate (const Ogre::Vector3 &d, const SNode::NodeTransformSpace &relativeTo=SNode::SO3_PARENT_TS)
 
void SetDirection (const Ogre::Vector3 &vec, const SNode::NodeTransformSpace &relativeTo=SNode::SO3_LOCAL_TS, const Ogre::Vector3 &localDirectionVector=Ogre::Vector3::NEGATIVE_UNIT_Z)
 
Ogre::Vector3 GetDirection (bool derived=false, Ogre::Vector3 axis=Ogre::Vector3::NEGATIVE_UNIT_Z)
 
void LookAt (const Ogre::Vector3 &targetPoint, const SNode::NodeTransformSpace &relativeTo, const Ogre::Vector3 &localDirectionVector=Ogre::Vector3::NEGATIVE_UNIT_Z)
 
bool GetVisible ()
 
void SetVisible (const bool &visible, const bool &cascade=true)
 
SNodeAnimationCreateNodeAnimation (const std::string &animationName, const float &animationLength)
 
void DeleteAnimation (SAnim *existingAnimation)
 
size_t GetNumAnimations ()
 
SAnimGetAnimation (const std::string &animationName)
 
SAnimGetAnimation (const unsigned short &animationIndex)
 
SAnimMap GetAnimations () const
 
bool IsAnimated ()
 
Ogre::Vector3 GetPositionFromNode (SNode *nodeRef)
 
Ogre::Quaternion GetOrientationFromNode (SNode *nodeRef)
 
Ogre::Vector3 GetScaleFromNode (SNode *nodeRef)
 
virtual void SetInheritOrientation (const bool &state)
 
virtual bool GetInheritOrientation ()
 
virtual void ResetOrientation ()
 
void DeleteBody ()
 
SBodyCreateBoxBody (const Ogre::Vector3 &boxsetting)
 
SBodyCreateBoxBody (const Ogre::Vector3 &boxsetting, const Ogre::Vector3 &offset, const Ogre::Quaternion &quat)
 
SBodyCreateConeBody (const Ogre::Real &radius, const Ogre::Real &height)
 
SBodyCreateConeBody (const Ogre::Real &radius, const Ogre::Real &height, const Ogre::Vector3 &offset, const Ogre::Quaternion &quat)
 
SBodyCreateEllipsoidBody (const Ogre::Vector3 &size)
 
SBodyCreateEllipsoidBody (const Ogre::Vector3 &size, const Ogre::Vector3 &offset, const Ogre::Quaternion &quat)
 
SBodyCreateCapsuleBody (const Ogre::Real &radius, const Ogre::Real &height)
 
SBodyCreateCapsuleBody (const Ogre::Real &radius, const Ogre::Real &height, const Ogre::Vector3 &offset, const Ogre::Quaternion &quat)
 
SBodyCreateCylinderBody (const Ogre::Real &radius, const Ogre::Real &height)
 
SBodyCreateCylinderBody (const Ogre::Real &radius, const Ogre::Real &height, const Ogre::Vector3 &offset, const Ogre::Quaternion &quat)
 
SBodyCreateChamferCylinderBody (const Ogre::Real &radius, const Ogre::Real &height)
 
SBodyCreateChamferCylinderBody (const Ogre::Real &radius, const Ogre::Real &height, const Ogre::Vector3 &offset, const Ogre::Quaternion &quat)
 
SBodyCreatePyramidBody (const Ogre::Vector3 &size)
 
SBodyCreatePyramidBody (const Ogre::Vector3 &size, const Ogre::Vector3 &offset, const Ogre::Quaternion &quat)
 
SBodyCreateConvexHullBody (const Ogre::Real &tolerance)
 
SBodyCreateConcaveHullBody (const Ogre::Real &tolerance)
 
SBodyCreateTreeBody (const bool &optimize)
 
bool IsDirty ()
 
void SetDirty (bool state)
 
void UpdateNodeFromBody ()
 
void ResetNode ()
 
- Public Member Functions inherited from SO3::SData
 SData (const std::string &dataName)
 
virtual ~SData ()
 
std::string GetName () const
 
SUserObjectBindingsGetUserObjectBindings ()
 
const SUserObjectBindingsGetUserObjectBindings () const
 

Protected Attributes

Ogre::Entity * O3Entity
 
SSkeletonentitySKL
 
- Protected Attributes inherited from SO3::SNode
SScenecurrentScene
 
Ogre::SceneNode * O3SceneNode
 
Ogre::MovableObject * ogreMovableObject
 
SBodynodeBody
 
unsigned short animationCounter
 
Ogre::Vector3 initialPosition
 
Ogre::Quaternion initialOrientation
 
Ogre::Vector3 initialScale
 
- Protected Attributes inherited from SO3::SData
std::string name
 

Additional Inherited Members

- Protected Member Functions inherited from SO3::SNode
 SNode (SScene *parent, const std::string &nodeName, const NodeType &nodeType)
 
void AddAnimation (SAnim *existingAnimation)
 
void RemoveAnimation (SAnim *existingAnimation)
 
void RemoveAnimation (const std::string &animationName)
 
Ogre::Vector3 GetSonsBoundingBox ()
 
Ogre::Vector3 GetSonsWorldBoundingBox ()
 

Detailed Description

Definition at line 42 of file SO3Entity.h.

Member Enumeration Documentation

◆ EntityPrefabType

Enumerator
SO3_PREFAB_PLANE 
SO3_PREFAB_CUBE 
SO3_PREFAB_SPHERE 

Definition at line 45 of file SO3Entity.h.

Constructor & Destructor Documentation

◆ SEntity() [1/8]

SO3::SEntity::SEntity ( SScene parent,
const std::string &  groupName,
const std::string &  entityName,
const std::string &  meshName,
bool  loadInBackground = false 
)

constructor for mesh files

Definition at line 54 of file SO3Entity.cpp.

◆ SEntity() [2/8]

SO3::SEntity::SEntity ( SScene parent,
const std::string &  entityName,
const std::string &  groupName,
Ogre::MeshPtr  meshPointer 
)

Load a pre-made mesh.

Definition at line 278 of file SO3Entity.cpp.

◆ SEntity() [3/8]

SO3::SEntity::SEntity ( SScene parent,
const std::string &  entityName,
const EntityPrefabType prefabType 
)

constructor for prefab

Definition at line 365 of file SO3Entity.cpp.

◆ SEntity() [4/8]

SO3::SEntity::SEntity ( SScene parent,
const std::string &  groupName,
const std::string &  entityName,
const SPointFloat sizev,
const SPointInt seg,
const SPointFloat uv 
)

constructor for plane entity

Definition at line 393 of file SO3Entity.cpp.

◆ SEntity() [5/8]

SO3::SEntity::SEntity ( SScene parent,
const std::string &  groupName,
const std::string &  entityName,
const float &  radius,
const int &  rings,
const int &  segments 
)

constructor for sphere entity

Definition at line 409 of file SO3Entity.cpp.

◆ SEntity() [6/8]

SO3::SEntity::SEntity ( SScene parent,
const std::string &  groupName,
const std::string &  entityName,
const float &  radius,
const float &  height,
const int &  segments 
)

constructor for cone entity

Definition at line 424 of file SO3Entity.cpp.

◆ SEntity() [7/8]

SO3::SEntity::SEntity ( SScene parent,
const std::string &  groupName,
const std::string &  entityName,
const float &  base,
const float &  bottom,
const float &  dist 
)

constructor for cone entity

Definition at line 439 of file SO3Entity.cpp.

◆ SEntity() [8/8]

SO3::SEntity::SEntity ( )

Forbiden constructor

Definition at line 453 of file SO3Entity.cpp.

◆ ~SEntity()

SO3::SEntity::~SEntity ( )

Definition at line 644 of file SO3Entity.cpp.

Member Function Documentation

◆ _SetSkeleton()

void SO3::SEntity::_SetSkeleton ( SSkeleton newSkeleton)

Hack to set the skeleton pointer after the SEntity was created, SSkeleton internal use only

Definition at line 866 of file SO3Entity.cpp.

◆ FinishAsync()

void SO3::SEntity::FinishAsync ( )

Definition at line 202 of file SO3Entity.cpp.

◆ GenerateLOD()

void SO3::SEntity::GenerateLOD ( int  nbLevels)

Definition at line 871 of file SO3Entity.cpp.

◆ GetBoundingBoxCenter()

Ogre::Vector3 SO3::SEntity::GetBoundingBoxCenter ( const bool &  childs = false)
virtual

Remarks
: the SNode implementation throws an exception, you must re-define this function in child classes that manage a bounding box.
: SEntity implementation, re-define from SNode .

Reimplemented from SO3::SNode.

Definition at line 740 of file SO3Entity.cpp.

◆ GetBoundingBoxSize()

Ogre::Vector3 SO3::SEntity::GetBoundingBoxSize ( const bool &  childs = false)
virtual

Remarks
: the SNode implementation throws an exception, you must re-define this function in child classes that manage a bounding box.
: SEntity implementation, re-define from SNode .

Reimplemented from SO3::SNode.

Definition at line 727 of file SO3Entity.cpp.

◆ GetCastShadows()

bool SO3::SEntity::GetCastShadows ( )
virtual

Remarks
: the SNode implementation throws an exception, you must re-define this function in child classes that manage Shadow Casting.
: SEntity implementation, re-define from SNode .

Reimplemented from SO3::SNode.

Definition at line 705 of file SO3Entity.cpp.

◆ GetGroupName()

std::string SO3::SEntity::GetGroupName ( )

Definition at line 694 of file SO3Entity.cpp.

◆ GetMinPixelSize()

float SO3::SEntity::GetMinPixelSize ( )

Definition at line 977 of file SO3Entity.cpp.

◆ GetNumSubEntities()

unsigned int SO3::SEntity::GetNumSubEntities ( )

Definition at line 815 of file SO3Entity.cpp.

◆ getOgreEntityPointer()

Ogre::Entity * SO3::SEntity::getOgreEntityPointer ( )

Definition at line 684 of file SO3Entity.cpp.

◆ GetPolygonCount()

unsigned int SO3::SEntity::GetPolygonCount ( )

Definition at line 770 of file SO3Entity.cpp.

◆ GetRenderingDistance()

float SO3::SEntity::GetRenderingDistance ( )
virtual

Remarks
: the SNode implementation throws an exception, you must re-define this function in child classes that manage Rendering Distance.
: SEntity implementation, re-define from SNode .

Reimplemented from SO3::SNode.

Definition at line 719 of file SO3Entity.cpp.

◆ GetSkeleton()

SSkeleton * SO3::SEntity::GetSkeleton ( )

Definition at line 689 of file SO3Entity.cpp.

◆ GetVerticesCount()

unsigned int SO3::SEntity::GetVerticesCount ( )

Definition at line 785 of file SO3Entity.cpp.

◆ GetVisibilityFlagIndexEnable()

bool SO3::SEntity::GetVisibilityFlagIndexEnable ( const Ogre::uint32 &  flagIndex)

Definition at line 850 of file SO3Entity.cpp.

◆ GetVisibilityFlags()

Ogre::uint32 SO3::SEntity::GetVisibilityFlags ( )

Definition at line 829 of file SO3Entity.cpp.

◆ GetWorldBoundingBoxCenter()

Ogre::Vector3 SO3::SEntity::GetWorldBoundingBoxCenter ( const bool &  childs = false)
virtual

Remarks
: the SNode implementation throws an exception, you must re-define this function in child classes that manage a bounding box.
: SEntity implementation, re-define from SNode .

Reimplemented from SO3::SNode.

Definition at line 762 of file SO3Entity.cpp.

◆ GetWorldBoundingBoxSize()

Ogre::Vector3 SO3::SEntity::GetWorldBoundingBoxSize ( const bool &  childs = false)
virtual

Remarks
: the SNode implementation throws an exception, you must re-define this function in child classes that manage a bounding box.
: SEntity implementation, re-define from SNode .

Reimplemented from SO3::SNode.

Definition at line 749 of file SO3Entity.cpp.

◆ LoadAsync()

void SO3::SEntity::LoadAsync ( )

Definition at line 169 of file SO3Entity.cpp.

◆ loadingComplete()

void SO3::SEntity::loadingComplete ( Ogre::Resource *  res)
virtual

Definition at line 272 of file SO3Entity.cpp.

◆ Reload()

void SO3::SEntity::Reload ( )

Reload entity

Definition at line 912 of file SO3Entity.cpp.

◆ SetCastShadows()

void SO3::SEntity::SetCastShadows ( const bool &  castShadows)
virtual

Remarks
: the SNode implementation throws an exception, you must re-define this function in child classes that manage Shadow Casting.
: SEntity implementation, re-define from SNode .

Reimplemented from SO3::SNode.

Definition at line 699 of file SO3Entity.cpp.

◆ SetFreeResource()

void SO3::SEntity::SetFreeResource ( bool  state)

Definition at line 679 of file SO3Entity.cpp.

◆ SetMaterial()

bool SO3::SEntity::SetMaterial ( SMaterial mat,
int  subindex 
)

Definition at line 942 of file SO3Entity.cpp.

◆ SetMinPixelSize()

void SO3::SEntity::SetMinPixelSize ( const float &  minsize)

Definition at line 969 of file SO3Entity.cpp.

◆ SetRenderingDistance()

void SO3::SEntity::SetRenderingDistance ( const float &  distance)
virtual

Remarks
: the SNode implementation throws an exception, you must re-define this function in child classes that manage Rendering Distance.
: SEntity implementation, re-define from SNode .

Reimplemented from SO3::SNode.

Definition at line 713 of file SO3Entity.cpp.

◆ SetRenderQueue()

void SO3::SEntity::SetRenderQueue ( const Ogre::RenderQueueGroupID &  groupId)

Definition at line 809 of file SO3Entity.cpp.

◆ SetVisibilityFlagIndexEnable()

void SO3::SEntity::SetVisibilityFlagIndexEnable ( const Ogre::uint32 &  flagIndex,
bool  enable 
)

Definition at line 837 of file SO3Entity.cpp.

◆ SetVisibilityFlags()

void SO3::SEntity::SetVisibilityFlags ( const Ogre::uint32 &  flags)

Definition at line 823 of file SO3Entity.cpp.

Member Data Documentation

◆ entitySKL

SSkeleton* SO3::SEntity::entitySKL
protected

Definition at line 53 of file SO3Entity.h.

◆ O3Entity

Ogre::Entity* SO3::SEntity::O3Entity
protected

Definition at line 52 of file SO3Entity.h.


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