18 #include "pandabase.h" 19 #include "pointerTo.h" 20 #include "typedReferenceCount.h" 25 #include "physicsObject.h" 26 #include "physicsObjectCollection.h" 27 #include "linearForce.h" 28 #include "angularForce.h" 47 Physical(
int total_objects = 1,
bool pre_alloc =
false);
55 INLINE
NodePath get_physical_node_path()
const;
58 INLINE
void clear_linear_forces();
59 INLINE
void clear_angular_forces();
60 INLINE
void clear_physics_objects();
67 INLINE
int get_num_linear_forces()
const;
68 INLINE PT(
LinearForce) get_linear_force(
int index)
const;
69 MAKE_SEQ(get_linear_forces, get_num_linear_forces, get_linear_force);
70 INLINE
int get_num_angular_forces()
const;
71 INLINE PT(
AngularForce) get_angular_force(
int index)
const;
72 MAKE_SEQ(get_angular_forces, get_num_angular_forces, get_angular_force);
74 INLINE
void set_viscosity(PN_stdfloat viscosity);
75 INLINE PN_stdfloat get_viscosity()
const;
79 virtual void output(ostream &out = cout)
const;
80 virtual void write_physics_objects(
81 ostream &out = cout,
unsigned int indent=0)
const;
82 virtual void write_linear_forces(
83 ostream &out = cout,
unsigned int indent=0)
const;
84 virtual void write_angular_forces(
85 ostream &out = cout,
unsigned int indent=0)
const;
86 virtual void write(ostream &out = cout,
unsigned int indent=0)
const;
90 INLINE
const LinearForceVector &get_linear_forces()
const;
91 INLINE
const AngularForceVector &get_angular_forces()
const;
97 PN_stdfloat _viscosity;
100 LinearForceVector _linear_forces;
101 AngularForceVector _angular_forces;
118 static void init_type() {
119 TypedReferenceCount::init_type();
120 register_type(_type_handle,
"Physical",
121 TypedReferenceCount::get_class_type());
124 return get_class_type();
126 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
132 #include "physical.I" 134 #endif // __PHYSICAL_H__ A body on which physics will be applied.
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
This is a set of zero or more PhysicsObjects.
A force that acts on a PhysicsObject by way of an Integrator.
Graph node that encapsulated a series of physical objects.
Physics don't get much higher-level than this.
Defines a set of physically modeled attributes.
pure virtual parent of all quat-based forces.
TypeHandle is the identifier used to differentiate C++ class types.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...