Generic handle for a gamepiece managed by PhysicsWorld.
◆ gamepieceIndex()
| int jsim.Gamepiece.gamepieceIndex |
( |
| ) |
|
|
inline |
Gets the native gamepiece index for this handle.
- Returns
- the native gamepiece index
◆ isBall()
| boolean jsim.Gamepiece.isBall |
( |
| ) |
|
|
inline |
Convenience: is this gamepiece a ball (default spherical physics)?
- Returns
- true when this gamepiece should be treated as a ball/sphere
◆ linearVelocity()
Gets the current world-space linear velocity in meters per second.
- Returns
- the gamepiece linear velocity
◆ outtake() [1/3]
Convenience method to set both position and launch velocity.
- Parameters
-
| pose | launch position (only translation component is used) |
| velocityMps | launch velocity in meters per second |
◆ outtake() [2/3]
| void jsim.Gamepiece.outtake |
( |
Translation3d | positionMeters, |
|
|
LinearVelocity3d | velocityMps ) |
|
inline |
Convenience method to set both position and launch velocity.
- Parameters
-
| positionMeters | launch position in meters |
| velocityMps | launch velocity in meters per second |
◆ outtake() [3/3]
| void jsim.Gamepiece.outtake |
( |
Vec3 | positionMeters, |
|
|
Vec3 | velocityMps ) |
|
inline |
Convenience method to set both position and launch velocity.
- Parameters
-
| positionMeters | launch position in meters |
| velocityMps | launch velocity in meters per second |
◆ pick()
| boolean jsim.Gamepiece.pick |
( |
Pose3d | intakePos, |
|
|
double | captureRadius, |
|
|
Vec3 | carryOffset ) |
|
inline |
Attempt to pick this gamepiece into a carrier.
- Parameters
-
| intakePos | intake world position |
| captureRadius | capture radius in meters |
| carryOffset | offset from intake to carried resting position |
- Returns
- true when pickup succeeded
◆ place()
| void jsim.Gamepiece.place |
( |
Translation3d | pos | ) |
|
|
inline |
Place this gamepiece at the given world position and mark grounded.
- Parameters
-
| pos | world-space position in meters |
◆ position()
| Pose3d jsim.Gamepiece.position |
( |
| ) |
|
|
inline |
Gets the current world-space position in meters.
- Returns
- the gamepiece position
◆ setLinearVelocity() [1/3]
| void jsim.Gamepiece.setLinearVelocity |
( |
double | vxMetersPerSecond, |
|
|
double | vyMetersPerSecond, |
|
|
double | vzMetersPerSecond ) |
|
inline |
Sets the gamepiece world-space 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/3]
Sets the gamepiece world-space linear velocity in meters per second.
- Parameters
-
| velocityMps | the new linear velocity in meters per second |
◆ setLinearVelocity() [3/3]
| void jsim.Gamepiece.setLinearVelocity |
( |
Vec3 | velocityMps | ) |
|
|
inline |
Sets the gamepiece world-space linear velocity in meters per second.
- Parameters
-
| velocityMps | the new linear velocity in meters per second |
◆ setPosition() [1/4]
| void jsim.Gamepiece.setPosition |
( |
Distance | x, |
|
|
Distance | y, |
|
|
Distance | z ) |
|
inline |
Sets the gamepiece world-space position.
- Parameters
-
| x | x position |
| y | y position |
| z | z position |
◆ setPosition() [2/4]
| void jsim.Gamepiece.setPosition |
( |
Pose3d | pose | ) |
|
|
inline |
Sets the gamepiece world-space position in meters.
- Parameters
-
| pose | the new position (only translation component is used) |
◆ setPosition() [3/4]
| void jsim.Gamepiece.setPosition |
( |
Translation3d | positionMeters | ) |
|
|
inline |
Sets the gamepiece world-space position in meters.
- Parameters
-
| positionMeters | the new position in meters |
◆ setPosition() [4/4]
| void jsim.Gamepiece.setPosition |
( |
Vec3 | positionMeters | ) |
|
|
inline |
Sets the gamepiece world-space position in meters.
- Parameters
-
| positionMeters | the new position in meters |
◆ type()
Gets the declared gamepiece type when created from a typed API.
- Returns
- the declared gamepiece type, or null when unknown
◆ typeName()
| String jsim.Gamepiece.typeName |
( |
| ) |
|
|
inline |
Returns the registered type name for this gamepiece, if any.
- Returns
- human-readable type name or null
◆ gamepieceIndex
| final int jsim.Gamepiece.gamepieceIndex |
|
protected |
Native index for this gamepiece in the driver.
◆ type
Declared gamepiece type when created from a typed API.
◆ world
The owning physics world for this handle.
The documentation for this class was generated from the following file: