Box2D  3.0.0
A Real-Time-Oriented 2-D Physics Engine
Public Member Functions | Public Attributes | List of all members
box2d::MassData Struct Reference

Mass data. More...

#include <MassData.hpp>

Public Member Functions

 MassData ()=default
 
constexpr MassData (Mass m, Length2D c, RotInertia i) noexcept
 Initializing constructor. More...
 

Public Attributes

Length2D center
 The position of the shape's centroid relative to the shape's origin. More...
 
Mass mass
 Mass of the shape in kilograms. This should NEVER be a negative value. More...
 
RotInertia I
 Rotational inertia, a.k.a. moment of inertia. More...
 

Detailed Description

Mass data.

This holds the mass data computed for a shape.

Note
This data structure is 16-bytes large (on at least one 64-bit platform).

Constructor & Destructor Documentation

◆ MassData() [1/2]

box2d::MassData::MassData ( )
default

◆ MassData() [2/2]

constexpr box2d::MassData::MassData ( Mass  m,
Length2D  c,
RotInertia  i 
)
inlinenoexcept

Initializing constructor.

Parameters
mNon-negative mass in kg.
cPosition of the shape's centroid relative to the shape's origin.
iNon-negative rotational inertia of the shape about the local origin.

Member Data Documentation

◆ center

Length2D box2d::MassData::center

The position of the shape's centroid relative to the shape's origin.

◆ I

RotInertia box2d::MassData::I

Rotational inertia, a.k.a. moment of inertia.

This is the rotational inertia of the shape about the local origin. This should NEVER be a negative value.

Note
Behavior is undefined if this value is negative.
See also
https://en.wikipedia.org/wiki/Moment_of_inertia

◆ mass

Mass box2d::MassData::mass

Mass of the shape in kilograms. This should NEVER be a negative value.

Note
Behavior is undefined if this value is negative.

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