Wrapper for the IEntity class of CRYENGINE. Provides properties and wraps functions for easier access of IEntity functions. Entity must not inherit from IEntity but keep an ID reference to it, for reasons of CRYENGINE internal entity representation. More...
Public Member Functions | |
void | LoadMaterial (string path) |
Load a material from a path and set it as the current material. More... | |
void | OnRemove () |
Called before removing the entity from CRYENGINE's entity system. More... | |
void | Remove () |
Removes the Entity object from the scene. More... | |
T | AddComponent< T > () |
Adds a new instance of the component. More... | |
T | GetComponent< T > () |
Returns the first EntityComponent that matches the specified type. Returns null if nothing is found. More... | |
List< T > | GetComponents< T > () |
Get all components that match the specified type. Returns null if nothing is found. More... | |
T | GetComponentWithInterface< T > () |
Gets the first EntityComponent that implements the specified interface. Returns null if nothing was found. More... | |
List< T > | GetComponentsWithInterface< T > () |
Gets all components that implement the specified interface. Returns null if nothing was found. More... | |
T | GetOrCreateComponent< T > () |
Returns the first EntityComponent that matches the specified type, if it exists. Otherwise, adds a new instance of the component. More... | |
bool | HasComponent< T > () |
Returns true if this Entity has the specified EntityComponent, otherwise false. More... | |
void | SetParent (Entity parent, bool keepWorldTransform=false) |
Set the parent Entity of this Entity. More... | |
void | AttachChild (Entity child) |
Attach an Entity to this Entity as a child. More... | |
void | AttachChild (Entity child, SChildAttachParams attachParams) |
Attach an Entity to this Entity as a child. The attach-behavior is defined in the attachParams. More... | |
void | LoadParticleEmitter (int slot, ParticleEffect particleEffect, float scale=1.0f) |
Attaches a particle emitter object to a specific entity slot and loads it with particleEffect . More... | |
Vector3 | GetHelperPos (int slot, string helperName) |
Returns the world coordinates of a specific helper in a specific entity slot. More... | |
void | SetGeometrySlotLocalTransform (int slot, Matrix3x4 mx) |
Sets position, rotation and scale of an entity slot, ba a matrix. More... | |
void | FreeGeometrySlot (int slot) |
Removes any geometry that was previously attached to an entity slot. More... | |
void | LoadGeometry (int slot, string url) |
Loads a specific geometry into an entity slot. More... | |
int | LoadCharacter (int slot, string url) |
Loads a character to the specified slot, or to next available slot. If same character is already loaded in this slot, operation is ignored. If this slot number is occupied by a different kind of object it is overwritten. More... | |
Character | GetCharacter (int slot) |
Method to get the character at the specified slot. More... | |
void | SetSlotFlag (int slot, EntitySlotFlags flags) |
Set the flags for a specific slot. More... | |
ParticleEmitter | GetParticleEmitter (int slot) |
Returns a particle emitter on the basis of a given slot. More... | |
void | LoadLight (int slot, DynamicLight light) |
Loads a light into a given slot. More... | |
void | SetViewDistanceRatio (float viewDistanceRatio) |
Specify the ratio at which this entity is made invisible based on distance. Ratio is 0.0 - 1.0, with 1.0 being 100% visibility regardless of distance. More... | |
Static Public Member Functions | |
static Entity | Get (EntityId id) |
Finds an entity by its entity id First attempts to find the entity in the managed cache, otherwise queries native code More... | |
static Entity | Find (string name) |
Queries an entity by name First attempts to find the entity in the managed cache, otherwise queries native code More... | |
static Entity | Spawn (string name, Vector3 position, Quaternion rotation, Vector3 scale) |
Spawns an empty without any components More... | |
static T | SpawnWithComponent< T > (string name, Vector3 position, Quaternion rotation, Vector3 scale) |
Spawn a new Entity with the specified EntityComponent. More... | |
static T | SpawnWithComponent< T > (Vector3 position, Quaternion rotation, float scale=1f) |
Spawn a new Entity with the specified EntityComponent. More... | |
static T | SpawnWithComponent< T > (string name, Vector3 position, Quaternion rotation, float scale=1.0f) |
Spawn a new Entity with the specified EntityComponent. More... | |
static void | Remove (EntityId id) |
Remove the entity with the specified id. More... | |
Properties | |
EntityId | Id [get, set] |
Gets the unique identifier associated with this entity More... | |
Vector3 | Position [get, set] |
Get or set the position of the Entity in local-space. More... | |
Vector3 | WorldPosition [get, set] |
Get or set the position of the Entity in world-space. More... | |
Quaternion | Rotation [get, set] |
Get or set the rotation of the Entity in local-space. More... | |
Quaternion | WorldRotation [get, set] |
Get or set the rotation of the Entity in world-space. More... | |
Vector3 | Scale [get, set] |
Get or set the scale of the Entity in local-space. More... | |
Vector3 | Forward [get] |
Get the forward direction of the Entity in world-space. More... | |
string | Name [get, set] |
Get or set the name of the Entity. More... | |
IMaterial | Material [get, set] |
Get or set the Material of this Entity. More... | |
bool | Hidden [get, set] |
Hide or unhide this T:CryEngine.Entity. More... | |
List< Entity > | Children [get] |
Get a list of all the child Entities of this Entity. More... | |
Entity | Parent [get, set] |
Gets or sets the parent of this Entity. Setting a new parent will keep the local-transform of this object. Use SetParent() to manually decide the behaviour when setting the parent. More... | |
bool | Exists [get] |
Determines whether this Entity still exists in the engine. More... | |
Matrix3x4 | Transform [get, set] |
The local transform-matrix of this Entity. More... | |
PhysicsEntity | Physics [get] |
The representation of this Entity in the physics engine. More... | |
Wrapper for the IEntity class of CRYENGINE. Provides properties and wraps functions for easier access of IEntity functions. Entity must not inherit from IEntity but keep an ID reference to it, for reasons of CRYENGINE internal entity representation.
Adds a new instance of the component.
T |
T | : | EntityComponent | |
T | : | new() |
|
inline |
|
inline |
|
inline static |
Queries an entity by name First attempts to find the entity in the managed cache, otherwise queries native code
name |
|
inline |
Removes any geometry that was previously attached to an entity slot.
slot | Slot. |
Finds an entity by its entity id First attempts to find the entity in the managed cache, otherwise queries native code
id | EntityId |
|
inline |
Method to get the character at the specified slot.
slot | The index of the character slot. |
Returns the first EntityComponent that matches the specified type. Returns null if nothing is found.
T | : | EntityComponent |
Get all components that match the specified type. Returns null if nothing is found.
T | The type the components have to match. |
T | : | EntityComponent |
Gets all components that implement the specified interface. Returns null if nothing was found.
T | The type of interface that has to be implemented. |
T | : | class |
Gets the first EntityComponent that implements the specified interface. Returns null if nothing was found.
T | The type of interface that has to be implemented. |
T | : | class |
|
inline |
Returns the world coordinates of a specific helper in a specific entity slot.
slot | Slot. |
helperName | Helper name. |
Returns the first EntityComponent that matches the specified type, if it exists. Otherwise, adds a new instance of the component.
T |
T | : | EntityComponent | |
T | : | new() |
|
inline |
Returns a particle emitter on the basis of a given slot.
slot | Slot. |
|
inline |
Returns true if this Entity has the specified EntityComponent, otherwise false.
T |
T | : | EntityComponent |
|
inline |
Loads a character to the specified slot, or to next available slot. If same character is already loaded in this slot, operation is ignored. If this slot number is occupied by a different kind of object it is overwritten.
slot | The index of the character slot. |
url | The path to the character file. |
|
inline |
Loads a specific geometry into an entity slot.
slot | Slot. |
url | URL. |
|
inline |
Loads a light into a given slot.
slot | Slot. |
light | Light. |
|
inline |
Load a material from a path and set it as the current material.
path |
|
inline |
Attaches a particle emitter object to a specific entity slot and loads it with particleEffect .
slot | The slot to load the particle in. |
particleEffect | Particle effect to load. |
scale | Scale of the emitter. |
|
inline |
Called before removing the entity from CRYENGINE's entity system.
|
inline static |
Remove the entity with the specified id.
id |
|
inline |
Removes the Entity object from the scene.
|
inline |
Sets position, rotation and scale of an entity slot, ba a matrix.
slot | Slot. |
mx | Mx. |
|
inline |
|
inline |
Set the flags for a specific slot.
slot | |
flags |
|
inline |
Specify the ratio at which this entity is made invisible based on distance. Ratio is 0.0 - 1.0, with 1.0 being 100% visibility regardless of distance.
viewDistanceRatio | View distance ratio. |
|
inline static |
Spawns an empty without any components
name | Name of the entity |
position | Initial position of the entity |
rotation | Initial rotation of the entity |
scale | Initial scale of the entity |
|
inline static |
Spawn a new Entity with the specified EntityComponent.
T | The type of the EntityComponent. |
T | : | EntityComponent | |
T | : | new() |
|
inline static |
Spawn a new Entity with the specified EntityComponent.
T | The type of the EntityComponent. |
T | : | EntityComponent | |
T | : | new() |
|
inline static |
Spawn a new Entity with the specified EntityComponent.
T | The type of the EntityComponent. |
T | : | EntityComponent | |
T | : | new() |
|
get |
Determines whether this Entity still exists in the engine.
|
get |
Get the forward direction of the Entity in world-space.
The forward.
|
get set |
Hide or unhide this T:CryEngine.Entity.
true
if hidden; otherwise, false
.
|
get set |
Gets the unique identifier associated with this entity
|
get set |
Get or set the Material of this Entity.
|
get set |
Get or set the name of the Entity.
|
get set |
Gets or sets the parent of this Entity. Setting a new parent will keep the local-transform of this object. Use SetParent() to manually decide the behaviour when setting the parent.
The parent.
|
get |
The representation of this Entity in the physics engine.
|
get set |
Get or set the rotation of the Entity in local-space.
|
get set |
Get or set the position of the Entity in world-space.
The world position.
|
get set |
Get or set the rotation of the Entity in world-space.
The world rotation.