PhysicsObject
from panda3d.physics import PhysicsObject
- class PhysicsObject
Bases:
Bases:
TypedReferenceCount
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.
Inheritance diagram
- __init__()
Default Constructor
- __init__(copy: PhysicsObject)
copy constructor
- add_impact(offset_from_center_of_mass: panda3d.core.LPoint3, impulse: panda3d.core.LVector3)
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()
andadd_torque()
respectively. offset and force are in global (or parent) coordinates.
- add_impulse(impulse: panda3d.core.LVector3)
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.
- add_local_impact(offset_from_center_of_mass: panda3d.core.LPoint3, impulse: panda3d.core.LVector3)
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()
andadd_torque()
respectively. offset and force are in local coordinates.
- add_local_impulse(impulse: panda3d.core.LVector3)
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.
- add_local_torque(torque: panda3d.core.LRotation)
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.
- add_torque(torque: panda3d.core.LRotation)
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.
- assign(other: PhysicsObject) PhysicsObject
- static get_class_type() panda3d.core.TypeHandle
- get_implicit_velocity() panda3d.core.LVector3
Velocity Query over the last dt
- get_inertial_tensor() panda3d.core.LMatrix4
returns a transform matrix that represents the object’s willingness to be forced.
- get_last_position() panda3d.core.LPoint3
Get the position of the physics object at the start of the most recent do_physics.
- get_lcs() panda3d.core.LMatrix4
returns a transform matrix to this object’s local coordinate system.
- get_orientation() panda3d.core.LOrientation
get current orientation.
- get_oriented() bool
See
set_oriented()
.
- get_position() panda3d.core.LPoint3
Position Query
- get_rotation() panda3d.core.LRotation
get rotation per second.
- get_velocity() panda3d.core.LVector3
Velocity Query per second
- property last_position LPoint3
- Getter
Get the position of the physics object at the start of the most recent do_physics.
- Setter
Last position assignment
- make_copy() PhysicsObject
dynamic copy.
- property orientation LOrientation
- Getter
get current orientation.
Setter
- property oriented bool
Set flag to determine whether this object should do any rotation or orientation calculations. Optimization.
- output(out: panda3d.core.ostream)
Write a string representation of this instance to <out>.
- property position LPoint3
- Getter
Position Query
- Setter
INLINE void set_center_of_mass(const
LPoint3
&pos); useset_position()
.INLINE void set_center_of_mass(const
LPoint3
&pos); useset_position()
.Vector position assignment. This is also used as the center of mass.
Piecewise position assignment
- reset_orientation(orientation: panda3d.core.LOrientation)
set the orientation while clearing the rotation velocity.
- reset_position(pos: panda3d.core.LPoint3)
use this to place an object in a completely new position, that has nothing to do with its last position.
- property rotation LRotation
- Getter
get rotation per second.
- Setter
set rotation as a quaternion delta per second.
- set_last_position(pos: panda3d.core.LPoint3)
Last position assignment
- set_orientation(orientation: panda3d.core.LOrientation)
- set_oriented(flag: bool)
Set flag to determine whether this object should do any rotation or orientation calculations. Optimization.
- set_position(pos: panda3d.core.LPoint3)
Vector position assignment. This is also used as the center of mass.
- set_rotation(rotation: panda3d.core.LRotation)
set rotation as a quaternion delta per second.
- set_velocity(vel: panda3d.core.LVector3)
Vector velocity assignment
- property velocity LVector3
- Getter
Velocity Query per second
- Setter
Vector velocity assignment
Piecewise velocity assignment
- write(out: panda3d.core.ostream, indent: int)
Write a string representation of this instance to <out>.