massConfiguration
The body mass configuration comprised of the _mass, _rotationalInertia and _localCenterOfMass. Normally this is computed automatically as each PhysicsShape is added, removed or changed on a body. This will automatically change if the body type changes, for instance, a Static or Kinematic body always have zero mass and rotational inertia. The individual properties of the _massConfiguration and be accessed using _mass, _rotationalInertia and _localCenterOfMass. The PhysicsBody.MassConfiguration will be overwritten when setting this property or if PhysicsBody.ApplyMassFromShapes is called or when adding, removing or changing PhysicsShape with _startMassUpdate enabled. To make a value persist across those recalculations, override it with _massOverride; with anything overridden, setting this property authors the override values instead of writing the body directly, so overridden values persist and the rest are rederived from the attached shapes.
Read time 1 minuteLast updated 11 days ago
Definition
- Type: Property
- Namespace: Unity.U2D.Physics
- Assembly: UnityEngine.PhysicsCore2DModule
public PhysicsBody.MassConfiguration massConfiguration { get; set; }