|
|
@@ -39,6 +39,18 @@
|
|
|
// as you want, pick an integrator and go.
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
class EXPCL_PANDAPHYSICS PhysicsManager {
|
|
|
+public:
|
|
|
+ // NOTE that the physicals container is NOT reference counted.
|
|
|
+ // this does indeed mean that you are NOT supposed to use this
|
|
|
+ // as a primary storage container for the physicals. This is so
|
|
|
+ // because physicals, on their death, ask to be removed from their
|
|
|
+ // current physicsmanager, if one exists, relieving the client from
|
|
|
+ // the task and also allowing for dynamically created and destroyed
|
|
|
+ // physicals.
|
|
|
+ typedef pvector<Physical *> PhysicalsVector;
|
|
|
+ typedef pvector<PT(LinearForce)> LinearForcesVector;
|
|
|
+ typedef pvector<PT(AngularForce)> AngularForcesVector;
|
|
|
+
|
|
|
PUBLISHED:
|
|
|
PhysicsManager();
|
|
|
virtual ~PhysicsManager();
|
|
|
@@ -53,8 +65,8 @@ PUBLISHED:
|
|
|
INLINE void clear_angular_forces();
|
|
|
INLINE void clear_physicals();
|
|
|
|
|
|
- //INLINE void set_viscosity(float viscosity);
|
|
|
- //float get_viscosity() const;
|
|
|
+ INLINE void set_viscosity(float viscosity);
|
|
|
+ INLINE float get_viscosity() const;
|
|
|
|
|
|
void remove_physical(Physical *p);
|
|
|
void remove_linear_force(LinearForce *f);
|
|
|
@@ -72,17 +84,9 @@ public:
|
|
|
|
|
|
private:
|
|
|
float _viscosity;
|
|
|
-
|
|
|
- // NOTE that the physicals container is NOT reference counted.
|
|
|
- // this does indeed mean that you are NOT supposed to use this
|
|
|
- // as a primary storage container for the physicals. This is so
|
|
|
- // because physicals, on their death, ask to be removed from their
|
|
|
- // current physicsmanager, if one exists, relieving the client from
|
|
|
- // the task and also allowing for dynamically created and destroyed
|
|
|
- // physicals.
|
|
|
- pvector< Physical * > _physicals;
|
|
|
- pvector< PT(LinearForce) > _linear_forces;
|
|
|
- pvector< PT(AngularForce) > _angular_forces;
|
|
|
+ PhysicalsVector _physicals;
|
|
|
+ LinearForcesVector _linear_forces;
|
|
|
+ AngularForcesVector _angular_forces;
|
|
|
|
|
|
PT(LinearIntegrator) _linear_integrator;
|
|
|
PT(AngularIntegrator) _angular_integrator;
|