JSim 2026.06.01-p(1)
Loading...
Searching...
No Matches
frcsim::Shape Class Referenceabstract

Base class for all collision geometries in the physics engine. More...

#include <shape.hpp>

Inheritance diagram for frcsim::Shape:
frcsim::Box frcsim::Cylinder frcsim::Sphere

Public Member Functions

virtual ~Shape ()=default
virtual ShapeType GetType () const =0
 Gets the exact type of this shape.
virtual double CalculateVolume () const =0
 Calculates the volume of the specific shape.
virtual Vector3 CalculateLocalInertia (double mass) const =0
 Computes the diagonal of the local inertia tensor for this shape given a mass.

Detailed Description

Base class for all collision geometries in the physics engine.

Defines the common interface for collision detection, volume calculations, and inertial property computation.

Constructor & Destructor Documentation

◆ ~Shape()

virtual frcsim::Shape::~Shape ( )
virtualdefault

Member Function Documentation

◆ CalculateLocalInertia()

virtual Vector3 frcsim::Shape::CalculateLocalInertia ( double mass) const
pure virtual

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).

Implemented in frcsim::Box, frcsim::Cylinder, and frcsim::Sphere.

◆ CalculateVolume()

virtual double frcsim::Shape::CalculateVolume ( ) const
pure virtual

Calculates the volume of the specific shape.

Returns
The geometric volume in cubic meters.

Implemented in frcsim::Box, frcsim::Cylinder, and frcsim::Sphere.

◆ GetType()

virtual ShapeType frcsim::Shape::GetType ( ) const
pure virtual

Gets the exact type of this shape.

Returns
The ShapeType enum value corresponding to the derived class.

Implemented in frcsim::Box, frcsim::Cylinder, and frcsim::Sphere.


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