Neo  0.5.0
Developer Documentation
Neo::OEntity Class Reference

Represents a 3D mesh in the scene. More...

#include <OEntity.h>

+ Inheritance diagram for Neo::OEntity:

Public Member Functions

 OEntity (MeshRef *meshRef)
 
 ~OEntity (void)
 
 OEntity (const OEntity &entity)
 
MaterialgetMaterial (size_t idx=0)
 Retrieves the material with the given index. More...
 
size_t getMaterialsNumber ()
 Returns the number of materials attached to this entity. More...
 
bool hasWireframe ()
 Checks if the entity has the wireframe mode enabled. More...
 
void enableWireframe (bool v)
 Enables/Disable the wireframe of the entity. More...
 
bool hasTransparency ()
 Checks if the entity has any transparent material. More...
 
PhysicsPropertiesenablePhysics (Scene *scene)
 Sets up the OEntity to become a physical active object in the given scene. More...
 
PhysicsPropertiesenablePhysics ()
 Sets up the OEntity to become a physical active object in the current scene. More...
 
bool isColliding (OEntity *entity)
 Checks if the object is colliding with the other object. More...
 
bool isColliding ()
 Checks if the object has any collision with any other object. More...
 
void enableOccluder (bool value)
 Sets if this object is a occluder or not. More...
 
bool isOccluder ()
 Checks if the OEntity is an occluder. More...
 
virtual int getType (void)
 Returns the type of the object. More...
 
virtual void setActive (bool active)
 Changes if the object is being active or inactive. More...
 
void setInvisible (bool invisible)
 Changes if the OEntity is invisible or not. More...
 
bool isInvisible (void)
 Checks if the OEntity is invisible. More...
 
MeshgetMesh (void)
 Returns the Mesh of the OEntity. More...
 
void setMeshRef (MeshRef *meshRef)
 Sets the MeshRef of the OEntity. More...
 
MeshRefgetMeshRef (void)
 Returns the MeshRef of the OEntity. More...
 
void changeAnimation (unsigned int animationId)
 Changes the currently running animation to the one with the given ID. More...
 
bool isAnimationOver (void)
 Checks if the currently running animation has finished. More...
 
void setAnimationSpeed (float animationSpeed)
 Changes the animation speed. More...
 
void setCurrentFrame (float currentFrame)
 Changes the current frame in the current animation. More...
 
unsigned int getAnimationId (void)
 Returns the animation ID of the currently running animation. More...
 
float getAnimationSpeed (void)
 Returns the animation speed of the currently running animation. More...
 
float getCurrentFrame (void)
 Returns the animation current frame in the currently running animation. More...
 
void deletePhysicsProperties (void)
 Disables physics and deletes the physics properties. More...
 
PhysicsPropertiescreatePhysicsProperties (void)
 Enables physics and creates a new PhysicsProperties object. More...
 
PhysicsPropertiesgetPhysicsProperties (void)
 Returns the physics properties object. More...
 
Box3dgetBoundingBox (void)
 Returns the bounding box. More...
 
bool hasShadow ()
 Checks if the OEntity has a shadow. More...
 
void enableShadow (bool shadow)
 Enables or disables shadows for the OEntity. More...
 
virtual void update (void)
 Updates the object. More...
 
virtual void updateVisibility (OCamera *camera)
 Recalculates visibility for the given camera. More...
 
- Public Member Functions inherited from Neo::Object3d
 Object3d (void)
 
virtual ~Object3d (void)
 
 Object3d (const Object3d &object)
 
AdditionalDatagetAdditionalData ()
 
void setAdditionalData (AdditionalData *d)
 
void updateMatrix (void)
 Recalculates the internal matrix relative to the parent object. More...
 
void computeLocalMatrix (void)
 Calculates the local matrix without respecting the parent. More...
 
Matrix4x4getMatrix (void)
 Returns the current matrix. More...
 
void unlinkChildren (void)
 Unlinks all children from this object and sets their parent to NULL. More...
 
void computeChildrenMatrices (void)
 Calculates the matrix of every child object. More...
 
void setAttribute (const char *name, NeoVariable variable)
 Sets the value of the attribute with the given name. More...
 
NeoVariable getAttribute (const char *name)
 Returns the value of the attribute variable with the given name. More...
 
Vector3 getUniformRotatedVector (const Vector3 &vector)
 Rotates the given vector while preserving its length and returns the result. More...
 
Vector3 getInverseRotatedVector (const Vector3 &vector) const
 Calculates the inverse rotated vector. More...
 
Vector3 getRotatedVector (const Vector3 &vector) const
 Rotates the given vector and returns the result. More...
 
Vector3 getInversePosition (const Vector3 &position) const
 Multiplies the inverse matrix with the given vector and return the result. More...
 
Vector3 getTransformedVector (const Vector3 &vector) const
 Transforms the given vector using the internal matrix. More...
 
void setPosition (const Vector3 &position)
 Changes the position. More...
 
void translate (const Vector3 &vec, bool local=false)
 Translates the object. More...
 
void rotate (const Vector3 &axis, float angle, bool local=false)
 Rotates the object. More...
 
Vector3 getTransformedPosition (void) const
 Returns the transformed position directly from the internal matrix. More...
 
Vector3 getPosition (void) const
 Returns the position as a Vector3. More...
 
void setEulerRotation (const Vector3 &euler)
 Changes the Euler rotation. More...
 
void setAxisAngleRotation (const Vector3 &axis, float angle)
 Changes the angle of the specified axis. More...
 
void addAxisAngleRotation (const Vector3 &axis, float angle)
 Changes the angle of the specified axis by adding the given value. More...
 
void setRotation (const Quaternion &rotation)
 Sets the rotation or the object. More...
 
Vector3 getTransformedRotation (void) const
 Returns the transformed rotation. More...
 
Vector3 getEulerRotation (void) const
 Returns the Euler rotation in a Vector3 in degrees. More...
 
Quaternion getRotation (void) const
 Returns the rotation of the object. More...
 
void setScale (const Vector3 &scale)
 Changes the scale of the object. More...
 
Vector3 getTransformedScale (void) const
 Returns the transformed scale of the object. More...
 
Vector3 getScale (void) const
 Returns the scale of the object. More...
 
void linkTo (Object3d *parent)
 Links the object to another object. More...
 
void unLink (void)
 Removing the link to the parent object. More...
 
void setParent (Object3d *object)
 Sets the parent object. More...
 
void addChild (Object3d *child)
 Adds an Object3d to the list of children. More...
 
bool hasParent (void)
 Checks if the object has a parent. More...
 
unsigned int getChildrenNumber (void)
 Returns the number of children. More...
 
Object3dgetParent (void)
 Returns the parent object. More...
 
Object3dgetChild (unsigned int id)
 Returns the child with the given ID. More...
 
unsigned long getId ()
 Returns the ID of the object. More...
 
void setId (unsigned long id)
 Changes the ID of the object. More...
 
void updateBehaviors (void)
 Updates all behaviors. More...
 
void drawBehaviors (void)
 Draws all behaviors. More...
 
void deleteBehavior (unsigned int id)
 Deletes the Behavior with the given ID. More...
 
void invertBehavior (unsigned int idA, unsigned int idB)
 Switches the IDs of the given behavior IDs. More...
 
void changeBehavior (unsigned int id, Behavior *behavior)
 Replaces the behavior with the given ID with the given Behavior. More...
 
void addBehavior (Behavior *behavior)
 Adds a new behavior to the list of behaviors. More...
 
unsigned int getBehaviorsNumber (void)
 Returns the number of registered Behaviors. More...
 
BehaviorgetBehavior (unsigned int id)
 Returns the Behavior with the given ID. More...
 
bool needToUpdate (void)
 Checks if the object needs to be updated. More...
 
bool isActive (void)
 Checks if the object is active. More...
 
void setVisible (bool visible)
 Changes if the object is visible or not. More...
 
bool isVisible (void)
 Checks if the object is visible. More...
 
void setName (const char *name)
 Change the object name. More...
 
const char * getName (void)
 Returns the object name. More...
 

Additional Inherited Members

- Protected Types inherited from Neo::Object3d
typedef unordered_map< string, NeoVariable >::iterator AttributeIterator
 
typedef map< string, NeoVariable >::iterator AttributeIterator
 
- Protected Member Functions inherited from Neo::Object3d
void clearObject3d (void)
 
- Protected Attributes inherited from Neo::Object3d
String m_name
 The name of the object. More...
 
Vector3 m_position
 The positopm. More...
 
Vector3 m_scale
 The scale. More...
 
Quaternion m_rotation
 The rotation. More...
 
Matrix4x4 m_matrix
 The matrix. More...
 
vector< Object3d * > m_children
 List of children. More...
 
unordered_map< string, NeoVariablem_attributes
 
map< string, NeoVariablem_attributes
 
bool m_isActive
 
bool m_isVisible
 
bool m_needToUpdate
 
unsigned long m_id
 
Object3dm_parent
 
vector< Behavior * > m_behaviors
 List of behaviors. More...
 

Detailed Description

Represents a 3D mesh in the scene.

How to create a new OEntity

Level* level = NeoEngine::getInstance()->getLevel();
Scene* scene = level->getCurrentScene();
OEntity* newEntity = scene->addNewEntity(level->loadMesh("assets/mesh.dae"));
See also
Object3d

Constructor & Destructor Documentation

Neo::OEntity::OEntity ( MeshRef meshRef)
Neo::OEntity::~OEntity ( void  )
Neo::OEntity::OEntity ( const OEntity entity)

Member Function Documentation

void Neo::OEntity::changeAnimation ( unsigned int  animationId)

Changes the currently running animation to the one with the given ID.

Parameters
animationIdThe animation ID.
PhysicsProperties* Neo::OEntity::createPhysicsProperties ( void  )

Enables physics and creates a new PhysicsProperties object.

Returns
The new PhysicsProperties object.
void Neo::OEntity::deletePhysicsProperties ( void  )

Disables physics and deletes the physics properties.

void Neo::OEntity::enableOccluder ( bool  value)
inline

Sets if this object is a occluder or not.

An occluder is used by the renderer to do occlusion culling.

Parameters
valueA boolean value.
PhysicsProperties* Neo::OEntity::enablePhysics ( Scene scene)

Sets up the OEntity to become a physical active object in the given scene.

Parameters
sceneThe scene the object operates in.
Returns
The new PhysicsProperties of the object.
PhysicsProperties* Neo::OEntity::enablePhysics ( )

Sets up the OEntity to become a physical active object in the current scene.

Returns
The new PhysicsProperties of the object.
See also
enablePhysics(Scene* scene)
void Neo::OEntity::enableShadow ( bool  shadow)
inline

Enables or disables shadows for the OEntity.

Parameters
shadowThe enable value.
void Neo::OEntity::enableWireframe ( bool  v)
inline

Enables/Disable the wireframe of the entity.

Parameters
vA boolean value.
unsigned int Neo::OEntity::getAnimationId ( void  )
inline

Returns the animation ID of the currently running animation.

Returns
The animation ID.
float Neo::OEntity::getAnimationSpeed ( void  )
inline

Returns the animation speed of the currently running animation.

Returns
The animation speed.
Box3d* Neo::OEntity::getBoundingBox ( void  )
inline

Returns the bounding box.

Returns
The bounding box.
See also
Box3d
float Neo::OEntity::getCurrentFrame ( void  )
inline

Returns the animation current frame in the currently running animation.

Returns
The current frame.
Material* Neo::OEntity::getMaterial ( size_t  idx = 0)
inline

Retrieves the material with the given index.

Parameters
idxThe index to retrieve from.
size_t Neo::OEntity::getMaterialsNumber ( )
inline

Returns the number of materials attached to this entity.

Returns
The number of materials.
Mesh* Neo::OEntity::getMesh ( void  )

Returns the Mesh of the OEntity.

Returns
The Mesh object.
MeshRef* Neo::OEntity::getMeshRef ( void  )
inline

Returns the MeshRef of the OEntity.

Returns
The MeshRef.
See also
MeshRef
PhysicsProperties* Neo::OEntity::getPhysicsProperties ( void  )
inline

Returns the physics properties object.

Returns
The PhysicsProperties.
virtual int Neo::OEntity::getType ( void  )
inlinevirtual

Returns the type of the object.

Returns
The type.

Reimplemented from Neo::Object3d.

bool Neo::OEntity::hasShadow ( )
inline

Checks if the OEntity has a shadow.

Returns
A boolean value.
bool Neo::OEntity::hasTransparency ( )
inline

Checks if the entity has any transparent material.

Returns
A boolean value.
bool Neo::OEntity::hasWireframe ( )
inline

Checks if the entity has the wireframe mode enabled.

Returns
A boolean value.
bool Neo::OEntity::isAnimationOver ( void  )

Checks if the currently running animation has finished.

Returns
A boolean value.
bool Neo::OEntity::isColliding ( OEntity entity)

Checks if the object is colliding with the other object.

Parameters
entityThe other object.
Returns
A boolean value.
See also
enablePhysics
createPhysicsProperties
bool Neo::OEntity::isColliding ( )

Checks if the object has any collision with any other object.

Returns
A boolean value.
See also
isColliding(OEntity*)
bool Neo::OEntity::isInvisible ( void  )
inline

Checks if the OEntity is invisible.

Returns
A boolean value.
bool Neo::OEntity::isOccluder ( )
inline

Checks if the OEntity is an occluder.

Returns
A boolean value.
virtual void Neo::OEntity::setActive ( bool  active)
virtual

Changes if the object is being active or inactive.

Parameters
activeThe new activity value.

Reimplemented from Neo::Object3d.

void Neo::OEntity::setAnimationSpeed ( float  animationSpeed)
inline

Changes the animation speed.

Parameters
animationSpeedThe new animation speed.
void Neo::OEntity::setCurrentFrame ( float  currentFrame)
inline

Changes the current frame in the current animation.

Parameters
currentFrameThe new frame to display.
void Neo::OEntity::setInvisible ( bool  invisible)
inline

Changes if the OEntity is invisible or not.

This value is not used for culling.

Parameters
invisibleA boolean value.
See also
setVisible
void Neo::OEntity::setMeshRef ( MeshRef meshRef)

Sets the MeshRef of the OEntity.

Parameters
meshRefThe MeshRef.
See also
MeshRef
virtual void Neo::OEntity::update ( void  )
virtual

Updates the object.

Reimplemented from Neo::Object3d.

virtual void Neo::OEntity::updateVisibility ( OCamera camera)
virtual

Recalculates visibility for the given camera.

Used for culling.

Parameters
cameraThe camera to check visibility for.

Reimplemented from Neo::Object3d.


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