Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

OpenCAL::PhysicsSystem Class Reference

#include <PhysicsSystem.h>

Inheritance diagram for OpenCAL::PhysicsSystem:

Inheritance graph
[legend]
Collaboration diagram for OpenCAL::PhysicsSystem:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 PhysicsSystem (System *parent)
PhysicalObjectgetPhysicalObject (unsigned int i)
virtual ForcegetForce (unsigned int i)
virtual ConstraintgetConstraint (unsigned int i)
float getMaxStepSize () const
void setMaxStepSize (float stepSize)
 <
void addForce (const Vector3 &force)
void resetForces ()
virtual void step (float deltaSeconds)
virtual void fillState ()
virtual void fillDerivative ()
virtual void fromState ()
virtual void initialize ()

Protected Attributes

ODESolverm_solver
float m_maxStepSize

Detailed Description

This system contains physical objects, controlled by forces and constraints. Each step, after applying the forces and constraints, the system is integrated to calculate the motion of the objects.

Definition at line 40 of file PhysicsSystem.h.


Member Function Documentation

void PhysicsSystem::fillDerivative  )  [virtual]
 

Todo:
Is there a way to do this without clearing and reallocating memory?

result += m_objects[i]->getState();

Implements OpenCAL::ODESource.

Definition at line 123 of file PhysicsSystem.cpp.

References OpenCAL::PhysicalObject::addToDerivative(), and OpenCAL::PhaseSpace::clear().

Here is the call graph for this function:

void PhysicsSystem::fillState  )  [virtual]
 

Todo:
The size of the vector should be the same every time, so we could use m_state.clear(m_state.size())

result += m_objects[i]->getState();

Implements OpenCAL::ODESource.

Definition at line 102 of file PhysicsSystem.cpp.

References OpenCAL::PhysicalObject::addToState(), and OpenCAL::PhaseSpace::clear().

Here is the call graph for this function:

virtual Constraint* OpenCAL::PhysicsSystem::getConstraint unsigned int  i  )  [inline, virtual]
 

Todo:
virtual const Constraint *getConstraint(unsigned int i) const;
Definition at line 69 of file PhysicsSystem.h.

virtual Force* OpenCAL::PhysicsSystem::getForce unsigned int  i  )  [inline, virtual]
 

Todo:
virtual const Force *getForce(unsigned int i) const;
Definition at line 67 of file PhysicsSystem.h.

PhysicalObject* OpenCAL::PhysicsSystem::getPhysicalObject unsigned int  i  )  [inline]
 

Todo:
virtual const PhysicalObject *getPhysicalObject(unsigned int i) const;
Definition at line 65 of file PhysicsSystem.h.

void PhysicsSystem::initialize  )  [virtual]
 

Reimplemented from OpenCAL::System.

Definition at line 262 of file PhysicsSystem.cpp.

References OpenCAL::System::initialize().

Here is the call graph for this function:

void OpenCAL::PhysicsSystem::setMaxStepSize float  stepSize  )  [inline]
 

<

Todo:
void setSolver(...);
Definition at line 76 of file PhysicsSystem.h.


The documentation for this class was generated from the following files:
Generated on Sun Aug 15 19:19:33 2004 for OpenCAL: Open Computer Animation Library by doxygen 1.3.8