Physics don't get much higher-level than this. More...
#include "physicsManager.h"
Public Types | |
typedef pvector< PT(AngularForce)> | AngularForceVector |
typedef pvector< PT(LinearForce)> | LinearForceVector |
typedef pvector< Physical * > | PhysicalsVector |
Public Member Functions | |
PhysicsManager () | |
Default Constructor. More... | |
virtual | ~PhysicsManager () |
Simple Destructor. More... | |
void | add_angular_force (AngularForce *f) |
Adds a global angular force to the physics manager. More... | |
void | add_linear_force (LinearForce *f) |
Adds a global linear force to the physics manager. More... | |
void | attach_angular_integrator (AngularIntegrator *i) |
Hooks an angular integrator into the manager. More... | |
void | attach_linear_integrator (LinearIntegrator *i) |
Hooks a linear integrator into the manager. More... | |
void | attach_physical (Physical *p) |
Registers a Physical class with the manager. More... | |
void | attach_physical_node (PhysicalNode *p) |
Registers a physicalnode with the manager. More... | |
void | attach_physicalnode (PhysicalNode *p) |
Please call attach_physical_node instead. More... | |
void | clear_angular_forces () |
Resets the physics manager force vector. More... | |
void | clear_linear_forces () |
Resets the physics manager force vector. More... | |
void | clear_physicals () |
Resets the physics manager objects vector. More... | |
virtual void | debug_output (std::ostream &out, int indent=0) const |
Write a string representation of this instance to <out>. More... | |
void | do_physics (PN_stdfloat dt) |
This is the main high-level API call. More... | |
void | do_physics (PN_stdfloat dt, Physical *p) |
This is the main high-level API call. More... | |
PN_stdfloat | get_viscosity () const |
Get the global viscosity. More... | |
void | init_random_seed () |
One-time config function, sets up the random seed used by the physics and particle systems. More... | |
virtual void | output (std::ostream &out) const |
Write a string representation of this instance to <out>. More... | |
void | remove_angular_force (AngularForce *f) |
takes an angular force out of the physics list More... | |
void | remove_linear_force (LinearForce *f) |
takes a linear force out of the physics list More... | |
void | remove_physical (Physical *p) |
takes a physical out of the object list More... | |
void | remove_physical_node (PhysicalNode *p) |
Removes a physicalnode from the manager. More... | |
void | set_viscosity (PN_stdfloat viscosity) |
Set the global viscosity. More... | |
virtual void | write (std::ostream &out, int indent=0) const |
Write a string representation of this instance to <out>. More... | |
virtual void | write_angular_forces (std::ostream &out, int indent=0) const |
Write a string representation of this instance to <out>. More... | |
virtual void | write_linear_forces (std::ostream &out, int indent=0) const |
Write a string representation of this instance to <out>. More... | |
virtual void | write_physicals (std::ostream &out, int indent=0) const |
Write a string representation of this instance to <out>. More... | |
Static Public Attributes | |
static ConfigVariableInt | _random_seed |
Friends | |
class | Physical |
Physics don't get much higher-level than this.
Attach as many Physicals (particle systems, etc..) as you want, pick an integrator and go.
Definition at line 36 of file physicsManager.h.
PhysicsManager::PhysicsManager | ( | ) |
Default Constructor.
NOTE: EulerIntegrator is the standard default.
Definition at line 29 of file physicsManager.cxx.
|
virtual |
Simple Destructor.
Definition at line 39 of file physicsManager.cxx.
|
inline |
Adds a global angular force to the physics manager.
Definition at line 77 of file physicsManager.I.
|
inline |
Adds a global linear force to the physics manager.
Definition at line 32 of file physicsManager.I.
|
inline |
Hooks an angular integrator into the manager.
Definition at line 131 of file physicsManager.I.
|
inline |
Hooks a linear integrator into the manager.
Definition at line 122 of file physicsManager.I.
|
inline |
Registers a Physical class with the manager.
Definition at line 18 of file physicsManager.I.
|
inline |
Registers a physicalnode with the manager.
Definition at line 58 of file physicsManager.I.
Referenced by attach_physicalnode().
|
inline |
Please call attach_physical_node instead.
Definition at line 46 of file physicsManager.I.
References attach_physical_node().
|
inline |
Resets the physics manager force vector.
Definition at line 90 of file physicsManager.I.
|
inline |
Resets the physics manager force vector.
Definition at line 69 of file physicsManager.I.
|
inline |
Resets the physics manager objects vector.
Definition at line 98 of file physicsManager.I.
|
virtual |
Write a string representation of this instance to <out>.
Definition at line 273 of file physicsManager.cxx.
References indent().
void PhysicsManager::do_physics | ( | PN_stdfloat | dt | ) |
This is the main high-level API call.
Performs integration on every attached Physical.
Definition at line 125 of file physicsManager.cxx.
void PhysicsManager::do_physics | ( | PN_stdfloat | dt, |
Physical * | physical | ||
) |
This is the main high-level API call.
Performs integration on a single physical. Make sure its associated forces are active.
Definition at line 156 of file physicsManager.cxx.
|
inline |
Get the global viscosity.
Definition at line 114 of file physicsManager.I.
void PhysicsManager::init_random_seed | ( | ) |
One-time config function, sets up the random seed used by the physics and particle systems.
For synchronizing across distributed computers
Definition at line 52 of file physicsManager.cxx.
|
virtual |
Write a string representation of this instance to <out>.
Definition at line 181 of file physicsManager.cxx.
void PhysicsManager::remove_angular_force | ( | AngularForce * | f | ) |
takes an angular force out of the physics list
Definition at line 79 of file physicsManager.cxx.
void PhysicsManager::remove_linear_force | ( | LinearForce * | f | ) |
takes a linear force out of the physics list
Definition at line 62 of file physicsManager.cxx.
void PhysicsManager::remove_physical | ( | Physical * | p | ) |
takes a physical out of the object list
Definition at line 96 of file physicsManager.cxx.
Referenced by Physical::~Physical().
void PhysicsManager::remove_physical_node | ( | PhysicalNode * | p | ) |
Removes a physicalnode from the manager.
Definition at line 113 of file physicsManager.cxx.
|
inline |
Set the global viscosity.
Definition at line 106 of file physicsManager.I.
|
virtual |
Write a string representation of this instance to <out>.
Definition at line 243 of file physicsManager.cxx.
References indent(), write_angular_forces(), write_linear_forces(), and write_physicals().
|
virtual |
Write a string representation of this instance to <out>.
Definition at line 227 of file physicsManager.cxx.
References indent().
Referenced by write().
|
virtual |
Write a string representation of this instance to <out>.
Definition at line 211 of file physicsManager.cxx.
References indent().
Referenced by write().
|
virtual |
Write a string representation of this instance to <out>.
Definition at line 191 of file physicsManager.cxx.
References indent().
Referenced by write().