Dynamic Water Physics 2
Search Results for

    Show / Hide Table of Contents

    Class ShipInputHandler

    Manages ship input by retrieving values from active ShipInputProviders and storing them in ShipInputStates. Automatically polls all registered input providers and combines their inputs. Can be disabled for manual input control via scripting or AI.

    Inheritance
    object
    ShipInputHandler
    Namespace: NWH.DWP2.ShipController
    Assembly: NWH.DWP2.dll
    Syntax
    [Serializable]
    public class ShipInputHandler

    Fields

    | Edit this page View Source

    autoSetInput

    When enabled input will be auto-retrieved from the InputProviders present in the scene. Disable to manualy set the input through external scripts, i.e. AI controller.

    Declaration
    [Tooltip("When enabled input will be auto-retrieved from the InputProviders present in the scene.\r\nDisable to manualy set the input through external scripts, i.e. AI controller.")]
    public bool autoSetInput
    Field Value
    Type Description
    bool
    | Edit this page View Source

    modifyInputCallback

    Callback invoked after input is processed each frame. Use this to modify input values programmatically before they are used.

    Declaration
    public UnityEvent modifyInputCallback
    Field Value
    Type Description
    UnityEvent
    | Edit this page View Source

    states

    All the input states of the vehicle. Can be used to set input through scripting or copy the inputs over from other vehicle, such as truck to trailer.

    Declaration
    [Tooltip("All the input states of the vehicle. Can be used to set input through scripting or copy the inputs\r\nover from other vehicle, such as truck to trailer.")]
    public ShipInputStates states
    Field Value
    Type Description
    ShipInputStates

    Properties

    | Edit this page View Source

    Anchor

    Anchor toggle state. True for one frame when anchor input is pressed.

    Declaration
    public bool Anchor { get; set; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    BowThruster

    Bow thruster input from -1 to 1.

    Declaration
    public float BowThruster { get; set; }
    Property Value
    Type Description
    float
    | Edit this page View Source

    EngineStartStop

    Engine start/stop toggle state. True for one frame when toggle input is pressed.

    Declaration
    public bool EngineStartStop { get; set; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    RotateSail

    Sail rotation input for sailing vessels.

    Declaration
    public float RotateSail { get; set; }
    Property Value
    Type Description
    float
    | Edit this page View Source

    Steering

    Steering input from -1 (port/left) to 1 (starboard/right).

    Declaration
    public float Steering { get; set; }
    Property Value
    Type Description
    float
    | Edit this page View Source

    SternThruster

    Stern thruster input from -1 to 1.

    Declaration
    public float SternThruster { get; set; }
    Property Value
    Type Description
    float
    | Edit this page View Source

    SubmarineDepth

    Submarine depth control from -1 (surface) to 1 (dive). Clamped to [-1, 1].

    Declaration
    public float SubmarineDepth { get; set; }
    Property Value
    Type Description
    float
    | Edit this page View Source

    Throttle

    Primary throttle input from -1 (full reverse) to 1 (full forward).

    Declaration
    public float Throttle { get; set; }
    Property Value
    Type Description
    float
    | Edit this page View Source

    Throttle2

    Secondary throttle for independent engine control.

    Declaration
    public float Throttle2 { get; set; }
    Property Value
    Type Description
    float
    | Edit this page View Source

    Throttle3

    Tertiary throttle for independent engine control.

    Declaration
    public float Throttle3 { get; set; }
    Property Value
    Type Description
    float
    | Edit this page View Source

    Throttle4

    Quaternary throttle for independent engine control.

    Declaration
    public float Throttle4 { get; set; }
    Property Value
    Type Description
    float

    Methods

    | Edit this page View Source

    Update()

    Updates all input values from registered input providers. Called automatically by AdvancedShipController.

    Declaration
    public void Update()
    • Edit this page
    • View Source
    In this article
    Back to top Copyright © NWH - Vehicle Physics, Aerodynamics, Dynamic Water Physics