Panda3D
|
A body on which physics will be applied. More...
#include <pandadoc.hpp>
Public Member Functions | |
__init__ () | |
Default Constructor. More... | |
__init__ (const PhysicsObject copy) | |
copy constructor More... | |
addImpact (const LPoint3 offset_from_center_of_mass, const LVector3 impulse) | |
Adds an impulse and/or torque (i.e. More... | |
addImpulse (const LVector3 impulse) | |
Adds an impulse force (i.e. More... | |
addLocalImpact (const LPoint3 offset_from_center_of_mass, const LVector3 impulse) | |
Adds an impulse and/or torque (i.e. More... | |
addLocalImpulse (const LVector3 impulse) | |
Adds an impulse force (i.e. More... | |
addLocalTorque (const LRotation torque) | |
Adds an torque force (i.e. More... | |
addTorque (const LRotation torque) | |
Adds an torque force (i.e. More... | |
bool | getActive () |
Process Flag Query. More... | |
LVector3 | getImplicitVelocity () |
Velocity Query over the last dt. More... | |
LMatrix4 | getInertialTensor () |
returns a transform matrix that represents the object's willingness to be forced. More... | |
LPoint3 | getLastPosition () |
Get the position of the physics object at the start of the most recent do_physics. More... | |
LMatrix4 | getLcs () |
returns a transform matrix to this object's local coordinate system. More... | |
float | getMass () |
Get the mass in slugs (or kilograms). More... | |
str | getName () |
LOrientation | getOrientation () |
get current orientation. More... | |
bool | getOriented () |
See set_oriented(). More... | |
LPoint3 | getPosition () |
Position Query. More... | |
LRotation | getRotation () |
get rotation per second. More... | |
float | getTerminalVelocity () |
tv query More... | |
LVector3 | getVelocity () |
Velocity Query per second. More... | |
PhysicsObject | makeCopy () |
dynamic copy. More... | |
PhysicsObject | operator= (const PhysicsObject other) |
output (Ostream out) | |
Write a string representation of this instance to <out>. More... | |
resetOrientation (const LOrientation orientation) | |
set the orientation while clearing the rotation velocity. More... | |
resetPosition (const LPoint3 pos) | |
use this to place an object in a completely new position, that has nothing to do with its last position. More... | |
setActive (bool flag) | |
Process Flag assignment. More... | |
setLastPosition (const LPoint3 pos) | |
Last position assignment. More... | |
setMass (float) | |
Set the mass in slugs (or kilograms). More... | |
setName (str name) | |
setOrientation (const LOrientation orientation) | |
setOriented (bool flag) | |
Set flag to determine whether this object should do any rotation or orientation calculations. More... | |
setPosition (const LPoint3 pos) | |
Vector position assignment. More... | |
setPosition (float x, float y, float z) | |
Piecewise position assignment. More... | |
setRotation (const LRotation rotation) | |
set rotation as a quaternion delta per second. More... | |
setTerminalVelocity (float tv) | |
tv assignment More... | |
setVelocity (const LVector3 vel) | |
Vector velocity assignment. More... | |
setVelocity (float x, float y, float z) | |
Piecewise velocity assignment. More... | |
write (Ostream out, int indent) | |
Write a string representation of this instance to <out>. More... | |
![]() | |
TypeHandle | getType () |
int | getTypeIndex () |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More... | |
bool | isExactType (TypeHandle handle) |
Returns true if the current object is the indicated type exactly. More... | |
bool | isOfType (TypeHandle handle) |
Returns true if the current object is or derives from the indicated type. More... | |
![]() | |
int | getRefCount () |
Returns the current reference count. More... | |
ref () | |
Explicitly increments the reference count. More... | |
bool | testRefCountIntegrity () |
Does some easy checks to make sure that the reference count isn't completely bogus. More... | |
bool | testRefCountNonzero () |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More... | |
bool | unref () |
Explicitly decrements the reference count. More... | |
Static Public Member Functions | |
static TypeHandle | getClassType () |
![]() | |
static TypeHandle | getClassType () |
![]() | |
static TypeHandle | getClassType () |
![]() | |
static TypeHandle | getClassType () |
Public Attributes | |
bool | active |
Process Flag Query. More... | |
LVector3 | implicit_velocity |
Velocity Query over the last dt. More... | |
LPoint3 | last_position |
Get the position of the physics object at the start of the most recent do_physics. More... | |
float | mass |
Get the mass in slugs (or kilograms). More... | |
LOrientation | orientation |
get current orientation. More... | |
bool | oriented |
See set_oriented(). More... | |
LPoint3 | position |
Position Query. More... | |
LRotation | rotation |
get rotation per second. More... | |
float | terminal_velocity |
tv query More... | |
LVector3 | velocity |
Velocity Query per second. More... | |
![]() | |
TypeHandle | type |
Returns the TypeHandle representing this object's type. More... | |
![]() | |
int | ref_count |
The current reference count. More... | |
A body on which physics will be applied.
If you're looking to add physical motion to your class, do NOT derive from this. Derive from Physical instead.
__init__ | ( | ) |
Default Constructor.
__init__ | ( | const PhysicsObject | copy | ) |
copy constructor
Adds an impulse and/or torque (i.e.
an instantanious change in velocity) based on how well the offset and impulse align with the center of mass (aka position). If you wanted to immitate this function you could work out the impulse and torque and call add_impulse and add_torque respectively. offset and force are in global (or parent) coordinates.
addImpulse | ( | const LVector3 | impulse | ) |
Adds an impulse force (i.e.
an instantanious change in velocity). This is a quicker way to get the velocity, add a vector to it and set that value to be the new velocity.
Adds an impulse and/or torque (i.e.
an instantanious change in velocity) based on how well the offset and impulse align with the center of mass (aka position). If you wanted to immitate this function you could work out the impulse and torque and call add_impulse and add_torque respectively. offset and force are in local coordinates.
addLocalImpulse | ( | const LVector3 | impulse | ) |
Adds an impulse force (i.e.
an instantanious change in velocity). This is a quicker way to get the velocity, add a vector to it and set that value to be the new velocity.
addLocalTorque | ( | const LRotation | torque | ) |
Adds an torque force (i.e.
an instantanious change in velocity). This is a quicker way to get the angular velocity, add a vector to it and set that value to be the new angular velocity.
addTorque | ( | const LRotation | torque | ) |
Adds an torque force (i.e.
an instantanious change in velocity). This is a quicker way to get the angular velocity, add a vector to it and set that value to be the new angular velocity.
bool getActive | ( | ) |
Process Flag Query.
|
static |
LVector3 getImplicitVelocity | ( | ) |
Velocity Query over the last dt.
LMatrix4 getInertialTensor | ( | ) |
returns a transform matrix that represents the object's willingness to be forced.
LPoint3 getLastPosition | ( | ) |
Get the position of the physics object at the start of the most recent do_physics.
LMatrix4 getLcs | ( | ) |
returns a transform matrix to this object's local coordinate system.
float getMass | ( | ) |
Get the mass in slugs (or kilograms).
str getName | ( | ) |
LOrientation getOrientation | ( | ) |
get current orientation.
bool getOriented | ( | ) |
See set_oriented().
LPoint3 getPosition | ( | ) |
Position Query.
LRotation getRotation | ( | ) |
get rotation per second.
float getTerminalVelocity | ( | ) |
tv query
LVector3 getVelocity | ( | ) |
Velocity Query per second.
PhysicsObject makeCopy | ( | ) |
dynamic copy.
PhysicsObject operator= | ( | const PhysicsObject | other | ) |
output | ( | Ostream | out | ) |
Write a string representation of this instance to <out>.
resetOrientation | ( | const LOrientation | orientation | ) |
set the orientation while clearing the rotation velocity.
resetPosition | ( | const LPoint3 | pos | ) |
use this to place an object in a completely new position, that has nothing to do with its last position.
setActive | ( | bool | flag | ) |
Process Flag assignment.
setLastPosition | ( | const LPoint3 | pos | ) |
Last position assignment.
setMass | ( | float | ) |
Set the mass in slugs (or kilograms).
setName | ( | str | name | ) |
setOrientation | ( | const LOrientation | orientation | ) |
setOriented | ( | bool | flag | ) |
Set flag to determine whether this object should do any rotation or orientation calculations.
Optimization.
setPosition | ( | const LPoint3 | pos | ) |
Vector position assignment.
This is also used as the center of mass.
setPosition | ( | float | x, |
float | y, | ||
float | z | ||
) |
Piecewise position assignment.
setRotation | ( | const LRotation | rotation | ) |
set rotation as a quaternion delta per second.
setTerminalVelocity | ( | float | tv | ) |
tv assignment
setVelocity | ( | const LVector3 | vel | ) |
Vector velocity assignment.
setVelocity | ( | float | x, |
float | y, | ||
float | z | ||
) |
Piecewise velocity assignment.
write | ( | Ostream | out, |
int | indent | ||
) |
Write a string representation of this instance to <out>.
bool active |
Process Flag Query.
LVector3 implicit_velocity |
Velocity Query over the last dt.
LPoint3 last_position |
Get the position of the physics object at the start of the most recent do_physics.
float mass |
Get the mass in slugs (or kilograms).
LOrientation orientation |
get current orientation.
bool oriented |
See set_oriented().
LPoint3 position |
Position Query.
LRotation rotation |
get rotation per second.
float terminal_velocity |
tv query
LVector3 velocity |
Velocity Query per second.