16#ifndef BT_SOLVER_BODY_H
17#define BT_SOLVER_BODY_H
40 : m_vec128(_mm_set1_ps(fl))
88 return btSimdScalar(_mm_mul_ps(v1.get128(), v2.get128()));
95 return btSimdScalar(_mm_add_ps(v1.get128(), v2.get128()));
99#define btSimdScalar btScalar
123 m_worldTransform = worldTransform;
128 return m_worldTransform;
134 velocity = m_linearVelocity + m_externalForceImpulse + (m_angularVelocity + m_externalTorqueImpulse).cross(rel_pos);
142 velocity = m_linearVelocity + m_deltaLinearVelocity + (m_angularVelocity + m_deltaAngularVelocity).cross(rel_pos);
150 angVel = m_angularVelocity + m_deltaAngularVelocity;
160 m_deltaLinearVelocity += linearComponent * impulseMagnitude * m_linearFactor;
161 m_deltaAngularVelocity += angularComponent * (impulseMagnitude * m_angularFactor);
169 m_pushVelocity += linearComponent * impulseMagnitude * m_linearFactor;
170 m_turnVelocity += angularComponent * (impulseMagnitude * m_angularFactor);
176 return m_deltaLinearVelocity;
181 return m_deltaAngularVelocity;
186 return m_pushVelocity;
191 return m_turnVelocity;
199 return m_deltaLinearVelocity;
204 return m_deltaAngularVelocity;
209 return m_angularFactor;
224 return m_pushVelocity;
229 return m_turnVelocity;
234 velocity = m_linearVelocity + m_deltaLinearVelocity + (m_angularVelocity + m_deltaAngularVelocity).cross(rel_pos);
239 angVel = m_angularVelocity + m_deltaAngularVelocity;
247 m_deltaLinearVelocity += linearComponent * impulseMagnitude * m_linearFactor;
248 m_deltaAngularVelocity += angularComponent * (impulseMagnitude * m_angularFactor);
256 m_linearVelocity += m_deltaLinearVelocity;
257 m_angularVelocity += m_deltaAngularVelocity;
268 m_linearVelocity += m_deltaLinearVelocity;
269 m_angularVelocity += m_deltaAngularVelocity;
273 if (m_pushVelocity[0] != 0.f || m_pushVelocity[1] != 0 || m_pushVelocity[2] != 0 || m_turnVelocity[0] != 0.f || m_turnVelocity[1] != 0 || m_turnVelocity[2] != 0)
277 m_worldTransform = newTransform;
btMatrix3x3 operator*(const btMatrix3x3 &m, const btScalar &k)
btMatrix3x3 operator+(const btMatrix3x3 &m1, const btMatrix3x3 &m2)
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
#define ATTRIBUTE_ALIGNED16(a)
#define SIMD_FORCE_INLINE
#define btSimdScalar
Until we get other contributions, only use SIMD on Windows, when using Visual Studio 2008 or later,...
The btRigidBody is the main class for rigid body objects.
btVector3 can be used to represent 3D points and vectors.
void setValue(const btScalar &_x, const btScalar &_y, const btScalar &_z)
The btSolverBody is an internal datastructure for the constraint solver. Only necessary data is packe...
void getAngularVelocity(btVector3 &angVel) const
const btVector3 & getPushVelocity() const
const btVector3 & getTurnVelocity() const
const btVector3 & getDeltaLinearVelocity() const
btVector3 & internalGetDeltaAngularVelocity()
void setWorldTransform(const btTransform &worldTransform)
btVector3 m_angularVelocity
btVector3 m_deltaLinearVelocity
btRigidBody * m_originalBody
void internalApplyPushImpulse(const btVector3 &linearComponent, const btVector3 &angularComponent, btScalar impulseMagnitude)
btVector3 & internalGetTurnVelocity()
BT_DECLARE_ALIGNED_ALLOCATOR()
btVector3 m_deltaAngularVelocity
btVector3 m_linearVelocity
void getVelocityInLocalPointNoDelta(const btVector3 &rel_pos, btVector3 &velocity) const
const btVector3 & getDeltaAngularVelocity() const
btTransform m_worldTransform
btVector3 & internalGetPushVelocity()
const btVector3 & internalGetAngularFactor() const
void writebackVelocityAndTransform(btScalar timeStep, btScalar splitImpulseTurnErp)
btVector3 & internalGetDeltaLinearVelocity()
some internal methods, don't use them
void internalSetInvMass(const btVector3 &invMass)
btVector3 m_angularFactor
void internalApplyImpulse(const btVector3 &linearComponent, const btVector3 &angularComponent, const btScalar impulseMagnitude)
void internalGetAngularVelocity(btVector3 &angVel) const
btVector3 m_externalTorqueImpulse
void internalGetVelocityInLocalPointObsolete(const btVector3 &rel_pos, btVector3 &velocity) const
const btTransform & getWorldTransform() const
void applyImpulse(const btVector3 &linearComponent, const btVector3 &angularComponent, const btScalar impulseMagnitude)
void getVelocityInLocalPointObsolete(const btVector3 &rel_pos, btVector3 &velocity) const
const btVector3 & internalGetInvMass() const
btVector3 m_externalForceImpulse