PhysicsObject

from panda3d.physics import PhysicsObject
class PhysicsObject

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

Inheritance diagram of PhysicsObject

__init__()

Default Constructor

__init__(copy: PhysicsObject)

copy constructor

addImpact(offset_from_center_of_mass: panda3d.core.LPoint3, impulse: panda3d.core.LVector3)None

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 addImpulse() and addTorque() respectively. offset and force are in global (or parent) coordinates.

addImpulse(impulse: panda3d.core.LVector3)None

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.

addLocalImpact(offset_from_center_of_mass: panda3d.core.LPoint3, impulse: panda3d.core.LVector3)None

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 addImpulse() and addTorque() respectively. offset and force are in local coordinates.

addLocalImpulse(impulse: panda3d.core.LVector3)None

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(torque: panda3d.core.LRotation)None

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(torque: panda3d.core.LRotation)None

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
getActive()bool

Process Flag Query

static getClassType()panda3d.core.TypeHandle
getImplicitVelocity()panda3d.core.LVector3

Velocity Query over the last dt

getInertialTensor()panda3d.core.LMatrix4

returns a transform matrix that represents the object’s willingness to be forced.

getLastPosition()panda3d.core.LPoint3

Get the position of the physics object at the start of the most recent do_physics.

getLcs()panda3d.core.LMatrix4

returns a transform matrix to this object’s local coordinate system.

getMass()float

Get the mass in slugs (or kilograms).

getName()str
getOrientation()panda3d.core.LOrientation

get current orientation.

getOriented()bool

See setOriented().

getPosition()panda3d.core.LPoint3

Position Query

getRotation()panda3d.core.LRotation

get rotation per second.

getTerminalVelocity()float

tv query

getVelocity()panda3d.core.LVector3

Velocity Query per second

makeCopy()PhysicsObject

dynamic copy.

output(out: panda3d.core.ostream)None

Write a string representation of this instance to <out>.

resetOrientation(orientation: panda3d.core.LOrientation)None

set the orientation while clearing the rotation velocity.

resetPosition(pos: panda3d.core.LPoint3)None

use this to place an object in a completely new position, that has nothing to do with its last position.

setActive(flag: bool)None

Process Flag assignment

setLastPosition(pos: panda3d.core.LPoint3)None

Last position assignment

setMass(param0: float)None

Set the mass in slugs (or kilograms).

setName(name: str)None
setOrientation(orientation: panda3d.core.LOrientation)None
setOriented(flag: bool)None

Set flag to determine whether this object should do any rotation or orientation calculations. Optimization.

setPosition(pos: panda3d.core.LPoint3)None

Vector position assignment. This is also used as the center of mass.

setPosition(x: float, y: float, z: float)None

Piecewise position assignment

setRotation(rotation: panda3d.core.LRotation)None

set rotation as a quaternion delta per second.

setTerminalVelocity(tv: float)None

tv assignment

setVelocity(vel: panda3d.core.LVector3)None

Vector velocity assignment

setVelocity(x: float, y: float, z: float)None

Piecewise velocity assignment

write(out: panda3d.core.ostream, indent: int)None

Write a string representation of this instance to <out>.