An entity class, a *thing* in the game world; it's a higher class Scene node. More...
#include <nyEntity.h>

Public Types | |
| enum | EEntityFlags { eEntityFlag_Selectable = NYTRO_BIT(0), eEntityFlag_Selected = NYTRO_BIT(1), eEntityFlag_CastShadows = NYTRO_BIT(2), eEntityFlag_ReceiveShadows = NYTRO_BIT(3), eEntityFlag_CanBeReflected = NYTRO_BIT(4), eEntityFlag_StaticEntity = NYTRO_BIT(5), eEntityFlag_CanBeHiddenByOcclusion = NYTRO_BIT(6) } |
Public Member Functions | |
| Entity () | |
| virtual | ~Entity () |
| EntityGroup * | getGroup () |
| string | getPrefabFileName () |
| PrefabData * | getPrefab () |
| uint32 | getEntityFlags () |
| void | setEntityFlags (uint32 aFlags) |
| virtual void | setGroup (EntityGroup *pGroup) |
| set the group of this entity, if grouped | |
| virtual void | setPrefabFileName (const char *pFileName) |
| set prefab file name | |
| virtual void | setPrefab (PrefabData *pPrefab) |
| set prefab data object | |
| virtual bool | traceRay (Ray &rRay, SceneNodeHitInfo *pHit, ETraceRayAccuracy aAccuracy=eTraceRayAccuracy_Brute) |
| trace ray through entity, default checks if it hits entity icon | |
| virtual void | schematicRender () |
| render schematic, defaults render the icon at m_translation | |
| virtual void | triggerEvent (EntityEvent *pEvent, Base *pInitiator, ParameterList *pParams=NULL) |
| trigger an event | |
| void | triggerEvent (const char *pEvent, Base *pInitiator, ParameterList *pParams=NULL) |
| trigger and event by name | |
| map< char *, EntityEvent * > & | getEvents () |
| void | addEvent (EntityEvent *pEvent) |
| add a new event, the object will be managed by the class from now on, it must be created with 'new', not a static object use the NYTRO_ADD_ENTITY_EVENT macro in the object's constructor to add events. | |
| void | resetEvents () |
| reset all events to untriggered state | |
| EntityLayer * | getLayer () |
| void | setLayer (EntityLayer *pLayer) |
| virtual EResult | loadFromStream (Stream *pStream) |
| load entity persistent data from stream | |
| virtual EResult | saveToStream (Stream *pStream) |
| save entity persistent data to stream | |
| virtual void | onEvent (EntityEvent *pEvent) |
| user code to handle events | |
| virtual bool | onEditorDelete () |
| called when this entity is deleted inside the editor, you should not delete the entity data, but just disconnect it from SceneGraph and other stuff, sort of a silent/hidden 'delete', because when the Redo operation from the editor will be issued, you must restore the connections and put back the entity | |
| virtual void | onEditorUndoDelete () |
| called when a Undo delete action was issued in the editor, you must restore the "deleted" entity here, reconnecting it to the Scene graph and such | |
| virtual void | onStartSimulation () |
| called BEFORE the Physics simulation is about to begin, by default it saves the initial Pos/Rot/Scale transform into internal m_initial* variables | |
| virtual void | onStopSimulation () |
| called AFTER the Physics simulation is stopped, by default restores the initial Pos/Rot/Scale transform from internal m_initial* variables | |
| virtual void | onBeforeUnloadResource (Resource *pRes) |
| called by the World object when the engine is about to unload a resource | |
| virtual void | onAfterReloadResource (Resource *pRes) |
| called by the World object when the engine reloaded a resource | |
| virtual void | onPropertyValueChanged (voidptr pPropertyData) |
| virtual void | onFormatGetPropertyValue (voidptr pPropertyData, string &rOutValue) |
| virtual void | prepare () |
| vector< EntityVisualEditHandle * > & | getVisualEditHandles () |
| virtual void | onVisualEditHandleMove (EntityVisualEditHandle *pHandle) |
| called when a visual handle was moved inside the editor | |
| virtual bool | onVisualEditHandleDelete (EntityVisualEditHandle *pHandle) |
Static Public Member Functions | |
| static void | setShowConstantSizedEntityIcons (bool bShow) |
| static UiFxTimer & | getSelectionBlinkTimer () |
Data Fields | |
| NYTRO_CLASS_HAS_PROPERTIES | |
Protected Member Functions | |
| void | drawEntityIcon () |
Protected Attributes | |
| Vector3D | m_initialTranslation |
| Vector3D | m_initialScale |
| Vector3D | m_iconOffsetFromAabbCenter |
| Quaternion | m_initialRotation |
| EntityGroup * | m_pGroup |
| string | m_prefabFileName |
| int32 | m_layerIndex |
| int32 | m_groupIndex |
| PrefabData * | m_pPrefab |
| Vector3D | m_entityIconCorners [4] |
| Texture * | m_pEntityIconTexture |
| EntityLayer * | m_pLayer |
| uint32 | m_entityFlags |
| uint8 | m_performanceCost |
| the entity's performance cost, between 0..255, 255 being very costly | |
| map< char *, EntityEvent * > | m_events |
| vector< EntityVisualEditHandle * > | m_visualEditHandles |
Static Protected Attributes | |
| static bool | s_bShowConstantSizedEntityIcons |
| static UiFxTimer | s_selectionBlinkTimer |
An entity class, a *thing* in the game world; it's a higher class Scene node.
Definition at line 152 of file nyEntity.h.
Definition at line 156 of file nyEntity.h.
| Nytro::Game::Entity::Entity | ( | ) |
| virtual Nytro::Game::Entity::~Entity | ( | ) | [virtual] |
| void Nytro::Game::Entity::addEvent | ( | EntityEvent * | pEvent | ) |
add a new event, the object will be managed by the class from now on, it must be created with 'new', not a static object use the NYTRO_ADD_ENTITY_EVENT macro in the object's constructor to add events.
Ex: NYTRO_ADD_ENTITY_EVENT( "onHit", { Variant( "hitPoint", Variant::TYPE_VECTOR3D ), Variant( "hitNormal", Variant::TYPE_VECTOR3D ) } );
| void Nytro::Game::Entity::drawEntityIcon | ( | ) | [protected] |
| uint32 Nytro::Game::Entity::getEntityFlags | ( | ) |
| map<char*,EntityEvent*>& Nytro::Game::Entity::getEvents | ( | ) |
| EntityGroup* Nytro::Game::Entity::getGroup | ( | ) |
| EntityLayer* Nytro::Game::Entity::getLayer | ( | ) |
| PrefabData* Nytro::Game::Entity::getPrefab | ( | ) |
| string Nytro::Game::Entity::getPrefabFileName | ( | ) |
| static UiFxTimer& Nytro::Game::Entity::getSelectionBlinkTimer | ( | ) | [static] |
| vector<EntityVisualEditHandle*>& Nytro::Game::Entity::getVisualEditHandles | ( | ) |
load entity persistent data from stream
| virtual void Nytro::Game::Entity::onAfterReloadResource | ( | Resource * | pRes | ) | [virtual] |
called by the World object when the engine reloaded a resource
Reimplemented from Nytro::Core::ResourceObserver.
Reimplemented in Nytro::Game::ModelEntity.
| virtual void Nytro::Game::Entity::onBeforeUnloadResource | ( | Resource * | pRes | ) | [virtual] |
called by the World object when the engine is about to unload a resource
Reimplemented from Nytro::Core::ResourceObserver.
Reimplemented in Nytro::Game::ModelEntity.
| virtual bool Nytro::Game::Entity::onEditorDelete | ( | ) | [virtual] |
called when this entity is deleted inside the editor, you should not delete the entity data, but just disconnect it from SceneGraph and other stuff, sort of a silent/hidden 'delete', because when the Redo operation from the editor will be issued, you must restore the connections and put back the entity
Reimplemented in Nytro::Game::ModelEntity, and Nytro::Game::SoundSourceEntity.
| virtual void Nytro::Game::Entity::onEditorUndoDelete | ( | ) | [virtual] |
called when a Undo delete action was issued in the editor, you must restore the "deleted" entity here, reconnecting it to the Scene graph and such
Reimplemented in Nytro::Game::ModelEntity, and Nytro::Game::SoundSourceEntity.
| virtual void Nytro::Game::Entity::onEvent | ( | EntityEvent * | pEvent | ) | [virtual] |
user code to handle events
| virtual void Nytro::Game::Entity::onFormatGetPropertyValue | ( | voidptr | pPropertyData, | |
| string & | rOutValue | |||
| ) | [virtual] |
| virtual void Nytro::Game::Entity::onPropertyValueChanged | ( | voidptr | pPropertyData | ) | [virtual] |
| virtual void Nytro::Game::Entity::onStartSimulation | ( | ) | [virtual] |
called BEFORE the Physics simulation is about to begin, by default it saves the initial Pos/Rot/Scale transform into internal m_initial* variables
| virtual void Nytro::Game::Entity::onStopSimulation | ( | ) | [virtual] |
called AFTER the Physics simulation is stopped, by default restores the initial Pos/Rot/Scale transform from internal m_initial* variables
| virtual bool Nytro::Game::Entity::onVisualEditHandleDelete | ( | EntityVisualEditHandle * | pHandle | ) | [virtual] |
| virtual void Nytro::Game::Entity::onVisualEditHandleMove | ( | EntityVisualEditHandle * | pHandle | ) | [virtual] |
called when a visual handle was moved inside the editor
| virtual void Nytro::Game::Entity::prepare | ( | ) | [virtual] |
| void Nytro::Game::Entity::resetEvents | ( | ) |
reset all events to untriggered state
save entity persistent data to stream
| virtual void Nytro::Game::Entity::schematicRender | ( | ) | [virtual] |
render schematic, defaults render the icon at m_translation
Reimplemented in Nytro::Game::CameraEntity, Nytro::Game::ParticleSystemEntity, Nytro::Game::SoundSourceEntity, Nytro::Game::SpawnLocationEntity, and Nytro::Game::TriggerEntity.
| void Nytro::Game::Entity::setEntityFlags | ( | uint32 | aFlags | ) |
| virtual void Nytro::Game::Entity::setGroup | ( | EntityGroup * | pGroup | ) | [virtual] |
set the group of this entity, if grouped
| void Nytro::Game::Entity::setLayer | ( | EntityLayer * | pLayer | ) |
| virtual void Nytro::Game::Entity::setPrefab | ( | PrefabData * | pPrefab | ) | [virtual] |
set prefab data object
| virtual void Nytro::Game::Entity::setPrefabFileName | ( | const char * | pFileName | ) | [virtual] |
set prefab file name
| static void Nytro::Game::Entity::setShowConstantSizedEntityIcons | ( | bool | bShow | ) | [static] |
| virtual bool Nytro::Game::Entity::traceRay | ( | Ray & | rRay, | |
| SceneNodeHitInfo * | pHit, | |||
| ETraceRayAccuracy | aAccuracy = eTraceRayAccuracy_Brute | |||
| ) | [virtual] |
trace ray through entity, default checks if it hits entity icon
Reimplemented in Nytro::Game::ModelEntity.
| virtual void Nytro::Game::Entity::triggerEvent | ( | EntityEvent * | pEvent, | |
| Base * | pInitiator, | |||
| ParameterList * | pParams = NULL | |||
| ) | [virtual] |
trigger an event
| void Nytro::Game::Entity::triggerEvent | ( | const char * | pEvent, | |
| Base * | pInitiator, | |||
| ParameterList * | pParams = NULL | |||
| ) |
trigger and event by name
uint32 Nytro::Game::Entity::m_entityFlags [protected] |
Definition at line 269 of file nyEntity.h.
Vector3D Nytro::Game::Entity::m_entityIconCorners[4] [protected] |
Definition at line 266 of file nyEntity.h.
map<char*,EntityEvent*> Nytro::Game::Entity::m_events [protected] |
Definition at line 272 of file nyEntity.h.
int32 Nytro::Game::Entity::m_groupIndex [protected] |
Definition at line 264 of file nyEntity.h.
Definition at line 260 of file nyEntity.h.
Quaternion Nytro::Game::Entity::m_initialRotation [protected] |
Definition at line 261 of file nyEntity.h.
Vector3D Nytro::Game::Entity::m_initialScale [protected] |
Definition at line 260 of file nyEntity.h.
Vector3D Nytro::Game::Entity::m_initialTranslation [protected] |
Definition at line 260 of file nyEntity.h.
int32 Nytro::Game::Entity::m_layerIndex [protected] |
Definition at line 264 of file nyEntity.h.
Texture* Nytro::Game::Entity::m_pEntityIconTexture [protected] |
Definition at line 267 of file nyEntity.h.
uint8 Nytro::Game::Entity::m_performanceCost [protected] |
the entity's performance cost, between 0..255, 255 being very costly
Definition at line 271 of file nyEntity.h.
EntityGroup* Nytro::Game::Entity::m_pGroup [protected] |
Definition at line 262 of file nyEntity.h.
EntityLayer* Nytro::Game::Entity::m_pLayer [protected] |
Definition at line 268 of file nyEntity.h.
PrefabData* Nytro::Game::Entity::m_pPrefab [protected] |
Definition at line 265 of file nyEntity.h.
string Nytro::Game::Entity::m_prefabFileName [protected] |
Definition at line 263 of file nyEntity.h.
vector<EntityVisualEditHandle*> Nytro::Game::Entity::m_visualEditHandles [protected] |
Definition at line 273 of file nyEntity.h.
Reimplemented in Nytro::Game::CameraEntity, Nytro::Game::ModelEntity, Nytro::Game::ParticleSystemEntity, Nytro::Game::SkyDomeEntity, Nytro::Game::SoundSourceEntity, Nytro::Game::SpawnLocationEntity, and Nytro::Game::TriggerEntity.
Definition at line 251 of file nyEntity.h.
bool Nytro::Game::Entity::s_bShowConstantSizedEntityIcons [static, protected] |
Definition at line 255 of file nyEntity.h.
UiFxTimer Nytro::Game::Entity::s_selectionBlinkTimer [static, protected] |
Definition at line 256 of file nyEntity.h.