Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'extern/bullet2/src/BulletDynamics/Dynamics/btRigidBody.h')
-rw-r--r--extern/bullet2/src/BulletDynamics/Dynamics/btRigidBody.h33
1 files changed, 20 insertions, 13 deletions
diff --git a/extern/bullet2/src/BulletDynamics/Dynamics/btRigidBody.h b/extern/bullet2/src/BulletDynamics/Dynamics/btRigidBody.h
index 4596f90a00f..ec570cab875 100644
--- a/extern/bullet2/src/BulletDynamics/Dynamics/btRigidBody.h
+++ b/extern/bullet2/src/BulletDynamics/Dynamics/btRigidBody.h
@@ -17,7 +17,6 @@ subject to the following restrictions:
#define RIGIDBODY_H
#include "LinearMath/btAlignedObjectArray.h"
-#include "LinearMath/btPoint3.h"
#include "LinearMath/btTransform.h"
#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
@@ -31,7 +30,7 @@ extern btScalar gDeactivationTime;
extern bool gDisableDeactivation;
-///btRigidBody is the main class for rigid body objects. It is derived from btCollisionObject, so it keeps a pointer to a btCollisionShape.
+///The btRigidBody is the main class for rigid body objects. It is derived from btCollisionObject, so it keeps a pointer to a btCollisionShape.
///It is recommended for performance and memory use to share btCollisionShape objects whenever possible.
///There are 3 types of rigid bodies:
///- A) Dynamic rigid bodies, with positive mass. Motion is controlled by rigid body dynamics.
@@ -49,6 +48,7 @@ class btRigidBody : public btCollisionObject
btScalar m_angularFactor;
btVector3 m_gravity;
+ btVector3 m_gravity_acceleration;
btVector3 m_invInertiaLocal;
btVector3 m_totalForce;
btVector3 m_totalTorque;
@@ -75,7 +75,7 @@ class btRigidBody : public btCollisionObject
public:
- ///btRigidBodyConstructionInfo provides information to create a rigid body. Setting mass to zero creates a fixed (non-dynamic) rigid body.
+ ///The btRigidBodyConstructionInfo structure provides information to create a rigid body. Setting mass to zero creates a fixed (non-dynamic) rigid body.
///For dynamic objects, you can use the collision shape to approximate the local inertia tensor, otherwise use the zero vector (default argument)
///You can use the motion state to synchronize the world transform between physics and graphics objects.
///And if the motion state is provided, the rigid body will initialize its initial world transform from the motion state,
@@ -182,7 +182,7 @@ public:
const btVector3& getGravity() const
{
- return m_gravity;
+ return m_gravity_acceleration;
}
void setDamping(btScalar lin_damping, btScalar ang_damping);
@@ -232,8 +232,18 @@ public:
{
m_totalForce += force;
}
+
+ const btVector3& getTotalForce()
+ {
+ return m_totalForce;
+ };
+
+ const btVector3& getTotalTorque()
+ {
+ return m_totalTorque;
+ };
- const btVector3& getInvInertiaDiagLocal()
+ const btVector3& getInvInertiaDiagLocal() const
{
return m_invInertiaLocal;
};
@@ -303,7 +313,7 @@ public:
void updateInertiaTensor();
- const btPoint3& getCenterOfMassPosition() const {
+ const btVector3& getCenterOfMassPosition() const {
return m_worldTransform.getOrigin();
}
btQuaternion getOrientation() const;
@@ -321,15 +331,12 @@ public:
inline void setLinearVelocity(const btVector3& lin_vel)
{
- assert (m_collisionFlags != btCollisionObject::CF_STATIC_OBJECT);
m_linearVelocity = lin_vel;
}
- inline void setAngularVelocity(const btVector3& ang_vel) {
- assert (m_collisionFlags != btCollisionObject::CF_STATIC_OBJECT);
- {
- m_angularVelocity = ang_vel;
- }
+ inline void setAngularVelocity(const btVector3& ang_vel)
+ {
+ m_angularVelocity = ang_vel;
}
btVector3 getVelocityInLocalPoint(const btVector3& rel_pos) const
@@ -353,7 +360,7 @@ public:
- SIMD_FORCE_INLINE btScalar computeImpulseDenominator(const btPoint3& pos, const btVector3& normal) const
+ SIMD_FORCE_INLINE btScalar computeImpulseDenominator(const btVector3& pos, const btVector3& normal) const
{
btVector3 r0 = pos - getCenterOfMassPosition();