Class MassAffector
Simple mass affector implementation that contributes a fixed mass at its transform position to the vehicle's center of mass calculations.
Implements
Namespace: NWH.Common.CoM
Assembly: NWH.Common.dll
Syntax
public class MassAffector : MonoBehaviour, IMassAffector
Remarks
Use this component for static mass contributions like passengers, cargo, or equipment. For dynamic masses like fuel tanks, create a custom IMassAffector implementation that returns varying mass values.
Fields
| Edit this page View Sourcemass
Mass contribution of this affector in kilograms.
Declaration
public float mass
Field Value
| Type | Description |
|---|---|
| float |
Methods
| Edit this page View SourceGetMass()
Returns the mass of this affector.
Declaration
public float GetMass()
Returns
| Type | Description |
|---|---|
| float | Mass in kilograms. |
GetTransform()
Returns the transform of this mass affector.
Declaration
public Transform GetTransform()
Returns
| Type | Description |
|---|---|
| Transform |
GetWorldCenterOfMass()
Returns the world position of this mass affector's center of mass.
Declaration
public Vector3 GetWorldCenterOfMass()
Returns
| Type | Description |
|---|---|
| Vector3 |