JSim 2026.06.01-p(1)
Loading...
Searching...
No Matches
frcsim::Ball Class Reference

Thin, backwards-friendly ball wrapper around the generic Gamepiece. More...

#include <ball_wrapper.hpp>

Inheritance diagram for frcsim::Ball:
frcsim::Gamepiece frcsim::BallPhysicsSim3D

Public Member Functions

 Ball ()=default
 Ball (const Gamepiece::Config &cfg, const Gamepiece::Properties &props)
 Gamepiece ()=default
 Gamepiece (const BallPhysicsSim3D::Config &cfg, const BallPhysicsSim3D::BallProperties &props)
Public Member Functions inherited from frcsim::Gamepiece
 Gamepiece ()=default
 Gamepiece (const BallPhysicsSim3D::Config &cfg, const BallPhysicsSim3D::BallProperties &props)
void setGamepieceState (State s)
State getGamepieceState () const
bool pick (const PickupRequest &req)
 Attempt to pick up the gamepiece into a carrier. Delegates to BallPhysicsSim3D::requestPickup and flips state to kHeld on success.
void place (const Vector3 &pos)
 Place the gamepiece at world position and mark as grounded.
void outtake (const Vector3 &muzzle_position_m, const Vector3 &muzzle_velocity_mps, const Vector3 &muzzle_spin_radps=Vector3::zero())
 Outtake (launch) the gamepiece into free flight and mark as airborne.
void step (double dt_s)
 Step wrapper that applies low-cost behavior for grounded/held.
void setTypeName (const std::string &name)
const std::string & typeName () const
bool isBall () const
 BallPhysicsSim3D ()=default
 BallPhysicsSim3D (const Config &config)
 BallPhysicsSim3D (const Config &config, const BallProperties &ball_properties)
Public Member Functions inherited from frcsim::BallPhysicsSim3D
 BallPhysicsSim3D ()=default
 BallPhysicsSim3D (const Config &config)
 BallPhysicsSim3D (const Config &config, const BallProperties &ball_properties)
const Configconfig () const
 Returns active, sanitized configuration.
void setConfig (const Config &config)
 Replaces configuration after value sanitization and clamping.
const BallPropertiesballProperties () const
 Returns active, sanitized ball properties.
void setBallProperties (const BallProperties &props)
 Replaces ball properties after sanitization.
const BallStatestate () const
 Returns current ball state.
void setState (const BallState &state)
 Replaces state and sanitizes non-finite values.
void setCarrierPose (const Vector3 &carrier_position_m, const Vector3 &carrier_velocity_mps=Vector3::zero())
 Updates carrier pose used when the ball is in held mode.
bool requestPickup (const PickupRequest &pickup_request)
 Attempts to pick up and hold the ball.
void release ()
 Releases the ball from held mode without changing velocity.
void shoot (const Vector3 &muzzle_position_m, const Vector3 &muzzle_velocity_mps, const Vector3 &muzzle_spin_radps=Vector3::zero())
 Places the ball at a muzzle pose and sets launch velocity/spin.
void step (double dt_s)
 Advances simulation by dt seconds.

Static Public Member Functions

static Ball defaultEvergreen ()

Additional Inherited Members

Public Types inherited from frcsim::Gamepiece
enum class  State { kAirborne , kGrounded , kHeld }
using Config = BallPhysicsSim3D::Config
using Properties = BallPhysicsSim3D::BallProperties

Detailed Description

Thin, backwards-friendly ball wrapper around the generic Gamepiece.

This type exists to make call sites that previously relied on BallPhysicsSim3D or Ball compile with minimal changes while encouraging new code to use the generic Gamepiece abstraction.

Constructor & Destructor Documentation

◆ Ball() [1/2]

frcsim::Ball::Ball ( )
default

◆ Ball() [2/2]

frcsim::Ball::Ball ( const Gamepiece::Config & cfg,
const Gamepiece::Properties & props )
inline

Member Function Documentation

◆ defaultEvergreen()

Ball frcsim::Ball::defaultEvergreen ( )
inlinestatic

Convenience factory returning an evergreen default ball.

◆ Gamepiece() [1/2]

◆ Gamepiece() [2/2]


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