PhysicsJoint Class Reference

Base class for representing physics objects. More...

#include <Physics/PhysicsJoint.h>

Inherited by PhysicsDistanceJoint.

List of all members.

Public Member Functions

 PhysicsJoint ()
 Constructor.
virtual ~PhysicsJoint ()
 Deconstructor.
void Attach1 (PhysicsObject *obj)
 Attaches an object to the joint.
void Attach2 (PhysicsObject *obj)
 Attaches an object to the joint.
PhysicsObject * GetAttached1 () const
 Gets the first object attached to the joint.
PhysicsObject * GetAttached2 () const
 Gets the second object attached to the joint.
void EnableCollisions (bool yn)
 Enables/Disable the ability for attached objects to collide. Defaults to deisabled.
bool AreCollisionsAllowed () const
 Determines if attached objects are allowed to collide.
bool CreateJoint (PhysicsWorld *w)
 Creates the actual physics joint. NOTE: Call this function once the joint is setup.
PhysicsWorld * GetWorld () const
 Gets the pointer to the physics world the joint belongs to.
b2Joint * GetBox2DJoint () const
 Gets the pointer to the Box2D joint.

Protected Member Functions

bool IsJointValid () const
 Determines if the joint has been created.
void DestroyJoint ()
 Frees the resources associated with the joints.
virtual b2Joint * CreateBox2DJoint ()=0
 Creates the actual Box2D physics joint.

Detailed Description

Base class for representing physics objects.


Member Function Documentation

bool PhysicsJoint::AreCollisionsAllowed (  )  const

Determines if attached objects are allowed to collide.

Returns:
true if the attached objects can collide, false otherwise.
void PhysicsJoint::Attach1 ( PhysicsObject *  obj  ) 

Attaches an object to the joint.

Parameters:
[in] obj the object to attach to the joint.
void PhysicsJoint::Attach2 ( PhysicsObject *  obj  ) 

Attaches an object to the joint.

Parameters:
[in] obj the object to attach to the joint.
virtual b2Joint* PhysicsJoint::CreateBox2DJoint (  )  [protected, pure virtual]

Creates the actual Box2D physics joint.

Parameters:
[in] world the physics world to create the joint in.
Returns:
a pointer to the created joint or NULL if the joint could not be created.

NOTE: This function should be implemented by each joint class.

Implemented in PhysicsDistanceJoint.

bool PhysicsJoint::CreateJoint ( PhysicsWorld *  w  ) 

Creates the actual physics joint. NOTE: Call this function once the joint is setup.

Parameters:
[in] w the physics world to create the joint in.
Returns:
true if the joint was create, false otherwise.
void PhysicsJoint::EnableCollisions ( bool  yn  ) 

Enables/Disable the ability for attached objects to collide. Defaults to deisabled.

Parameters:
[in] yn set to true to enable collisions or false to disable collisions.
PhysicsObject * PhysicsJoint::GetAttached1 (  )  const

Gets the first object attached to the joint.

Returns:
the first object attached to the joint, or NULL if there is no attachment.
PhysicsObject * PhysicsJoint::GetAttached2 (  )  const

Gets the second object attached to the joint.

Returns:
the first object attached to the joint, or NULL if there is no attachment.
b2Joint * PhysicsJoint::GetBox2DJoint (  )  const

Gets the pointer to the Box2D joint.

Returns:
the Box2d joint.
PhysicsWorld * PhysicsJoint::GetWorld (  )  const

Gets the pointer to the physics world the joint belongs to.

Returns:
the physics world.
bool PhysicsJoint::IsJointValid (  )  const [protected]

Determines if the joint has been created.

Returns:
true if the joint has been created, false otherwise.

The documentation for this class was generated from the following files:
Generated on Mon Apr 5 19:08:06 2010 for BrickOut |ReDuX| by  doxygen 1.6.3