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

digraph inheritance8ce2b6e190 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "PhysicsObject" [URL="acron.physics.PhysicsObject.html#acron.physics.PhysicsObject",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedReferenceCount" -> "PhysicsObject" [arrowsize=0.75,style=""]; "ReferenceCount" [URL="acron.core.ReferenceCount.html#acron.core.ReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "ReferenceCount" [arrowsize=0.75,style=""]; "TypedObject" [URL="acron.core.TypedObject.html#acron.core.TypedObject",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "TypedObject" [arrowsize=0.75,style=""]; "TypedReferenceCount" [URL="acron.core.TypedReferenceCount.html#acron.core.TypedReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedObject" -> "TypedReferenceCount" [arrowsize=0.75,style=""]; "ReferenceCount" -> "TypedReferenceCount" [arrowsize=0.75,style=""]; }
PhysicsObject.__init__()

Default Constructor

copy constructor

PhysicsObject.add_impact()

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.

PhysicsObject.add_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.

PhysicsObject.add_local_impact()

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.

PhysicsObject.add_local_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.

PhysicsObject.add_local_torque()

Local instantanious forces

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.

PhysicsObject.add_torque()

Global instantanious forces

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.

PhysicsObject.assign()
PhysicsObject.get_active()

Process Flag Query

static PhysicsObject.get_class_type()
PhysicsObject.get_implicit_velocity()

Velocity Query over the last dt

PhysicsObject.get_inertial_tensor()

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

PhysicsObject.get_last_position()

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

PhysicsObject.get_lcs()

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

PhysicsObject.get_mass()

Get the mass in slugs (or kilograms).

PhysicsObject.get_name()
PhysicsObject.get_orientation()

get current orientation.

PhysicsObject.get_oriented()

See set_oriented().

PhysicsObject.get_position()

Position Query

PhysicsObject.get_rotation()

get rotation per second.

PhysicsObject.get_terminal_velocity()

tv query

PhysicsObject.get_velocity()

Velocity Query per second

PhysicsObject.make_copy()

dynamic copy.

PhysicsObject.output()

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

PhysicsObject.reset_orientation()

set the orientation while clearing the rotation velocity.

PhysicsObject.reset_position()

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

PhysicsObject.set_active()

Process Flag assignment

PhysicsObject.set_last_position()

Last position assignment

PhysicsObject.set_mass()

Set the mass in slugs (or kilograms).

PhysicsObject.set_name()
PhysicsObject.set_orientation()
PhysicsObject.set_oriented()

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

PhysicsObject.set_position()

INLINE void set_center_of_mass(const LPoint3 &pos); use set_position.

INLINE void set_center_of_mass(const LPoint3 &pos); use set_position.

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

Piecewise position assignment

PhysicsObject.set_rotation()

set rotation as a quaternion delta per second.

PhysicsObject.set_terminal_velocity()

tv assignment

PhysicsObject.set_velocity()

Vector velocity assignment

Piecewise velocity assignment

PhysicsObject.write()

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