CenterOfMassSetter
A class in Root.Township, the global namespace.
Sets a rigidbody's centre of mass and keeps its inertia tensor sane. Hand adds a temporary one to held pickups and removes it once they're let go.
- Listed in Global namespace: C to D
- Inherits or implements
MonoBehaviour
Constructors
| Member | What it is |
|---|---|
CenterOfMassSetter() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
4 private and internal fields
Properties
| Member | What it is |
|---|---|
Vector3 CenterOfMass { get; set; } | The rigidbody's centre of mass. Setting it also fixes NaN or infinite inertia tensors and raises the Y tensor if isFixingTensor is on. |
bool IsTemporary { get; set; } | Marks a setter that Hand added at runtime, so it is removed when the pickup is released. |
Rigidbody Rigidbody { get; } | The rigidbody on this object. If there is none, the component destroys itself. |
1 private and internal property
Methods
| Member | What it is |
|---|---|
void SetDestroy() | Schedules this component for removal at end of frame, or removes it at once if inactive. |
5 private and internal methods
Used in
Members of other types that take, return or hold a CenterOfMassSetter: