Inheritance diagram for ege::ElementPhysic:
ege::Element ememory::EnableSharedFromThis< Element > ememory::EnableSharedFromThisBase

Public Member Functions

void createRigidBody (float _mass=400000000.0f)
 
 ElementPhysic (const ememory::SharedPtr< ege::Environement > &_env, bool _autoRigidBody=true)
 
virtual ~ElementPhysic ()
 
virtual const std::string & getType () const
 
bool setShape (btCollisionShape *_shape)
 
btCollisionShape * getShape ()
 
virtual bool setMesh (ememory::SharedPtr< ege::resource::Mesh > _mesh)
 
virtual void draw (int32_t _pass=0)
 
virtual vec3 getPositionTheoric ()
 
virtual void setPositionTheoric (const vec3 &_pos)
 
const vec3getSpeed ()
 
const float getInvMass ()
 
virtual void setMass (float _value)
 
virtual void setLinearVelocity (const vec3 &_value)
 
virtual void setTorqueImpulse (const vec3 &_value)
 
virtual void setAngularVelocity (const vec3 &_value)
 
btQuaternion getOrientation () const
 
virtual void dynamicEnable ()
 
virtual void dynamicDisable ()
 
void iaEnable ()
 
void iaDisable ()
 
virtual void iaAction (float _step)
 
virtual void onDestroy ()
 
virtual const vec3getPosition ()
 
virtual void setPosition (const vec3 &_pos)
 
virtual void drawDebug (ememory::SharedPtr< ewol::resource::Colored3DObject > _draw, ememory::SharedPtr< ege::Camera > _camera)
 
bool getCollisionDetectionStatus ()
 
void setCollisionDetectionStatus (bool _status=true)
 
virtual void onCollisionDetected (const ememory::SharedPtr< ege::Element > &_obj, const vec3 &_point, const vec3 &_normal)
 
- Public Member Functions inherited from ege::Element
 Element (const ememory::SharedPtr< ege::Environement > &_env)
 
virtual ~Element ()
 
virtual bool init ()
 
virtual bool initString (const std::string &_description)
 
virtual bool initXML (const exml::Node &_node)
 
virtual bool initJSON (const ejson::Value &_value)
 
virtual bool initVoid (void *_value)
 
virtual bool unInit ()
 
uint32_t getUID () const
 
virtual bool loadMesh (const std::string &_meshFileName)
 
ememory::SharedPtr< ege::resource::MeshgetMesh ()
 
float getLifeRatio ()
 
bool isDead ()
 
virtual bool needToRemove ()
 
virtual void setFireOn (int32_t _groupIdSource, int32_t _type, float _power, const vec3 &_center=vec3(0, 0, 0))
 
virtual void onLifeChange ()
 
int32_t getGroup () const
 
void setGroup (int32_t _newGroup)
 
virtual void preCalculationDraw (const ege::Camera &_camera)
 
virtual void drawLife (ememory::SharedPtr< ewol::resource::Colored3DObject > _draw, ememory::SharedPtr< ege::Camera > _camera)
 
virtual void elementIsRemoved (ememory::SharedPtr< ege::Element > _removedElement)
 
bool isFixed ()
 
float getRadius ()
 
- Public Member Functions inherited from ememory::EnableSharedFromThis< Element >
ememory::SharedPtr< EMEMORY_TYPE > sharedFromThis ()
 
const ememory::SharedPtr< EMEMORY_TYPE > sharedFromThis () const
 
ememory::WeakPtr< EMEMORY_TYPE > weakFromThis ()
 
const ememory::WeakPtr< EMEMORY_TYPE > weakFromThis () const
 

Protected Member Functions

void drawShape (const btCollisionShape *_shape, ememory::SharedPtr< ewol::resource::Colored3DObject > _draw, mat4 _transformationMatrix, std::vector< vec3 > _tmpVertices)
 

Protected Attributes

btRigidBody * m_body
 
btCollisionShape * m_shape
 
vec3 m_theoricPosition
 
bool m_elementInPhysicsSystem
 
bool m_detectCollisionEnable
 
- Protected Attributes inherited from ege::Element
ememory::SharedPtr< ege::Environementm_env
 
ememory::SharedPtr< ege::resource::Meshm_mesh
 
float m_life
 
float m_lifeMax
 
int32_t m_group
 
ewol::compositing::Text m_debugText
 
bool m_fixe
 
float m_radius
 

Constructor & Destructor Documentation

§ ElementPhysic()

ege::ElementPhysic::ElementPhysic ( const ememory::SharedPtr< ege::Environement > &  _env,
bool  _autoRigidBody = true 
)

Constructor (when constructer is called just add element that did not change. The object will be stored in a pool of element and keep a second time if needed == > redure memory allocation, when needed, the system will call the init and un-init function...

Parameters
[in]_envglabal ege environement
[in]_autoRigidBodyadd a basic rigid body (not availlable after befor setting a shape)

§ ~ElementPhysic()

virtual ege::ElementPhysic::~ElementPhysic ( )
virtual

Destructor.

Member Function Documentation

§ draw()

virtual void ege::ElementPhysic::draw ( int32_t  _pass = 0)
virtual

draw the curent element (can have multiple display)

Parameters
[in]passId of the current pass : [0..?]

Implements ege::Element.

§ drawDebug()

virtual void ege::ElementPhysic::drawDebug ( ememory::SharedPtr< ewol::resource::Colored3DObject >  _draw,
ememory::SharedPtr< ege::Camera _camera 
)
virtual

Debug display of the current element.

Parameters
[in,out]drawBasic system to draw the debug shape and informations

Reimplemented from ege::Element.

§ dynamicDisable()

virtual void ege::ElementPhysic::dynamicDisable ( )
virtual

remove this element from the physique engine

Reimplemented from ege::Element.

§ dynamicEnable()

virtual void ege::ElementPhysic::dynamicEnable ( )
virtual

set the elment in the physique engine

Reimplemented from ege::Element.

§ getCollisionDetectionStatus()

bool ege::ElementPhysic::getCollisionDetectionStatus ( )
inline

get collision status of the object.

Returns
the collision status.

§ getInvMass()

const float ege::ElementPhysic::getInvMass ( )

get the current mass of the element

Returns
the mass in kG.

§ getPosition()

virtual const vec3& ege::ElementPhysic::getPosition ( )
virtual

get the current position of the element

Returns
the 3D position.

Reimplemented from ege::Element.

§ getPositionTheoric()

virtual vec3 ege::ElementPhysic::getPositionTheoric ( )
inlinevirtual

get the theoric position. Sometimes, the element has move due to an explosion or something else, then its real position in not the one that woult it be at the end ...

Returns
the theoric position

Reimplemented from ege::Element.

§ getShape()

btCollisionShape* ege::ElementPhysic::getShape ( )
inline

get a pointer on the bullet collision shape.

Returns
the collision pointer.

§ getSpeed()

const vec3& ege::ElementPhysic::getSpeed ( )

get the current speed of the element

Returns
the 3D speed.

§ getType()

virtual const std::string& ege::ElementPhysic::getType ( ) const
virtual

get the element Type description string.

Returns
A reference on the descriptive string.

Reimplemented from ege::Element.

§ iaAction()

virtual void ege::ElementPhysic::iaAction ( float  _step)
inlinevirtual

periodic call for intelligence artificial.

Parameters
[in]step: step of time in s

§ iaDisable()

void ege::ElementPhysic::iaDisable ( )

disable periodic call Of this object for processing Artificial Intelligence

§ iaEnable()

void ege::ElementPhysic::iaEnable ( )

enable periodic call Of this object for processing Artificial Intelligence

§ onCollisionDetected()

virtual void ege::ElementPhysic::onCollisionDetected ( const ememory::SharedPtr< ege::Element > &  _obj,
const vec3 _point,
const vec3 _normal 
)
inlinevirtual

when a collision is detected with an other object (just after calculate data update

Parameters
[in]_objthe Other object
[in]_pointPosition of the impact in the global world
[in]_normalNormal of the impact

§ onDestroy()

virtual void ege::ElementPhysic::onDestroy ( )
inlinevirtual

, call when the element is removed (call only one time

Reimplemented from ege::Element.

§ setCollisionDetectionStatus()

void ege::ElementPhysic::setCollisionDetectionStatus ( bool  _status = true)

Change enable status of the object.

Parameters
[in]_statusnew requested status.

§ setMesh()

virtual bool ege::ElementPhysic::setMesh ( ememory::SharedPtr< ege::resource::Mesh _mesh)
virtual

set the the Mesh properties.

Parameters
[in]_meshThe mesh pointer. (nullptr to force the mesh remove ...)
Note
: this remove the shape and the mesh properties.
Returns
true if no error occured

Reimplemented from ege::Element.

§ setPosition()

virtual void ege::ElementPhysic::setPosition ( const vec3 _pos)
virtual

set the current position of the element

Parameters
[in]_posset the 3D position.

Reimplemented from ege::Element.

§ setPositionTheoric()

virtual void ege::ElementPhysic::setPositionTheoric ( const vec3 _pos)
inlinevirtual

set the current Theoric position of the element

Parameters
[in]setthe 3D position.

§ setShape()

bool ege::ElementPhysic::setShape ( btCollisionShape *  _shape)

set the shape properties.

Parameters
[in]_shapeThe shape pointer.
Note
: this remove the shape properties.
Returns
true if no error occured

Member Data Documentation

§ m_body

btRigidBody* ege::ElementPhysic::m_body
protected

all the element have a body == > otherwise it will be not manage with this system...

§ m_detectCollisionEnable

bool ege::ElementPhysic::m_detectCollisionEnable
protected

physic collision detect enable.

§ m_shape

btCollisionShape* ege::ElementPhysic::m_shape
protected

shape of the element (set a copy here to have the debug display of it)

§ m_theoricPosition

vec3 ege::ElementPhysic::m_theoricPosition
protected

draw the current life of the element


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