GEJM  1.0.0.0
a 2D platformer made by students
Public Member Functions | List of all members
Physics Class Reference

#include <Physics.h>

Public Member Functions

 Physics (int boundaryWidth, int boundaryHeight)
 
 Physics (Physics const &)=delete
 
 ~Physics ()
 
double update (std::list< Object * > &objectList)
 
Physicsoperator= (Physics const &)=delete
 

Detailed Description

Physics is a class that is responsible for simulating physics.

Constructor & Destructor Documentation

Physics::Physics ( int  boundaryWidth,
int  boundaryHeight 
)

Default constructor of Physics. Sets currentTime, t, dt, accumulator and boundaries of physical simulation.

Parameters
boundaryWidthwidth of bounding box in which physical simulation is simulated
boundaryHeightheight of bounding box in which physical simulation is simulated

Physics implementation Default constructor of Physics. Sets currentTime, t, dt, accumulator and boundaries of physical simulation.

Parameters
boundaryWidthwidth of bounding box in which physical simulation is simulated
boundaryHeightheight of bounding box in which physical simulation is simulated
Physics::Physics ( Physics const &  )
delete

Copy constructor is deleted because it shouldn't be ever used.

Physics::~Physics ( )

Default destructor.

Member Function Documentation

Physics& Physics::operator= ( Physics const &  )
delete

Assigment operator is overloaded because it cannot be generated by compiler but because it shouldn't be used it's deleted.

double Physics::update ( std::list< Object * > &  objectList)

Calculate next steps of simulation.

Parameters
objectListreference to a list of all game objects
Returns
double because physical simulation is calculated in fixed steps, function returns coefficient of game state between steps, where 0 is previous step and 1 is current step

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