2021-04-16 17:10:15 +02:00
|
|
|
|
[Planck.js API Doc](../README.md) › [Globals](../globals.md) › [MassData](massdata.md)
|
|
|
|
|
|
|
|
|
|
|
|
# Class: MassData
|
|
|
|
|
|
|
|
|
|
|
|
MassData This holds the mass data computed for a shape.
|
|
|
|
|
|
|
|
|
|
|
|
## Hierarchy
|
|
|
|
|
|
|
|
|
|
|
|
* **MassData**
|
|
|
|
|
|
|
|
|
|
|
|
## Index
|
|
|
|
|
|
|
|
|
|
|
|
### Properties
|
|
|
|
|
|
|
|
|
|
|
|
* [I](massdata.md#i)
|
|
|
|
|
|
* [center](massdata.md#center)
|
|
|
|
|
|
* [mass](massdata.md#mass)
|
|
|
|
|
|
|
|
|
|
|
|
## Properties
|
|
|
|
|
|
|
|
|
|
|
|
### I
|
|
|
|
|
|
|
|
|
|
|
|
• **I**: *number* = 0
|
|
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/dynamics/Body.ts:140](https://github.com/shakiba/planck.js/blob/acc3bd8/src/dynamics/Body.ts#L140)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
The rotational inertia of the shape about the local origin.
|
|
|
|
|
|
|
|
|
|
|
|
___
|
|
|
|
|
|
|
|
|
|
|
|
### center
|
|
|
|
|
|
|
2021-05-02 17:18:33 -07:00
|
|
|
|
• **center**: *[Vec2](vec2.md)‹›* = Vec2.zero()
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/dynamics/Body.ts:138](https://github.com/shakiba/planck.js/blob/acc3bd8/src/dynamics/Body.ts#L138)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
The position of the shape's centroid relative to the shape's origin.
|
|
|
|
|
|
|
|
|
|
|
|
___
|
|
|
|
|
|
|
|
|
|
|
|
### mass
|
|
|
|
|
|
|
|
|
|
|
|
• **mass**: *number* = 0
|
|
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/dynamics/Body.ts:136](https://github.com/shakiba/planck.js/blob/acc3bd8/src/dynamics/Body.ts#L136)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
The mass of the shape, usually in kilograms.
|