JSim 2026.06.01-p(1)
Loading...
Searching...
No Matches
shape.hpp
Go to the documentation of this file.
1// Copyright (c) JSim contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the LGPLv3 license file in the root directory of this project.
4
5#pragma once
6
8
9namespace frcsim {
10
21
28class Shape {
29public:
30 virtual ~Shape() = default;
31
36 virtual ShapeType GetType() const = 0;
37
42 virtual double CalculateVolume() const = 0;
43
49 virtual Vector3 CalculateLocalInertia(double mass) const = 0;
50};
51
52} // namespace frcsim
Base class for all collision geometries in the physics engine.
Definition shape.hpp:28
virtual ~Shape()=default
virtual Vector3 CalculateLocalInertia(double mass) const =0
Computes the diagonal of the local inertia tensor for this shape given a mass.
virtual double CalculateVolume() const =0
Calculates the volume of the specific shape.
virtual ShapeType GetType() const =0
Gets the exact type of this shape.
Definition vector.hpp:13
ShapeType
Enum identifying the specific types of collision shapes available.
Definition shape.hpp:14
@ MESH
Definition shape.hpp:18
@ UNKNOWN
Definition shape.hpp:19
@ SPHERE
Definition shape.hpp:16
@ CYLINDER
Definition shape.hpp:17
@ BOX
Definition shape.hpp:15
3D vector utility used throughout JSim physics.
Definition vector.hpp:22