Ult3D
Implementation of "Ultimate 3D Game Engine Design & Architecture" by Allan Sherrod
Loading...
Searching...
No Matches
Ult::PhysicsObject Class Referenceabstract

#include <PhysicsObject.h>

Inheritance diagram for Ult::PhysicsObject:
Ult::PointMass Ult::SpringMass

Public Member Functions

 PhysicsObject ()
 
virtual ~PhysicsObject ()
 
virtual void Update (float dt)=0
 
virtual float GetDragArea ()=0
 
virtual float GetDragCoefficient ()=0
 
virtual float GetLiftCoefficient ()=0
 
virtual float GetVolumeUnderHeight (float height)=0
 
virtual void SetMass (const float m)
 
virtual float GetMass () const
 
virtual float GetMassInv () const
 
virtual float GetVolume () const
 
virtual void SetLift (const float lVal, const Vector3D &lVec)
 
virtual float GetLift () const
 
virtual Vector3D GetLiftVec () const
 
virtual float GetSpeed () const
 
virtual Vector3D GetOldPosition () const
 
virtual void SetPosition (const Vector3D &pos)
 
virtual Vector3D GetPosition ()
 
virtual void SetForce (const Vector3D &f)
 
virtual Vector3D GetForce () const
 
virtual void AddForce (const Vector3D &f)
 
virtual void SetVelocity (const Vector3D &v)
 
virtual Vector3D GetVelocity () const
 
virtual void AddVelocity (const Vector3D &v)
 
virtual Vector3D GetAcceleration () const
 
virtual Matrix4x4 GetTransformation ()=0
 

Protected Attributes

float mMass
 
float mMassInv
 
float mVolume
 
float mLift
 
float mSpeed
 
Vector3D mOldPosition
 
Vector3D mPosition
 
Vector3D mForce
 
Vector3D mVelocity
 
Vector3D mAcceleration
 
Vector3D mLiftVector
 

Detailed Description

Base class for a body with mass, volume, acceleration, velocity, force, lift

Constructor & Destructor Documentation

◆ PhysicsObject()

Ult::PhysicsObject::PhysicsObject ( )
inline

PhysicsObject constructor

◆ ~PhysicsObject()

virtual Ult::PhysicsObject::~PhysicsObject ( )
inlinevirtual

PhysicsObject destructor

Member Function Documentation

◆ AddForce()

virtual void Ult::PhysicsObject::AddForce ( const Vector3D & f)
inlinevirtual

Adds the input force to the current object forces.

◆ AddVelocity()

virtual void Ult::PhysicsObject::AddVelocity ( const Vector3D & v)
inlinevirtual

Adds the input to the object's current velocity.

◆ GetAcceleration()

virtual Vector3D Ult::PhysicsObject::GetAcceleration ( ) const
inlinevirtual

Returns the object's current acceleration.

◆ GetDragArea()

virtual float Ult::PhysicsObject::GetDragArea ( )
pure virtual

Implementation specific drag area;

Implemented in Ult::PointMass.

◆ GetDragCoefficient()

virtual float Ult::PhysicsObject::GetDragCoefficient ( )
pure virtual

Implementation specificy drag coefficient.

Implemented in Ult::PointMass.

◆ GetForce()

virtual Vector3D Ult::PhysicsObject::GetForce ( ) const
inlinevirtual

Returns the current sum of object forces.

◆ GetLift()

virtual float Ult::PhysicsObject::GetLift ( ) const
inlinevirtual

Returns the object's lift.

◆ GetLiftCoefficient()

virtual float Ult::PhysicsObject::GetLiftCoefficient ( )
pure virtual

Implementation specific lift coefficient.

Implemented in Ult::PointMass.

◆ GetLiftVec()

virtual Vector3D Ult::PhysicsObject::GetLiftVec ( ) const
inlinevirtual

Returns the object's lift vector.

◆ GetMass()

virtual float Ult::PhysicsObject::GetMass ( ) const
inlinevirtual

Returns the object's mass

◆ GetMassInv()

virtual float Ult::PhysicsObject::GetMassInv ( ) const
inlinevirtual

Returns the object's inverse mass.

◆ GetOldPosition()

virtual Vector3D Ult::PhysicsObject::GetOldPosition ( ) const
inlinevirtual

Returns the object's position as of the previous Update.

◆ GetPosition()

virtual Vector3D Ult::PhysicsObject::GetPosition ( )
inlinevirtual

Returns the object's current position.

◆ GetSpeed()

virtual float Ult::PhysicsObject::GetSpeed ( ) const
inlinevirtual

Returns the object's speed.

◆ GetTransformation()

virtual Matrix4x4 Ult::PhysicsObject::GetTransformation ( )
pure virtual

Returns a transformation of the object's current position/rotation. Must be implemented by the inheriting class.

Implemented in Ult::PointMass.

◆ GetVelocity()

virtual Vector3D Ult::PhysicsObject::GetVelocity ( ) const
inlinevirtual

Returns the object's current velocity.

◆ GetVolume()

virtual float Ult::PhysicsObject::GetVolume ( ) const
inlinevirtual

Returns the object's volume.

◆ GetVolumeUnderHeight()

virtual float Ult::PhysicsObject::GetVolumeUnderHeight ( float height)
pure virtual

Implementation specific volume - for liquid/water simulation.

Implemented in Ult::PointMass.

◆ SetForce()

virtual void Ult::PhysicsObject::SetForce ( const Vector3D & f)
inlinevirtual

Sets the sum of forces on the the object.

◆ SetLift()

virtual void Ult::PhysicsObject::SetLift ( const float lVal,
const Vector3D & lVec )
inlinevirtual

Set the object's life and lift vector.

◆ SetMass()

virtual void Ult::PhysicsObject::SetMass ( const float m)
inlinevirtual

Set the object's mass and inverse mass. Assumes mass is not 0.

◆ SetPosition()

virtual void Ult::PhysicsObject::SetPosition ( const Vector3D & pos)
inlinevirtual

Sets the obect's current position.

◆ SetVelocity()

virtual void Ult::PhysicsObject::SetVelocity ( const Vector3D & v)
inlinevirtual

Sets the object's current velocity.

◆ Update()

virtual void Ult::PhysicsObject::Update ( float dt)
pure virtual

Update the object for the input delta time (in seconds). Must be implemented by the inheriting class.

Implemented in Ult::PointMass.

Member Data Documentation

◆ mAcceleration

Vector3D Ult::PhysicsObject::mAcceleration
protected

◆ mForce

Vector3D Ult::PhysicsObject::mForce
protected

◆ mLift

float Ult::PhysicsObject::mLift
protected

◆ mLiftVector

Vector3D Ult::PhysicsObject::mLiftVector
protected

◆ mMass

float Ult::PhysicsObject::mMass
protected

◆ mMassInv

float Ult::PhysicsObject::mMassInv
protected

◆ mOldPosition

Vector3D Ult::PhysicsObject::mOldPosition
protected

◆ mPosition

Vector3D Ult::PhysicsObject::mPosition
protected

◆ mSpeed

float Ult::PhysicsObject::mSpeed
protected

◆ mVelocity

Vector3D Ult::PhysicsObject::mVelocity
protected

◆ mVolume

float Ult::PhysicsObject::mVolume
protected

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