DubiousEngine  0.2.0
Simple Game Engine
Dubious::Physics::Physics_object Class Reference

A Physics Object. More...

#include <Physics_object.h>

Public Member Functions

 Physics_object (const std::shared_ptr< Physics_model > &model, float mass)
 Constructor. More...
 
 Physics_object (const Physics_object &)=delete
 
Physics_objectoperator= (const Physics_object &)=delete
 
const Physics_modelmodel () const
 Model Accessor. More...
 
Math::Coordinate_spacecoordinate_space ()
 Accessor. More...
 
const Math::Coordinate_spacecoordinate_space () const
 
float inverse_mass () const
 
const Math::Vectorvelocity () const
 
Math::Vectorvelocity ()
 
const Math::Vectorforce () const
 
Math::Vectorforce ()
 
float inverse_moment_of_inertia () const
 
const Math::Vectorangular_velocity () const
 
Math::Vectorangular_velocity ()
 
const Math::Vectortorque () const
 
Math::Vectortorque ()
 

Static Public Attributes

static const float STATIONARY = -1
 

Detailed Description

A Physics Object.

The actual object that will be used in collision detection/response. This one holds things like forces, velocities, etc. It's the basic representation of something in Physics

Constructor & Destructor Documentation

Dubious::Physics::Physics_object::Physics_object ( const std::shared_ptr< Physics_model > &  model,
float  mass 
)

Constructor.

Dubious::Physics::Physics_object::Physics_object ( const Physics_object )
delete

Member Function Documentation

const Math::Vector& Dubious::Physics::Physics_object::angular_velocity ( ) const
inline
Math::Vector& Dubious::Physics::Physics_object::angular_velocity ( )
inline
Math::Coordinate_space& Dubious::Physics::Physics_object::coordinate_space ( )
inline

Accessor.

const Math::Coordinate_space& Dubious::Physics::Physics_object::coordinate_space ( ) const
inline
const Math::Vector& Dubious::Physics::Physics_object::force ( ) const
inline
Math::Vector& Dubious::Physics::Physics_object::force ( )
inline
float Dubious::Physics::Physics_object::inverse_mass ( ) const
inline
float Dubious::Physics::Physics_object::inverse_moment_of_inertia ( ) const
inline
const Physics_model& Dubious::Physics::Physics_object::model ( ) const
inline

Model Accessor.

This function is used during broadphase collision detection to get the radius. As such it's called a LOT. In a simple, single threaded test when this returns a std::shared_ptr<Physics_model> the test ran in 2.4 seconds. When changed to a const reference it ran in 0.76 seconds. Do not change this without serious profiling

Returns
the physics model
Physics_object& Dubious::Physics::Physics_object::operator= ( const Physics_object )
delete
const Math::Vector& Dubious::Physics::Physics_object::torque ( ) const
inline
Math::Vector& Dubious::Physics::Physics_object::torque ( )
inline
const Math::Vector& Dubious::Physics::Physics_object::velocity ( ) const
inline
Math::Vector& Dubious::Physics::Physics_object::velocity ( )
inline

Member Data Documentation

const float Dubious::Physics::Physics_object::STATIONARY = -1
static

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