14#ifndef PHYSICS_OBJECT_H
15#define PHYSICS_OBJECT_H
47 INLINE
void set_position(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
56 INLINE
void set_velocity(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
61 INLINE
void add_torque(
const LRotation &torque);
64 const LPoint3 &offset_from_center_of_mass,
const LVector3 &impulse);
70 const LPoint3 &offset_from_center_of_mass,
const LVector3 &impulse);
78 INLINE
void set_orientation(
const LOrientation &orientation);
87 virtual LMatrix4
get_lcs()
const;
90#if !defined(NDEBUG) || !defined(CPPPARSER)
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;
117 LPoint3 _last_position;
121 LOrientation _orientation;
124 PN_stdfloat _terminal_velocity;
136 static void init_type() {
137 TypedReferenceCount::init_type();
139 TypedReferenceCount::get_class_type());
141 virtual TypeHandle get_type()
const {
142 return get_class_type();
144 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
147 static TypeHandle _type_handle;
This is a convenience class to specialize ConfigVariable as a floating- point type.
get_oriented
See set_oriented().
get_active
Process Flag Query.
virtual PhysicsObject * make_copy() const
dynamic copy.
PhysicsObject()
Default Constructor.
get_position
Position Query.
virtual void output(std::ostream &out) const
Write a string representation of this instance to <out>.
get_velocity
Velocity Query per second.
get_last_position
Get the position of the physics object at the start of the most recent do_physics.
set_active
Process Flag assignment.
virtual void add_local_impact(const LPoint3 &offset_from_center_of_mass, const LVector3 &impulse)
Adds an impulse and/or torque (i.e.
void add_local_torque(const LRotation &torque)
Adds an torque force (i.e.
virtual LMatrix4 get_inertial_tensor() const
returns a transform matrix that represents the object's willingness to be forced.
set_rotation
set rotation as a quaternion delta per second.
void add_local_impulse(const LVector3 &impulse)
Adds an impulse force (i.e.
set_velocity
Vector velocity assignment.
virtual LMatrix4 get_lcs() const
returns a transform matrix to this object's local coordinate system.
set_last_position
Last position assignment.
set_mass
Set the mass in slugs (or kilograms).
void reset_position(const LPoint3 &pos)
use this to place an object in a completely new position, that has nothing to do with its last positi...
get_terminal_velocity
tv query
void reset_orientation(const LOrientation &orientation)
set the orientation while clearing the rotation velocity.
get_rotation
get rotation per second.
void add_torque(const LRotation &torque)
Adds an torque force (i.e.
virtual void write(std::ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
get_orientation
get current orientation.
set_terminal_velocity
tv assignment
void add_impulse(const LVector3 &impulse)
Adds an impulse force (i.e.
get_implicit_velocity
Velocity Query over the last dt.
set_position
Vector position assignment.
set_oriented
Set flag to determine whether this object should do any rotation or orientation calculations.
virtual void add_impact(const LPoint3 &offset_from_center_of_mass, const LVector3 &impulse)
Adds an impulse and/or torque (i.e.
get_mass
Get the mass in slugs (or kilograms).
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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.
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.