136
145
void setOrientation(const MT_Quaternion& orn);
137
146
void setScaling(const MT_Vector3& scaling);
141
149
* set an external velocity. This velocity complements
142
150
* the physics velocity. So setting it does not override the
257
void *getClientObject() { return m_client_object; }
258
void setClientObject(void *client_object) { m_client_object = client_object; }
265
SM_ClientObject *getClientObject() { return m_client_object; }
266
void setClientObject(SM_ClientObject *client_object) { m_client_object = client_object; }
267
void setPhysicsClientObject(void* physicsClientObject)
269
m_physicsClientObject = physicsClientObject;
271
void* getPhysicsClientObject() {
272
return m_physicsClientObject;
263
m_pos = m_prev_state.getPosition();
264
m_orn = m_prev_state.getOrientation();
265
m_xform = m_prev_xform;
276
SM_MotionState &getCurrentFrame();
277
SM_MotionState &getPreviousFrame();
278
SM_MotionState &getNextFrame();
280
const SM_MotionState &getCurrentFrame() const;
281
const SM_MotionState &getPreviousFrame() const;
282
const SM_MotionState &getNextFrame() const;
284
// Motion state functions
285
const MT_Point3& getPosition() const;
286
const MT_Quaternion& getOrientation() const;
287
const MT_Vector3& getLinearVelocity() const;
288
const MT_Vector3& getAngularVelocity() const;
290
MT_Scalar getTime() const;
292
void setTime(MT_Scalar time);
294
void interpolate(MT_Scalar timeStep);
298
friend class Contact;
300
static MT_Scalar ImpulseThreshold;
269
302
// return the actual linear_velocity of this object this
270
303
// is the addition of m_combined_lin_vel and m_lin_vel.
297
330
// as the collision callback now has only information
298
331
// on an SM_Object, there must be a way that the SM_Object client
299
332
// can identify it's clientdata after a collision
300
void *m_client_object;
333
SM_ClientObject *m_client_object;
335
void* m_physicsClientObject;
302
337
DT_ShapeHandle m_shape; // Shape for collision detection
320
355
MT_Vector3 m_reaction_impulse; // The accumulated impulse resulting from collisions
321
356
MT_Vector3 m_reaction_force; // The reaction force derived from the reaction impulse
323
unsigned int m_kinematic : 1; // Have I been displaced (translated, rotated, scaled) in this frame?
324
unsigned int m_prev_kinematic : 1; // Have I been displaced (translated, rotated, scaled) in the previous frame?
325
unsigned int m_is_rigid_body : 1; // Should friction give me a change in angular momentum?
327
358
MT_Vector3 m_lin_mom; // Linear momentum (linear velocity times mass)
328
359
MT_Vector3 m_ang_mom; // Angular momentum (angualr velocity times inertia)
329
360
MT_Vector3 m_force; // Force on center of mass (afffects linear momentum)
330
MT_Vector3 m_torque; // Torque around center of mass (affects angualr momentum)
361
MT_Vector3 m_torque; // Torque around center of mass (affects angular momentum)
363
SM_MotionState m_frames[3];
332
365
MT_Vector3 m_error; // Error in position:- amount object must be moved to prevent intersection with scene
351
384
MT_Scalar m_inv_mass; // 1/mass
352
385
MT_Vector3 m_inv_inertia; // [1/inertia_x, 1/inertia_y, 1/inertia_z]
353
386
MT_Matrix3x3 m_inv_inertia_tensor; // Inverse Inertia Tensor
388
bool m_kinematic; // Have I been displaced (translated, rotated, scaled) in this frame?
389
bool m_prev_kinematic; // Have I been displaced (translated, rotated, scaled) in the previous frame?
390
bool m_is_rigid_body; // Should friction give me a change in angular momentum?
391
int m_static; // temporarily static.