[DEV] add physic interface

This commit is contained in:
Edouard DUPIN 2014-12-19 21:40:12 +01:00
parent 673a7fbade
commit 1cc5144acc
3 changed files with 11 additions and 5 deletions

View File

@ -35,7 +35,7 @@ namespace ege {
* @brief set the position of the camera.
* @param[in] pos Position of the camera.
*/
void setEye(const vec3& _eye);
virtual void setEye(const vec3& _eye);
/**
* @brief get the curent Camera Eye position.
* @return the current position.
@ -50,7 +50,7 @@ namespace ege {
* @brief set a new Camera target position.
* @param[in] _target New camera target position.
*/
void setTarget(const vec3& _target);
virtual void setTarget(const vec3& _target);
/**
* @brief Get the curent Camera target position.
* @return The target position.
@ -65,7 +65,7 @@ namespace ege {
* @brief Set the camera angle.
* @param[in] _angle camera angle.
*/
void setAngle(float _angle);
virtual void setAngle(float _angle);
/**
* @brief Get the camera angle.
* @return the up camera angle.

View File

@ -452,7 +452,13 @@ void ege::ElementPhysic::setAngularVelocity(const vec3& _value) {
m_body->setAngularVelocity(_value);
}
btQuaternion ege::ElementPhysic::getOrientation() const {
if (m_body == nullptr) {
EGE_WARNING("no body");
return btQuaternion(0,0,0,0);
}
return m_body->getOrientation();
}
void ege::ElementPhysic::setCollisionDetectionStatus(bool _status) {
if (m_body == nullptr) {
EGE_WARNING("no body");

View File

@ -125,7 +125,7 @@ namespace ege {
virtual void setTorqueImpulse(const vec3& _value);
virtual void setAngularVelocity(const vec3& _value);
btQuaternion getOrientation() const;
protected:
bool m_elementInPhysicsSystem;