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

Classes

enum  Mode

Public Member Functions

 GamepieceZone (Object ignored)
SimRobot getRobot ()
String getName ()
Transform3d[] getZoneDimensions ()
Rotation3d getRobotRotation ()
void setMode (Mode mode)
void disable ()
void setExitParameters (LinearVelocity velocity, Rotation3d rotation)
void setExitParameters (LinearVelocity velocity)
void intake (LinearVelocity velocity, Rotation3d rotation)
void outtake (LinearVelocity velocity, Rotation3d rotation)
void shoot (LinearVelocity velocity, Rotation3d rotation)
void configure (Supplier< Mode > modeSupplier, Supplier< LinearVelocity > exitVelocitySupplier, Supplier< Rotation3d > exitRotationSupplier)
LinearVelocity getExitRate ()
LinearVelocity getExitVelocity ()
Rotation3d getExitRotation ()
Translation3d getExitTranslation ()
void refresh ()
void update ()
void configure (Mode mode, Supplier< Boolean > enter, Supplier< Boolean > exit, Supplier< Double > exitRateMetersPerSecondSupplier, Supplier< Rotation3d > rot, Supplier< Translation3d > trans)
void evaluate ()
Mode getMode ()

Static Public Member Functions

static Transform3d[] createZoneDimensions (Rotation3d rotation, Translation3d... translations)

Detailed Description

Simulation-side gamepiece interaction zone.

Constructor & Destructor Documentation

◆ GamepieceZone()

jsim.api.GamepieceZone.GamepieceZone ( Object ignored)
inline

Compatibility constructor for example code that passes null.

Parameters
ignoredcompatibility placeholder

Member Function Documentation

◆ configure() [1/2]

void jsim.api.GamepieceZone.configure ( Mode mode,
Supplier< Boolean > enter,
Supplier< Boolean > exit,
Supplier< Double > exitRateMetersPerSecondSupplier,
Supplier< Rotation3d > rot,
Supplier< Translation3d > trans )
inline

Configures a rule-driven zone state.

Parameters
modethe mode to activate while the enter condition is true
entersupplies whether the zone should activate
exitsupplies whether the zone should disable
exitRateMetersPerSecondSuppliersupplies the exit rate in meters per second
rotsupplies the exit rotation
transsupplies the exit translation

◆ configure() [2/2]

void jsim.api.GamepieceZone.configure ( Supplier< Mode > modeSupplier,
Supplier< LinearVelocity > exitVelocitySupplier,
Supplier< Rotation3d > exitRotationSupplier )
inline

Installs suppliers used to refresh the zone state each simulation step.

Parameters
modeSuppliersupplies the active mode
exitVelocitySuppliersupplies the exit velocity
exitRotationSuppliersupplies the exit rotation

◆ createZoneDimensions()

Transform3d[] jsim.api.GamepieceZone.createZoneDimensions ( Rotation3d rotation,
Translation3d... translations )
inlinestatic

Helper to build an array of transform dimensions from a shared rotation and a list of translations. This is a small convenience for example code and users constructing zones.

Parameters
rotationthe rotation to apply to every translation
translationsthe vertex translations defining the zone polygon
Returns
transforms with the provided rotation applied to each translation

◆ disable()

void jsim.api.GamepieceZone.disable ( )
inline

Disables gamepiece interaction for this zone.

◆ evaluate()

void jsim.api.GamepieceZone.evaluate ( )
inline

Evaluates rule-driven zone updates.

If a rule's enter condition is true, the zone is set to the rule's mode and its exit parameters are refreshed from the configured suppliers. If the exit condition is true, the zone is disabled.

◆ getExitRate()

LinearVelocity jsim.api.GamepieceZone.getExitRate ( )
inline

Returns the cached exit rate.

Returns
exit rate as a linear velocity

◆ getExitRotation()

Rotation3d jsim.api.GamepieceZone.getExitRotation ( )
inline

Returns the configured or supplier-provided exit rotation.

Returns
exit rotation

◆ getExitTranslation()

Translation3d jsim.api.GamepieceZone.getExitTranslation ( )
inline

Returns the configured exit translation.

Returns
exit translation

◆ getExitVelocity()

LinearVelocity jsim.api.GamepieceZone.getExitVelocity ( )
inline

Returns the configured or supplier-provided exit velocity.

Returns
exit velocity

◆ getMode()

Mode jsim.api.GamepieceZone.getMode ( )
inline

Returns the currently active zone mode.

Returns
active mode, or the supplier-provided mode when configured

◆ getName()

String jsim.api.GamepieceZone.getName ( )
inline

Returns the configured zone name.

Returns
the zone name, or null if unnamed

◆ getRobot()

SimRobot jsim.api.GamepieceZone.getRobot ( )
inline

Returns the robot that owns this zone.

Returns
the owning robot, or null for compatibility instances

◆ getRobotRotation()

Rotation3d jsim.api.GamepieceZone.getRobotRotation ( )
inline

Returns the zone rotation relative to the robot frame.

Returns
robot-relative rotation

◆ getZoneDimensions()

Transform3d[] jsim.api.GamepieceZone.getZoneDimensions ( )
inline

Returns a copy of the zone polygon transforms.

Returns
cloned zone dimension transforms

◆ intake()

void jsim.api.GamepieceZone.intake ( LinearVelocity velocity,
Rotation3d rotation )
inline

Enables intake mode with the provided exit settings.

Parameters
velocityexit speed
rotationexit orientation

◆ outtake()

void jsim.api.GamepieceZone.outtake ( LinearVelocity velocity,
Rotation3d rotation )
inline

Enables outtake mode with the provided exit settings.

Parameters
velocityexit speed
rotationexit orientation

◆ refresh()

void jsim.api.GamepieceZone.refresh ( )
inline

Refreshes the zone mode from the configured supplier, if present.

◆ setExitParameters() [1/2]

void jsim.api.GamepieceZone.setExitParameters ( LinearVelocity velocity)
inline

Sets exit parameters using a velocity and zero rotation.

Parameters
velocityexit speed

◆ setExitParameters() [2/2]

void jsim.api.GamepieceZone.setExitParameters ( LinearVelocity velocity,
Rotation3d rotation )
inline

Sets exit parameters using a velocity and explicit rotation.

Parameters
velocityexit speed
rotationexit orientation

◆ setMode()

void jsim.api.GamepieceZone.setMode ( Mode mode)
inline

Sets the zone mode directly.

Parameters
modethe new zone mode

◆ shoot()

void jsim.api.GamepieceZone.shoot ( LinearVelocity velocity,
Rotation3d rotation )
inline

Enables shoot mode with the provided exit settings.

Parameters
velocityexit speed
rotationexit orientation

◆ update()

void jsim.api.GamepieceZone.update ( )
inline

Advances the zone state for one simulation tick.


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