public class MassData

  1. Object
  2. MassData
This holds the mass data computed for a shape.

Fields

public float massThe mass of the shape, usually in kilograms.
public final Vec2 centerThe position of the shape’s centroid relative to the shape’s origin.
public float IThe rotational inertia of the shape about the local origin.

Constructors

public MassData()Blank mass data
public MassData(MassData md)Copies from the given mass data

Methods

public void set(MassData md)
public MassData clone()Return a copy of this object.

Inherited methods

Field details

mass

public float mass
The mass of the shape, usually in kilograms.

center

public final Vec2 center
The position of the shape’s centroid relative to the shape’s origin.

I

public float I
The rotational inertia of the shape about the local origin.

Constructor details

MassData

public MassData()
Blank mass data

MassData

public MassData(MassData md)
Copies from the given mass data

Parameters

md MassData
mass data to copy from

Method details

set

public void set(MassData md)

clone

public MassData clone()
Return a copy of this object.