16 #ifndef BT_SOLVER_BODY_H
17 #define BT_SOLVER_BODY_H
42 :m_vec128 (_mm_set1_ps(fl))
92 return btSimdScalar(_mm_mul_ps(v1.get128(),v2.get128()));
99 return btSimdScalar(_mm_add_ps(v1.get128(),v2.get128()));
104 #define btSimdScalar btScalar
127 m_worldTransform = worldTransform;
132 return m_worldTransform;
140 velocity = m_linearVelocity + m_externalForceImpulse + (m_angularVelocity+m_externalTorqueImpulse).
cross(rel_pos);
149 velocity = m_linearVelocity+m_deltaLinearVelocity + (m_angularVelocity+m_deltaAngularVelocity).
cross(rel_pos);
157 angVel =m_angularVelocity+m_deltaAngularVelocity;
168 m_deltaLinearVelocity += linearComponent*impulseMagnitude*m_linearFactor;
169 m_deltaAngularVelocity += angularComponent*(impulseMagnitude*m_angularFactor);
177 m_pushVelocity += linearComponent*impulseMagnitude*m_linearFactor;
178 m_turnVelocity += angularComponent*(impulseMagnitude*m_angularFactor);
186 return m_deltaLinearVelocity;
191 return m_deltaAngularVelocity;
196 return m_pushVelocity;
201 return m_turnVelocity;
210 return m_deltaLinearVelocity;
215 return m_deltaAngularVelocity;
220 return m_angularFactor;
235 return m_pushVelocity;
240 return m_turnVelocity;
245 velocity = m_linearVelocity+m_deltaLinearVelocity + (m_angularVelocity+m_deltaAngularVelocity).
cross(rel_pos);
250 angVel = m_angularVelocity+m_deltaAngularVelocity;
259 m_deltaLinearVelocity += linearComponent*impulseMagnitude*m_linearFactor;
260 m_deltaAngularVelocity += angularComponent*(impulseMagnitude*m_angularFactor);
271 m_linearVelocity +=m_deltaLinearVelocity;
272 m_angularVelocity += m_deltaAngularVelocity;
284 m_linearVelocity += m_deltaLinearVelocity;
285 m_angularVelocity += m_deltaAngularVelocity;
289 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)
293 m_worldTransform = newTransform;
304 #endif //BT_SOLVER_BODY_H
btVector3 m_linearVelocity
btVector3 m_angularVelocity
float4 operator*(const float4 &a, float fact)
void getAngularVelocity(btVector3 &angVel) const
void setValue(const btScalar &_x, const btScalar &_y, const btScalar &_z)
const btVector3 & getPushVelocity() const
void internalApplyImpulse(const btVector3 &linearComponent, const btVector3 &angularComponent, const btScalar impulseMagnitude)
void internalGetVelocityInLocalPointObsolete(const btVector3 &rel_pos, btVector3 &velocity) const
void writebackVelocityAndTransform(btScalar timeStep, btScalar splitImpulseTurnErp)
#define SIMD_FORCE_INLINE
void getVelocityInLocalPointNoDelta(const btVector3 &rel_pos, btVector3 &velocity) const
void internalGetAngularVelocity(btVector3 &angVel) const
btVector3 m_externalTorqueImpulse
btVector3 m_externalForceImpulse
btVector3 & internalGetTurnVelocity()
#define btSimdScalar
Until we get other contributions, only use SIMD on Windows, when using Visual Studio 2008 or later...
void internalSetInvMass(const btVector3 &invMass)
const btVector3 & getDeltaLinearVelocity() const
int3 operator+(int3 a, int3 b)
btVector3 m_angularFactor
The btRigidBody is the main class for rigid body objects.
void getVelocityInLocalPointObsolete(const btVector3 &rel_pos, btVector3 &velocity) const
btVector3 m_deltaLinearVelocity
void applyImpulse(const btVector3 &linearComponent, const btVector3 &angularComponent, const btScalar impulseMagnitude)
const btVector3 & internalGetInvMass() const
const btVector3 & getDeltaAngularVelocity() const
btVector3 can be used to represent 3D points and vectors.
#define ATTRIBUTE_ALIGNED16(a)
void setWorldTransform(const btTransform &worldTransform)
The btSolverBody is an internal datastructure for the constraint solver. Only necessary data is packe...
btRigidBody * m_originalBody
void internalApplyPushImpulse(const btVector3 &linearComponent, const btVector3 &angularComponent, btScalar impulseMagnitude)
btVector3 & internalGetDeltaLinearVelocity()
some internal methods, don't use them
const btVector3 & getTurnVelocity() const
static float4 cross(const float4 &a, const float4 &b)
#define BT_DECLARE_ALIGNED_ALLOCATOR()
const btVector3 & internalGetAngularFactor() const
btVector3 & internalGetPushVelocity()
const btTransform & getWorldTransform() const
btVector3 & internalGetDeltaAngularVelocity()
btVector3 m_deltaAngularVelocity
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
btTransform m_worldTransform