public class MultiBody extends NativePhysicsObject
btMultiBody. Uses
Featherstone's algorithm.| Modifier and Type | Field and Description |
|---|---|
static java.util.logging.Logger |
logger
message logger for this class
|
loggerN| Constructor and Description |
|---|
MultiBody(int numLinks,
float baseMass,
Vector3f baseInertia,
boolean fixedBase,
boolean canSleep)
Instantiate a MultiBody.
|
| Modifier and Type | Method and Description |
|---|---|
MultiBodyCollider |
addBaseCollider(CollisionShape shape)
Add a collider for the base.
|
void |
addBaseForce(Vector3f force)
Add an external force to the base.
|
void |
addBaseTorque(Vector3f torque)
Add an external torque to the base.
|
float |
angularDamping()
Determine the angular damping.
|
Vector3f |
baseAngularVelocity(Vector3f storeResult)
Determine the angular velocity of the base.
|
Vector3f |
baseForce(Vector3f storeResult)
Determine the net force on the base.
|
Vector3f |
baseInertia(Vector3f storeResult)
Determine the rotational inertia of the base.
|
Vector3f |
baseLocation(Vector3f storeResult)
Determine the location of the base's center of mass.
|
float |
baseMass()
Determine the mass of the base.
|
Quaternion |
baseOrientation(Quaternion storeResult)
Determine the orientation of the base.
|
Vector3f |
baseTorque(Vector3f storeResult)
Determine the net torque on the base.
|
Transform |
baseTransform(Transform storeResult)
Determine the transform of the base.
|
Vector3f |
baseVelocity(Vector3f storeResult)
Determine the linear velocity of the base's center of mass.
|
boolean |
canSleep()
Test whether this MultiBody can sleep.
|
boolean |
canWakeup()
Test whether this MultiBody can wake up.
|
void |
clearConstraintForces()
Clear all constraint forces.
|
void |
clearForcesAndTorques()
Clear all external forces and torques.
|
void |
clearVelocities()
Zero out all velocities.
|
int |
collideWithGroups()
Read the set of collision groups with which this multibody can collide.
|
int |
collisionGroup()
Read the collision group of this multibody.
|
MultiBodyLink |
configureFixedLink(float mass,
Vector3f inertia,
MultiBodyLink parent,
Quaternion orientation,
Vector3f parent2Pivot,
Vector3f pivot2Link)
Configure a new link that is fixed to its parent.
|
MultiBodyLink |
configurePlanarLink(float mass,
Vector3f inertia,
MultiBodyLink parent,
Quaternion orientation,
Vector3f axis,
Vector3f parent2Link,
boolean disableCollision)
Configure a link that is joined to its parent with a planar joint.
|
MultiBodyLink |
configurePrismaticLink(float mass,
Vector3f inertia,
MultiBodyLink parent,
Quaternion orientation,
Vector3f axis,
Vector3f parent2Pivot,
Vector3f pivot2Link,
boolean disableCollision)
Configure a link that is joined to its parent with a prismatic joint.
|
MultiBodyLink |
configureRevoluteLink(float mass,
Vector3f inertia,
MultiBodyLink parent,
Quaternion orientation,
Vector3f axis,
Vector3f parent2Pivot,
Vector3f pivot2Link,
boolean disableCollision)
Configure a link that is joined to its parent with a revolute joint.
|
MultiBodyLink |
configureSphericalLink(float mass,
Vector3f inertia,
MultiBodyLink parent,
Quaternion orientation,
Vector3f parent2Pivot,
Vector3f pivot2Link,
boolean disableCollision)
Configure a link that is joined to its parent with a spherical joint.
|
boolean |
contains(MultiBodyCollider collider)
Test whether the specified collider is part of this MultiBody.
|
int |
countConfiguredLinks()
Count the configured links in this MultiBody.
|
int |
countDofs()
Count the degrees of freedom.
|
int |
countPositionVariables()
Count the position variables in this MultiBody.
|
MultiBodyCollider |
getBaseCollider()
Access the collider for the base.
|
MultiBodyLink |
getLink(int linkIndex)
Access the index link of this MultiBody.
|
boolean |
hasFixedBase()
Test whether this MultiBody has a fixed base.
|
boolean |
isUsingGlobalVelocities()
Test whether this MultiBody uses global variables.
|
boolean |
isUsingGyroTerm()
Test whether this MultiBody uses the gyro term.
|
boolean |
isUsingRK4()
Test whether this MultiBody uses RK4 integration.
|
float |
linearDamping()
Determine the linear damping.
|
java.util.List<MultiBodyCollider> |
listColliders()
Enumerate the colliders in this MultiBody.
|
float |
maxAppliedImpulse()
Determine the maximum applied impulse.
|
float |
maxCoordinateVelocity()
Determine the maximum coordinate velocity.
|
void |
setBaseAngularVelocity(Vector3f angularVelocity)
Alter the angular velocity of the base.
|
void |
setBaseLocation(Vector3f location)
Alter the location of the base's center of mass.
|
void |
setBaseOrientation(Quaternion orientation)
Alter the orientation of the base.
|
void |
setBaseTransform(Transform transform)
Alter the transform of the base.
|
void |
setBaseVelocity(Vector3f velocity)
Alter the linear velocity of the base.
|
void |
setCollideWithGroups(int groups)
Directly alter the collision groups with which this MultiBody can
collide.
|
void |
setCollisionGroup(int group)
Alter which collision group this MultiBody belongs to.
|
void |
setUserIndex(int index)
Alter the primary user index.
|
void |
setUserIndex2(int index)
Alter the secondary user index.
|
long |
spaceId()
Determine the ID of the MultiBodySpace to which this MultiBody is added.
|
void |
useGlobalVelocities(boolean setting)
Alter whether this MultiBody uses global velocities.
|
int |
userIndex()
Return the primary user index (native field: m_userIndex).
|
int |
userIndex2()
Return the secondary user index (native field: m_userIndex2).
|
void |
useRK4(boolean setting)
Alter whether this MultiBody uses RK4 integration.
|
compareTo, countTrackers, dumpTrackers, equals, freeUnusedObjects, hasAssignedNativeObject, hashCode, nativeId, reassignNativeId, setNativeId, setNativeIdNotTracked, toString, unassignNativeObjectpublic static final java.util.logging.Logger logger
public MultiBody(int numLinks,
float baseMass,
Vector3f baseInertia,
boolean fixedBase,
boolean canSleep)
numLinks - the desired number of links, not including the base
(≥0)baseMass - the desired mass of the base (in physics-space units,
>0)baseInertia - the desired rotational inertia of the base (not null,
all elements positive)fixedBase - true → base is fixed, false → base can movecanSleep - true → can sleep, false → won't sleeppublic MultiBodyCollider addBaseCollider(CollisionShape shape)
shape - (not null, alias created)public void addBaseForce(Vector3f force)
force - the force to add (in physics-space coordinates, not null,
unaffected)public void addBaseTorque(Vector3f torque)
torque - the torque to add (in physics-space coordinates, not null,
unaffected)public float angularDamping()
public Vector3f baseAngularVelocity(Vector3f storeResult)
storeResult - storage for the result (modified if not null)public Vector3f baseForce(Vector3f storeResult)
storeResult - storage for the result (modified if not null)public Vector3f baseInertia(Vector3f storeResult)
storeResult - storage for the result (modified if not null)public Vector3f baseLocation(Vector3f storeResult)
storeResult - storage for the result (modified if not null)public float baseMass()
public Quaternion baseOrientation(Quaternion storeResult)
storeResult - storage for the result (modified if not null)public Vector3f baseTorque(Vector3f storeResult)
storeResult - storage for the result (modified if not null)public Transform baseTransform(Transform storeResult)
storeResult - storage for the result (modified if not null)public Vector3f baseVelocity(Vector3f storeResult)
storeResult - storage for the result (modified if not null)public boolean canSleep()
public boolean canWakeup()
public void clearConstraintForces()
public void clearForcesAndTorques()
public void clearVelocities()
public int collideWithGroups()
public int collisionGroup()
public MultiBodyLink configureFixedLink(float mass, Vector3f inertia, MultiBodyLink parent, Quaternion orientation, Vector3f parent2Pivot, Vector3f pivot2Link)
mass - the desired mass of the link (>0)inertia - the desired moment of inertia of the link (not null,
unaffected)parent - the parent link, or null if parented by the baseorientation - the orientation of the link relative to its parent
(not null, unaffected)parent2Pivot - the offset of the pivot from the parent's center of
mass (not null, unaffected)pivot2Link - the offset of the child's center of mass from the pivot
(not null, unaffected)public MultiBodyLink configurePlanarLink(float mass, Vector3f inertia, MultiBodyLink parent, Quaternion orientation, Vector3f axis, Vector3f parent2Link, boolean disableCollision)
mass - the desired mass of the link (>0)inertia - the desired moment of inertia of the link (not null,
unaffected)parent - the parent link, or null if parented by the baseorientation - the orientation of the link relative to its parent
(not null, unaffected)axis - the axis of rotation, which is also the plane's normal vector
(not null, unaffected)parent2Link - the offset of the child's center of mass from the
parent's center of mass (not null, unaffected)disableCollision - true to ignore collisions between the link and
its parentpublic MultiBodyLink configurePrismaticLink(float mass, Vector3f inertia, MultiBodyLink parent, Quaternion orientation, Vector3f axis, Vector3f parent2Pivot, Vector3f pivot2Link, boolean disableCollision)
mass - the desired mass of the link (>0)inertia - the desired moment of inertia of the link (not null,
unaffected)parent - the parent link, or null if parented by the baseorientation - the orientation of the link relative to its parent
(not null, unaffected)axis - the axis of rotation (not null, unaffected)parent2Pivot - the offset of the pivot from the parent's center of
mass (not null, unaffected)pivot2Link - the offset of the child's center of mass from the pivot
(not null, unaffected)disableCollision - true to ignore collisions between the link and
its parentpublic MultiBodyLink configureRevoluteLink(float mass, Vector3f inertia, MultiBodyLink parent, Quaternion orientation, Vector3f axis, Vector3f parent2Pivot, Vector3f pivot2Link, boolean disableCollision)
mass - the desired mass of the link (>0)inertia - the desired moment of inertia of the link (not null,
unaffected)parent - the parent link, or null if parented by the baseorientation - the orientation of the link relative to its parent
(not null, unaffected)axis - the axis of rotation (not null, unaffected)parent2Pivot - the offset of the pivot from the parent's center of
mass (not null, unaffected)pivot2Link - the offset of the child's center of mass from the pivot
(not null, unaffected)disableCollision - true to ignore collisions between the link and
its parentpublic MultiBodyLink configureSphericalLink(float mass, Vector3f inertia, MultiBodyLink parent, Quaternion orientation, Vector3f parent2Pivot, Vector3f pivot2Link, boolean disableCollision)
mass - the desired mass of the link (>0)inertia - the desired moment of inertia of the link (not null,
unaffected)parent - the parent link, or null if parented by the baseorientation - the orientation of the link relative to its parent
(not null, unaffected)parent2Pivot - the offset of the pivot from the parent's center of
mass (not null, unaffected)pivot2Link - the offset of the child's center of mass from the pivot
(not null, unaffected)disableCollision - true to ignore collisions between the link and
its parentpublic boolean contains(MultiBodyCollider collider)
collider - the collider to search for (not null, unaffected)public int countConfiguredLinks()
public int countDofs()
public int countPositionVariables()
public MultiBodyCollider getBaseCollider()
public MultiBodyLink getLink(int linkIndex)
linkIndex - (≥0, <numConfigured)public boolean hasFixedBase()
public boolean isUsingGlobalVelocities()
public boolean isUsingGyroTerm()
public boolean isUsingRK4()
public float linearDamping()
public java.util.List<MultiBodyCollider> listColliders()
public float maxAppliedImpulse()
public float maxCoordinateVelocity()
public void setBaseAngularVelocity(Vector3f angularVelocity)
angularVelocity - the desired angular-velocity vector (in
physics-space coordinates, not null, unaffected, default=(0,0,0))public void setBaseLocation(Vector3f location)
location - the desired location vector (in physics-space
coordinates, not null, unaffected, default=(0,0,0))public void setBaseOrientation(Quaternion orientation)
orientation - the desired orientation (in physics-space coordinates,
not null, unaffected)public void setBaseTransform(Transform transform)
transform - the desired transform from local coordinates to
physics-space coordinates (not null, unaffected, scale ignored)public void setBaseVelocity(Vector3f velocity)
velocity - the desired velocity vector (in physics-space
coordinates, not null, unaffected, default=(0,0,0))public void setCollideWithGroups(int groups)
groups - the desired groups, ORed together (bitmask,
default=COLLISION_GROUP_01)public void setCollisionGroup(int group)
Groups are represented by bitmasks with exactly one bit set. Manifest constants are defined in PhysicsCollisionObject.
Two objects can collide only if one of them has the collisionGroup of the other in its collideWithGroups set.
group - the collisionGroup to apply (bitmask with exactly one bit
set, default=COLLISION_GROUP_01)public void setUserIndex(int index)
index - the desired value (default=-1)public void setUserIndex2(int index)
index - the desired value (default=-1)public long spaceId()
public void useGlobalVelocities(boolean setting)
setting - true to use global velocities (default=false)public void useRK4(boolean setting)
setting - true to use RK4 (default=false)public int userIndex()
public int userIndex2()