JSim 2026.06.01-p(1)
Loading...
Searching...
No Matches
jsim.Gamepiece Class Reference

Public Member Functions

int gamepieceIndex ()
GamePieceType type ()
void setPosition (Pose3d pose)
void setPosition (Translation3d positionMeters)
void setPosition (Vec3 positionMeters)
void setPosition (Distance x, Distance y, Distance z)
void setLinearVelocity (LinearVelocity3d velocityMps)
void setLinearVelocity (Vec3 velocityMps)
void setLinearVelocity (double vxMetersPerSecond, double vyMetersPerSecond, double vzMetersPerSecond)
void outtake (Pose3d pose, LinearVelocity3d velocityMps)
void outtake (Translation3d positionMeters, LinearVelocity3d velocityMps)
void outtake (Vec3 positionMeters, Vec3 velocityMps)
boolean pick (Pose3d intakePos, double captureRadius, Vec3 carryOffset)
void place (Translation3d pos)
Pose3d position ()
LinearVelocity3d linearVelocity ()
String typeName ()
boolean isBall ()

Protected Attributes

final PhysicsWorld world
final int gamepieceIndex
final GamePieceType type

Detailed Description

Generic handle for a gamepiece managed by PhysicsWorld.

Member Function Documentation

◆ 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()

LinearVelocity3d jsim.Gamepiece.linearVelocity ( )
inline

Gets the current world-space linear velocity in meters per second.

Returns
the gamepiece linear velocity

◆ outtake() [1/3]

void jsim.Gamepiece.outtake ( Pose3d pose,
LinearVelocity3d velocityMps )
inline

Convenience method to set both position and launch velocity.

Parameters
poselaunch position (only translation component is used)
velocityMpslaunch 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
positionMeterslaunch position in meters
velocityMpslaunch 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
positionMeterslaunch position in meters
velocityMpslaunch 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
intakePosintake world position
captureRadiuscapture radius in meters
carryOffsetoffset 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
posworld-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
vxMetersPerSecondx velocity in meters per second
vyMetersPerSecondy velocity in meters per second
vzMetersPerSecondz velocity in meters per second

◆ setLinearVelocity() [2/3]

void jsim.Gamepiece.setLinearVelocity ( LinearVelocity3d velocityMps)
inline

Sets the gamepiece world-space linear velocity in meters per second.

Parameters
velocityMpsthe 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
velocityMpsthe 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
xx position
yy position
zz position

◆ setPosition() [2/4]

void jsim.Gamepiece.setPosition ( Pose3d pose)
inline

Sets the gamepiece world-space position in meters.

Parameters
posethe 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
positionMetersthe new position in meters

◆ setPosition() [4/4]

void jsim.Gamepiece.setPosition ( Vec3 positionMeters)
inline

Sets the gamepiece world-space position in meters.

Parameters
positionMetersthe new position in meters

◆ type()

GamePieceType jsim.Gamepiece.type ( )
inline

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

Member Data Documentation

◆ gamepieceIndex

final int jsim.Gamepiece.gamepieceIndex
protected

Native index for this gamepiece in the driver.

◆ type

final GamePieceType jsim.Gamepiece.type
protected

Declared gamepiece type when created from a typed API.

◆ world

final PhysicsWorld jsim.Gamepiece.world
protected

The owning physics world for this handle.


The documentation for this class was generated from the following file: