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

Represents a cylinder collision shape aligned with the Y axis. More...

#include <cylinder.hpp>

Inheritance diagram for frcsim::Cylinder:
frcsim::Shape

Public Member Functions

 Cylinder (double radius, double halfHeight)
 Constructs a new Cylinder.
virtual ~Cylinder ()=default
ShapeType GetType () const override
 Gets the exact type of this shape.
double CalculateVolume () const override
 Calculates the volume of the specific shape.
Vector3 CalculateLocalInertia (double mass) const override
 Computes the diagonal of the local inertia tensor for this shape given a mass.
double GetRadius () const
 Gets the radius of the cylinder.
double GetHalfHeight () const
 Gets the half-height of the cylinder.
Public Member Functions inherited from frcsim::Shape
virtual ~Shape ()=default

Detailed Description

Represents a cylinder collision shape aligned with the Y axis.

Constructor & Destructor Documentation

◆ Cylinder()

frcsim::Cylinder::Cylinder ( double radius,
double halfHeight )
inline

Constructs a new Cylinder.

Parameters
radiusThe radius of the cylinder base in meters.
halfHeightHalf the height of the cylinder along the Y axis in meters.

◆ ~Cylinder()

virtual frcsim::Cylinder::~Cylinder ( )
virtualdefault

Member Function Documentation

◆ CalculateLocalInertia()

Vector3 frcsim::Cylinder::CalculateLocalInertia ( double mass) const
inlineoverridevirtual

Computes the diagonal of the local inertia tensor for this shape given a mass.

Parameters
massThe mass of the rigid body attached to this shape in kg.
Returns
A Vector3 representing the moments of inertia (Ixx, Iyy, Izz).

Implements frcsim::Shape.

◆ CalculateVolume()

double frcsim::Cylinder::CalculateVolume ( ) const
inlineoverridevirtual

Calculates the volume of the specific shape.

Returns
The geometric volume in cubic meters.

Implements frcsim::Shape.

◆ GetHalfHeight()

double frcsim::Cylinder::GetHalfHeight ( ) const
inline

Gets the half-height of the cylinder.

Returns
Half the total height (Y-axis extents) in meters.

◆ GetRadius()

double frcsim::Cylinder::GetRadius ( ) const
inline

Gets the radius of the cylinder.

Returns
The radius in meters.

◆ GetType()

ShapeType frcsim::Cylinder::GetType ( ) const
inlineoverridevirtual

Gets the exact type of this shape.

Returns
The ShapeType enum value corresponding to the derived class.

Implements frcsim::Shape.


The documentation for this class was generated from the following file:
  • src/main/driver/include/frcsim/collision_shapes/cylinder.hpp