MassData class
class MassData { /** The mass of the shape, usually in kilograms. */ double mass; /** The position of the shape's centroid relative to the shape's origin. */ Vector2 center; /** The rotational inertia of the shape about the local origin. */ double inertia; /** * Constructs a blank mass data. */ MassData() : mass = 0.0, inertia = 0.0, center = new Vector2.zero(); /** * Copies from the given mass data. */ MassData.copy(MassData md) : mass = md.mass, inertia = md.inertia, center = new Vector2.copy(md.center) { } /** * Sets this mass data equal to the given mass data. */ void setFrom(MassData md) { mass = md.mass; inertia = md.inertia; center.setFrom(md.center); } }
Constructors
new MassData() #
Constructs a blank mass data.
MassData() : mass = 0.0, inertia = 0.0, center = new Vector2.zero();