Jamie Slowgrove - OOT Assignment 1 - A Mission in Afghanistan
 All Classes Namespaces Files Functions Variables Macros
Classes | Public Member Functions | Protected Attributes | List of all members
GamePhysics Class Reference

A class for the GamePhysics. More...

#include <GamePhysics.h>

Inheritance diagram for GamePhysics:
Inheritance graph
Collaboration diagram for GamePhysics:
Collaboration graph

Classes

struct  ProjectileObject
 

Public Member Functions

 GamePhysics ()
 
 ~GamePhysics ()
 
void updateProjectile (float dt)
 
Ogre::Vector3 getProjectileDisplacement ()
 
Ogre::Real getVfromUAT (Ogre::Real u, Ogre::Real a, Ogre::Real t)
 
Ogre::Real getSfromUAT (Ogre::Real u, Ogre::Real a, Ogre::Real t)
 
Ogre::Real getSfromUVT (Ogre::Real u, Ogre::Real v, Ogre::Real t)
 
Ogre::Real getVSquaredfromUAS (Ogre::Real u, Ogre::Real a, Ogre::Real s)
 
Ogre::Real getSfromVAT (Ogre::Real v, Ogre::Real a, Ogre::Real t)
 
bool collisionTest (Ogre::Vector3 position, Ogre::Vector3 testPosition)
 

Protected Attributes

std::shared_ptr< ProjectileObjectprojectile
 

Detailed Description

A class for the GamePhysics.

Author
Jamie Slowgrove

Constructor & Destructor Documentation

GamePhysics::GamePhysics ( )

Constructs the GamePhysics.

GamePhysics::~GamePhysics ( )

Destructs the GamePhysics object.

Member Function Documentation

bool GamePhysics::collisionTest ( Ogre::Vector3  position,
Ogre::Vector3  testPosition 
)

Test if there is a collision.

Parameters
Ogre::Vector3The position.
Ogre::Vector3The test position.
Ogre::Vector3 GamePhysics::getProjectileDisplacement ( )

Getter # Gets the displacement of the Helicopter.

Returns
Ogre::Vector3 The displacement of the Helicopter.

Here is the caller graph for this function:

Ogre::Real GamePhysics::getSfromUAT ( Ogre::Real  u,
Ogre::Real  a,
Ogre::Real  t 
)

SUVAT equation s=ut+(1/2)a(t^2). Works out the displacement from the initial velocity, the acceleration and the time.

Parameters
Ogre::RealThe initial velocity.
Ogre::RealThe acceleration.
Ogre::RealThe time.
Returns
Ogre::Real The displacement.
Ogre::Real GamePhysics::getSfromUVT ( Ogre::Real  u,
Ogre::Real  v,
Ogre::Real  t 
)

SUVAT equation s=(1/2)(u+v)t. Works out the displacement from the initial velocity, the displacement and the time.

Parameters
Ogre::RealThe initial velocity.
Ogre::RealThe displacement.
Ogre::RealThe time.
Returns
Ogre::Real The displacement.
Ogre::Real GamePhysics::getSfromVAT ( Ogre::Real  v,
Ogre::Real  a,
Ogre::Real  t 
)

SUVAT equation s=vt-(1/2)a(t^2). Works out the displacement from the velocity, the acceleration and the time.

Parameters
Ogre::RealThe velocity.
Ogre::RealThe acceleration.
Ogre::RealThe time.
Returns
Ogre::Real The displacement.

Here is the caller graph for this function:

Ogre::Real GamePhysics::getVfromUAT ( Ogre::Real  u,
Ogre::Real  a,
Ogre::Real  t 
)

SUVAT equation v=u+at. Works out the velocity from the initial velocity, the acceleration and the time.

Parameters
Ogre::RealThe initial velocity.
Ogre::RealThe acceleration.
Ogre::RealThe time.
Returns
Ogre::Real The velocity.

Here is the caller graph for this function:

Ogre::Real GamePhysics::getVSquaredfromUAS ( Ogre::Real  u,
Ogre::Real  a,
Ogre::Real  s 
)

SUVAT equation v^2=u^2+2as. Works out the velocity squared from the initial velocity, the acceleration and the displacement.

Parameters
Ogre::RealThe initial velocity.
Ogre::RealThe acceleration.
Ogre::RealThe displacement.
Returns
Ogre::Real The velocity squared.
void GamePhysics::updateProjectile ( float  dt)

Updates the projectile.

Parameters
floatThe delta time.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

std::shared_ptr<ProjectileObject> GamePhysics::projectile
protected

The projectile object


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