14 #ifndef PHYSICS_OBJECT_H 15 #define PHYSICS_OBJECT_H 39 INLINE
void set_active(
bool flag);
40 INLINE
bool get_active()
const;
42 INLINE
void set_mass(PN_stdfloat);
43 INLINE PN_stdfloat get_mass()
const;
46 INLINE
void set_position(
const LPoint3 &pos);
47 INLINE
void set_position(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
48 INLINE LPoint3 get_position()
const;
50 INLINE
void reset_position(
const LPoint3 &pos);
52 INLINE
void set_last_position(
const LPoint3 &pos);
53 INLINE LPoint3 get_last_position()
const;
55 INLINE
void set_velocity(
const LVector3 &vel);
56 INLINE
void set_velocity(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
57 INLINE LVector3 get_velocity()
const;
58 INLINE LVector3 get_implicit_velocity()
const;
61 INLINE
void add_torque(
const LRotation &torque);
62 INLINE
void add_impulse(
const LVector3 &impulse);
63 virtual void add_impact(
64 const LPoint3 &offset_from_center_of_mass,
const LVector3 &impulse);
67 INLINE
void add_local_torque(
const LRotation &torque);
68 INLINE
void add_local_impulse(
const LVector3 &impulse);
69 virtual void add_local_impact(
70 const LPoint3 &offset_from_center_of_mass,
const LVector3 &impulse);
72 INLINE
void set_terminal_velocity(PN_stdfloat tv);
73 INLINE PN_stdfloat get_terminal_velocity()
const;
75 INLINE
void set_oriented(
bool flag);
76 INLINE
bool get_oriented()
const;
78 INLINE
void set_orientation(
const LOrientation &orientation);
79 INLINE LOrientation get_orientation()
const;
81 INLINE
void reset_orientation(
const LOrientation &orientation);
83 INLINE
void set_rotation(
const LRotation &rotation);
84 INLINE LRotation get_rotation()
const;
86 virtual LMatrix4 get_inertial_tensor()
const;
87 virtual LMatrix4 get_lcs()
const;
91 void set_name(
const std::string &name) {
94 const std::string& get_name() {
99 virtual void output(std::ostream &out)
const;
100 virtual void write(std::ostream &out,
int indent=0)
const;
105 LPoint3 _last_position;
109 LOrientation _orientation;
112 PN_stdfloat _terminal_velocity;
126 static void init_type() {
127 TypedReferenceCount::init_type();
129 TypedReferenceCount::get_class_type());
132 return get_class_type();
134 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
142 #endif // __PHYSICS_OBJECT_H__ PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A body on which physics will be applied.
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 our own Panda specialization on the default STL vector.
This is a convenience class to specialize ConfigVariable as a floating- point type.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.