Changes

Jump to: navigation, search

Team Guardian Physics

2,080 bytes added, 21:50, 12 April 2011
Functions
By 'northWind'
 
[[Team_Guardian|Back to Team Guardian's Page]]
== Downloads ==
==== CollisionGeometry and RigidBody ====
A collision geometry uses a RigidBody for location, rotation and velocity inforomation. When implementing the iRigidBody interface, it is crucial that <code>getRBDynamics()</code> return a an up to date RBDynamics structrepresentation of the object's state in the world. At minimum, the following properties should be consistent with the actual real-time attributes of the object:
<pre>
Vector position : Current position of COM
Vector com : Center of Mass offset.
PhysicsType physicsType : Type of physics applied to body, defaults to Falling (BUGGY, use PHYS_Falling and PHYS_Floating for now)
Matrix orientation : Matrix representing rotation in XYZ
</pre>
Please A couple of notes:; PhysicsType physicsType : Always return PHYS_Falling or PHYS_Floating. The collision space will filter out collisions between PHYS_FixedInSpace objects to avoid unnecessary collision checks.; Matrix orientation : Ensure that the rotation matrix has not been contaminated with any scale information, otherwise the collision tests may not return correct results. Oh, this might also be a good time to note that scaling is '''not supported''' by the physics simulator or the collision detector :) Having said that, this should be enough to get your objects up and colliding. To detect all collisions at a given time in the world, call <code>populateContactList()</code> on the collision space. Retrieve the list of collisions by calling <code>getContactList()</code>; to find the number of contacts in the world, call <code>getNumContacts()</code>. For more/misc information, see the [[Team_Guardian_Physics#RigidBody |RigidBody referenceReference]] and the [[Team_Guardian_Physics#CollisionSpace |CollisionSpace Reference]] for behaviour that is expected from a RigidBody.
== Framework Reference ==
=== Functions ===
; Vector getWorldCOM() const : '''REMOVED IN NEXT UPDATE''' Returns the world position of the COM with respect to this body.
; Vector getVelocityAtWorldPoint(const Vector& p) const : Given a point in worldspace, returns its speed taking into account velocity and angular velocity.
; Void setInverseInertiaTensor(const Matrix& i) : Sets the inverse inertia tensor of this body. Automatically sets the inertia tensor as well by inversing the incoming matrix. DOES NOT NEED TO BE CALLED AFTER CALLING setInertiaTensor()
; Matrix& getInverseInertiaTensor() : Returns the inertia tensor or inverse inertia tensor contained by this object.
; Void ApplyImpulse(const Vector& impulse, const Vector& pointOfApplication) : Applies a given impulse instantaneously onto this object at a given world point of application. Can be used to shoot or prod objects.
 
==== Functions Coming In Next Update ====
; void attachTo(RBDynamics* p) : Attaches this RBD to a given RBD. It is not required to call this function after calling PhysicsFrame's AttachTo(PhysicsFrame*) if the RBD resides within the RB of the PhysicsFrame.
; RBDynamics* attachedTo() const : Returns the RBD this RBD is attached to or NULL.
; RBDynamics* attachmentRoot() const : Returns the root of the attachment chain of this RBD.
; float getMass() const : Returns the mass of the RBD at the root of the attachment chain.
; Vector getWorldPosition() const : Returns the world-space position of this body's COM taking into account parent position/orientation.
; Matrix getWorldOrientation() const : Returns the world-space orientation of this body taking into account parent orientation.
== Other Topics Reference ==

Navigation menu