Engine
PhysicsEntity Class Reference

An entity subject to the laws of physics. More...

#include <physics_entity.h>

Inheritance diagram for PhysicsEntity:
RectangularPrism Sphere

Public Member Functions

GLint GetId () const
 
Vector3Gf GetPosition ()
 
void SetPosition (Vector3Gf x)
 
void SetNextPosition (Vector3Gf x)
 
Vector3Gf GetNextPosition ()
 
Vector3Gf GetVelocity ()
 
void SetVelocity (Vector3Gf v)
 
void SetNextVelocity (Vector3Gf v)
 
Vector3Gf GetNextVelocity ()
 
GLfloat GetMass ()
 
Quaternion GetOrientation ()
 
void SetOrientation (Quaternion q)
 
Quaternion GetNextOrientation ()
 
void SetNextOrientation (Quaternion q)
 
Vector3Gf GetAngularVelocity ()
 
void SetAngularVelocity (Vector3Gf w)
 
Vector3Gf GetNextAngularVelocity ()
 
void SetNextAngularVelocity (Vector3Gf w)
 
void UpdateFromBuffers ()
 

Protected Member Functions

 PhysicsEntity ()
 
 PhysicsEntity (Vector3Gf position, Vector3Gf velocity, GLfloat mass, Quaternion orientation, Vector3Gf angular_velocity)
 
virtual ~PhysicsEntity ()
 

Protected Attributes

GLuint m_id
 
Vector3Gf m_position
 
Vector3Gf m_next_position
 
Vector3Gf m_velocity
 
Vector3Gf m_next_velocity
 
GLfloat m_mass
 
Quaternion m_orientation
 
Quaternion m_next_orientation
 
Vector3Gf m_next_angular_velocity
 
Vector3Gf m_angular_velocity
 

Detailed Description

An entity subject to the laws of physics.

PhysicsEntity is a base class for all objects in a scene that respond to forces and other physical phenomenon

Constructor & Destructor Documentation

PhysicsEntity::PhysicsEntity ( )
protected

Creates an instance of PhysicsEntity centered at the origin, zero velocity, and unit mass

PhysicsEntity::PhysicsEntity ( Vector3Gf  position,
Vector3Gf  velocity,
GLfloat  mass,
Quaternion  orientation,
Vector3Gf  angular_velocity 
)
protected

Creates an instance of PhysicsEntity centered at the provided position with the provided velocity and mass

Parameters
positionposition of center of mass in world coordinates
velocityvelocity of the entity in world coordinates
massmass of the entity
orientationorientation of the entity
angular_velocityangular velocity of the entity
virtual PhysicsEntity::~PhysicsEntity ( )
inlineprotectedvirtual

Destructor for PhysicsEntity

Member Function Documentation

Vector3Gf PhysicsEntity::GetAngularVelocity ( )
Returns
the angular velocity for this entity
GLint PhysicsEntity::GetId ( ) const

Returns the unique id for this entity

GLfloat PhysicsEntity::GetMass ( )
Returns
Mass of this entity
Vector3Gf PhysicsEntity::GetNextAngularVelocity ( )

Gets the angular velocity for the next time step.

Quaternion PhysicsEntity::GetNextOrientation ( )

Gets the orientation for the next time step.

Vector3Gf PhysicsEntity::GetNextPosition ( )
Returns
position for next time step
Vector3Gf PhysicsEntity::GetNextVelocity ( )
Returns
velocity for next time step
Quaternion PhysicsEntity::GetOrientation ( )
Returns
the orientaiton for this entity
Vector3Gf PhysicsEntity::GetPosition ( )
Returns
Spatial position for this entity
Vector3Gf PhysicsEntity::GetVelocity ( )
Returns
Spatial velocity for this entity
void PhysicsEntity::SetAngularVelocity ( Vector3Gf  w)

Sets the angular velocity for the entity

Parameters
wnew angular velocity for this entity
void PhysicsEntity::SetNextAngularVelocity ( Vector3Gf  w)

Sets the next orientation for the entity. This DOES NOT update the angular velocity until UpdateFromBuffers() is called

Parameters
wnext angular velocity for this entity
void PhysicsEntity::SetNextOrientation ( Quaternion  q)

Sets the next orientation for the entity. This DOES NOT update the orientation until UpdateFromBuffers() is called

Parameters
qnext orientation for this entity
void PhysicsEntity::SetNextPosition ( Vector3Gf  x)

Sets the next position buffer for this entity. This DOES NOT update the position until UpdateFromBuffers() is called.

Parameters
xnew position for this entity
void PhysicsEntity::SetNextVelocity ( Vector3Gf  v)

Sets the next velocity buffer for the entity. This DOES NOT update the velocity until UpdateFromBuffers() is called.

Parameters
vNext velocity for this entity
void PhysicsEntity::SetOrientation ( Quaternion  q)

Sets the orientaiton for the entity

Parameters
qnew orientation for this entity
void PhysicsEntity::SetPosition ( Vector3Gf  x)

Sets the position for this entity. If possible use SetNextPosition instead

Parameters
xNext position for this entity
void PhysicsEntity::SetVelocity ( Vector3Gf  v)

Sets the velocity for this entity. If possible use SetNextPosition instead

Parameters
vnew velocity for this entity
void PhysicsEntity::UpdateFromBuffers ( )

Updates internal state from buffers. This will load the next position and velocity from their corresponding buffers

Member Data Documentation

Vector3Gf PhysicsEntity::m_angular_velocity
protected

The angular velocity of this entity

GLuint PhysicsEntity::m_id
protected

Unique id for this entity in world coordinates

GLfloat PhysicsEntity::m_mass
protected

The mass of this entity

Vector3Gf PhysicsEntity::m_next_angular_velocity
protected

the next predicted angular velocity in world coordinates

Quaternion PhysicsEntity::m_next_orientation
protected

The next predicted orientation of the entity in world coordinates

Vector3Gf PhysicsEntity::m_next_position
protected

The next predicted position of this entity in world coordinates.

Vector3Gf PhysicsEntity::m_next_velocity
protected

The next predicted velocity of this entity in world coordiantes

Quaternion PhysicsEntity::m_orientation
protected

The orientation of this entity

Vector3Gf PhysicsEntity::m_position
protected

The position of this entity in word coordinates

Vector3Gf PhysicsEntity::m_velocity
protected

The velocity of this entity in world coordinates


The documentation for this class was generated from the following files: