44 explicit Physical(
int total_objects = 1,
bool pre_alloc =
false);
52 INLINE
NodePath get_physical_node_path()
const;
55 INLINE
void clear_linear_forces();
56 INLINE
void clear_angular_forces();
57 INLINE
void clear_physics_objects();
64 INLINE
int get_num_linear_forces()
const;
65 INLINE PT(
LinearForce) get_linear_force(
int index)
const;
66 MAKE_SEQ(get_linear_forces, get_num_linear_forces, get_linear_force);
67 INLINE
int get_num_angular_forces()
const;
68 INLINE PT(
AngularForce) get_angular_force(
int index)
const;
69 MAKE_SEQ(get_angular_forces, get_num_angular_forces, get_angular_force);
71 INLINE
void set_viscosity(PN_stdfloat viscosity);
72 INLINE PN_stdfloat get_viscosity()
const;
76 virtual void output(std::ostream &out = std::cout)
const;
77 virtual void write_physics_objects(
78 std::ostream &out = std::cout,
int indent=0)
const;
79 virtual void write_linear_forces(
80 std::ostream &out = std::cout,
int indent=0)
const;
81 virtual void write_angular_forces(
82 std::ostream &out = std::cout,
int indent=0)
const;
83 virtual void write(std::ostream &out = std::cout,
int indent=0)
const;
94 PN_stdfloat _viscosity;
115 static void init_type() {
116 TypedReferenceCount::init_type();
118 TypedReferenceCount::get_class_type());
121 return get_class_type();
123 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
131 #endif // __PHYSICAL_H__ PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A body on which physics will be applied.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
This is a set of zero or more PhysicsObjects.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A force that acts on a PhysicsObject by way of an Integrator.
This is our own Panda specialization on the default STL vector.
Graph node that encapsulated a series of physical objects.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
Physics don't get much higher-level than this.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Defines a set of physically modeled attributes.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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...