NWH Common
Search Results for

    Show / Hide Table of Contents

    Class MassAffector

    Simple mass affector implementation that contributes a fixed mass at its transform position to the vehicle's center of mass calculations.

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    MassAffector
    Implements
    IMassAffector
    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 Source

    mass

    Mass contribution of this affector in kilograms.

    Declaration
    public float mass
    Field Value
    Type Description
    float

    Methods

    | Edit this page View Source

    GetMass()

    Returns the mass of this affector.

    Declaration
    public float GetMass()
    Returns
    Type Description
    float

    Mass in kilograms.

    | Edit this page View Source

    GetTransform()

    Returns the transform of this mass affector.

    Declaration
    public Transform GetTransform()
    Returns
    Type Description
    Transform
    | Edit this page View Source

    GetWorldCenterOfMass()

    Returns the world position of this mass affector's center of mass.

    Declaration
    public Vector3 GetWorldCenterOfMass()
    Returns
    Type Description
    Vector3

    Implements

    IMassAffector
    • Edit this page
    • View Source
    In this article
    Back to top Copyright © NWH - Vehicle Physics, Aerodynamics, Dynamic Water Physics