|
JSim 2026.06.01-p(1)
|
Classes | |
| enum | HitboxType |
Public Member Functions | |
| PhysicsWorld (double fixedDtSeconds, boolean enableGravity) | |
| double | getFixedDtSeconds () |
| long | getNativeHandle () |
| int | getMaxBodies () |
| PhysicsBody | createBody (double massKg) |
| Gamepiece | createGamepiece (double radiusMeters, double massKg, double restitution) |
| Gamepiece | createGamepiece () |
| Gamepiece | createGamepiece (GamePieceType type, double radiusMeters, double massKg, double restitution) |
| Gamepiece | createGamepiece (GamePieceType type) |
| Gamepiece | createGamepiece (String typeName) |
| Gamepiece | createGamepiece (String typeName, double radiusMeters, double massKg, double restitution) |
| List< Gamepiece > | gamepieces () |
| void | addStepListener (Runnable listener) |
| void | setGamepiecePosition (int gamepieceIndex, double xMeters, double yMeters, double zMeters) |
| int | pickGamepiece (int gamepieceIndex, double intakeX, double intakeY, double intakeZ, double captureRadius, double carryOffsetX, double carryOffsetY, double carryOffsetZ) |
| void | placeGamepiece (int gamepieceIndex, double xMeters, double yMeters, double zMeters) |
| void | outtakeGamepiece (int gamepieceIndex, double px, double py, double pz, double vx, double vy, double vz) |
| void | setGamepieceLinearVelocity (int gamepieceIndex, double vxMetersPerSecond, double vyMetersPerSecond, double vzMetersPerSecond) |
| Pose3d | getBodyPosition (int bodyIndex) |
| LinearVelocity3d | getBodyLinearVelocity (int bodyIndex) |
| Rotation3d | getBodyOrientation (int bodyIndex) |
| int | getBodyState13Array (double[] outState13) |
| Pose3d | getGamepiecePosition (int gamepieceIndex) |
| String | getGamepieceTypeName (int gamepieceIndex) |
| LinearVelocity3d | getGamepieceLinearVelocity (int gamepieceIndex) |
| void | step () |
| void | step (int steps) |
| void | setGravity (Translation3d gravity) |
| void | setGravity (double gxMetersPerSecondSquared, double gyMetersPerSecondSquared, double gzMetersPerSecondSquared) |
| void | close () |
Thin Java wrapper around the native physics world implementation.
|
inline |
Creates a native physics world.
| fixedDtSeconds | fixed simulation timestep in seconds |
| enableGravity | whether gravity is enabled for newly created bodies |
|
inline |
Registers a callback that runs after each successful physics step.
| listener | callback invoked after step() completes |
|
inline |
|
inline |
Creates a new body with the provided mass in kilograms.
| massKg | the body mass in kilograms |
|
inline |
Creates a spherical gamepiece with default physical parameters.
|
inline |
Creates a new generic gamepiece in the world.
Current native support is spherical hitboxes. Additional hitbox types can be added without changing the top-level gamepiece abstraction.
| radiusMeters | sphere radius in meters |
| massKg | gamepiece mass in kilograms |
| restitution | coefficient of restitution in [0, 1] |
|
inline |
Convenience overload for creating a typed gamepiece with default physical parameters.
| type | the gamepiece type to create |
|
inline |
Creates a new gamepiece with an explicit type tag.
| type | gamepiece type enum |
| radiusMeters | sphere radius in meters |
| massKg | mass in kilograms |
| restitution | coefficient of restitution |
|
inline |
Convenience overload for creating a named gamepiece type with default physical parameters.
| typeName | human readable type name (e.g. "generic_sphere", "fuel_rebuilt_2026") |
|
inline |
Creates a new named gamepiece type (useful for season definitions or CAD-imported types).
| typeName | human readable type name (e.g. "generic_sphere", "fuel_rebuilt_2026") |
| radiusMeters | sphere radius in meters |
| massKg | mass in kilograms |
| restitution | coefficient of restitution |
|
inline |
Returns gamepieces created through this world wrapper in insertion order.
|
inline |
Gets the world linear velocity for the given body.
| bodyIndex | native body index |
|
inline |
Gets the world orientation for the given body.
| bodyIndex | native body index |
|
inline |
Gets the world position for the given body.
| bodyIndex | native body index |
|
inline |
Exports full body state blocks.
Layout per body is: [x, y, z, qw, qx, qy, qz, vx, vy, vz, wx, wy, wz].
| outState13 | destination array sized for N*13 entries |
|
inline |
Returns the fixed timestep configured for this world.
|
inline |
Gets the world linear velocity for the given gamepiece.
| gamepieceIndex | native gamepiece index |
|
inline |
Gets the world position for the given gamepiece.
| gamepieceIndex | native gamepiece index |
|
inline |
Returns the registered type name for the given gamepiece.
| gamepieceIndex | native gamepiece index |
|
inline |
Returns a reasonable default maximum number of bodies to export for telemetry.
Callers may use this value when constructing publishers that snapshot world state.
|
inline |
Returns the native world handle for interop (primarily for publishers).
This is intentionally provided so callers can create native-backed helpers like telemetry publishers that require the raw handle.
|
inline |
Outtakes a gamepiece from a pose with a linear velocity.
| gamepieceIndex | native gamepiece index |
| px | launch x position in meters |
| py | launch y position in meters |
| pz | launch z position in meters |
| vx | launch x velocity in meters per second |
| vy | launch y velocity in meters per second |
| vz | launch z velocity in meters per second |
|
inline |
Requests pickup of a gamepiece into a carrier.
| gamepieceIndex | native gamepiece index |
| intakeX | intake world x position |
| intakeY | intake world y position |
| intakeZ | intake world z position |
| captureRadius | pickup radius in meters |
| carryOffsetX | carry offset x in meters |
| carryOffsetY | carry offset y in meters |
| carryOffsetZ | carry offset z in meters |
|
inline |
Places a gamepiece at the given world position and marks it grounded.
| gamepieceIndex | native gamepiece index |
| xMeters | x position in meters |
| yMeters | y position in meters |
| zMeters | z position in meters |
|
inline |
Sets the gamepiece's world-space linear velocity in meters per second.
| gamepieceIndex | native gamepiece index |
| vxMetersPerSecond | x velocity in meters per second |
| vyMetersPerSecond | y velocity in meters per second |
| vzMetersPerSecond | z velocity in meters per second |
|
inline |
Sets the gamepiece's world-space position in meters.
| gamepieceIndex | native gamepiece index |
| xMeters | x position in meters |
| yMeters | y position in meters |
| zMeters | z position in meters |
|
inline |
Applies gravity components to the world.
| gxMetersPerSecondSquared | x gravity in meters per second squared |
| gyMetersPerSecondSquared | y gravity in meters per second squared |
| gzMetersPerSecondSquared | z gravity in meters per second squared |
|
inline |
Applies a gravity vector to the world.
| gravity | gravity vector in meters per second squared |
|
inline |
Advances the simulation by one step.
|
inline |
Advances the simulation by the requested number of steps.
| steps | number of steps to advance |