Handle for a body managed by PhysicsWorld.
◆ bodyIndex()
| int jsim.PhysicsBody.bodyIndex |
( |
| ) |
|
|
inline |
Gets the native body index for this body.
- Returns
- the native body index
◆ linearVelocity()
Gets the current world-space linear velocity in meters per second.
- Returns
- the body linear velocity
◆ orientation()
| Rotation3d jsim.PhysicsBody.orientation |
( |
| ) |
|
|
inline |
Gets the current world-space orientation.
- Returns
- the body orientation
◆ position()
| Pose3d jsim.PhysicsBody.position |
( |
| ) |
|
|
inline |
Gets the current world-space position in meters.
- Returns
- the body position
◆ setCollisionBox()
| void jsim.PhysicsBody.setCollisionBox |
( |
double | xMeters, |
|
|
double | yMeters, |
|
|
double | zMeters ) |
|
inline |
Sets an approximate box collision/body shape for this body.
- Parameters
-
| xMeters | box x dimension in meters |
| yMeters | box y dimension in meters |
| zMeters | box z dimension in meters |
◆ setCollisionFilter()
| void jsim.PhysicsBody.setCollisionFilter |
( |
int | collisionLayerBits, |
|
|
int | collisionMaskBits ) |
|
inline |
Sets broad-phase collision filtering for this body.
- Parameters
-
| collisionLayerBits | body layer bitmask |
| collisionMaskBits | body mask bitmask |
◆ setCollisionSphere()
| void jsim.PhysicsBody.setCollisionSphere |
( |
double | radiusMeters | ) |
|
|
inline |
Sets an approximate spherical collision/body shape for this body.
- Parameters
-
| radiusMeters | sphere radius in meters |
◆ setGravityEnabled()
| void jsim.PhysicsBody.setGravityEnabled |
( |
boolean | enabled | ) |
|
|
inline |
Enables or disables gravity for this body.
- Parameters
-
| enabled | true to enable gravity |
◆ setLinearVelocity() [1/2]
| void jsim.PhysicsBody.setLinearVelocity |
( |
double | vxMetersPerSecond, |
|
|
double | vyMetersPerSecond, |
|
|
double | vzMetersPerSecond ) |
|
inline |
Sets the body's linear velocity in meters per second.
- Parameters
-
| vxMetersPerSecond | x velocity in meters per second |
| vyMetersPerSecond | y velocity in meters per second |
| vzMetersPerSecond | z velocity in meters per second |
◆ setLinearVelocity() [2/2]
Sets the body's linear velocity in meters per second.
- Parameters
-
| velocityMps | the new linear velocity in meters per second |
◆ setOrientation()
| void jsim.PhysicsBody.setOrientation |
( |
Rotation3d | orientation | ) |
|
|
inline |
Sets the body's world-space orientation.
- Parameters
-
| orientation | the new body orientation |
◆ setPosition() [1/2]
| void jsim.PhysicsBody.setPosition |
( |
Distance | x, |
|
|
Distance | y, |
|
|
Distance | z ) |
|
inline |
Sets the body's world-space position.
- Parameters
-
| x | x position |
| y | y position |
| z | z position |
◆ setPosition() [2/2]
| void jsim.PhysicsBody.setPosition |
( |
Pose3d | pose | ) |
|
|
inline |
Sets the body's world-space position in meters.
- Parameters
-
| pose | the new position (only translation component is used) |
The documentation for this class was generated from the following file: