Dynamic Water Physics 2
Search Results for

    Show / Hide Table of Contents

    Class AdvancedShipController

    Main controller for ships, boats and other water vessels. Manages propulsion through engines and propellers, steering via rudders, and additional control through bow/stern thrusters. Includes stabilization systems, anchor functionality, and multiplayer support. Can be used for everything from small boats to large ships.

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    Vehicle
    AdvancedShipController
    Inherited Members
    Vehicle.INPUT_DEADZONE
    Vehicle.SPEED_DEADZONE
    Vehicle.SMALL_NUMBER
    Vehicle.KINDA_SMALL_NUMBER
    Vehicle.ActiveVehicles
    Vehicle.onActiveVehicleChanged
    Vehicle.isPlayerControllable
    Vehicle.vehicleRigidbody
    Vehicle.vehicleTransform
    Vehicle.ActiveVehicle
    Vehicle.Awake()
    Vehicle.CameraInsideVehicle
    Vehicle.onCameraEnterVehicle
    Vehicle.onCameraExitVehicle
    Vehicle.onDisable
    Vehicle.onEnable
    Vehicle.MultiplayerIsRemote
    Vehicle.onMultiplayerStatusChanged
    Vehicle.localAcceleration
    Vehicle.localForwardAcceleration
    Vehicle.localForwardVelocity
    Vehicle.localVelocity
    Vehicle.Speed
    Vehicle.SpeedSigned
    Vehicle.Velocity
    Vehicle.VelocityMagnitude
    Vehicle.AngularVelocity
    Vehicle.AngularVelocityMagnitude
    Namespace: NWH.DWP2.ShipController
    Assembly: NWH.DWP2.dll
    Syntax
    [RequireComponent(typeof(Anchor))]
    [Serializable]
    [DefaultExecutionOrder(90)]
    public class AdvancedShipController : Vehicle

    Fields

    | Edit this page View Source

    dropAnchorWhenInactive

    Should the anchor be dropped when the ship is deactivated?

    Declaration
    [Tooltip("Should the anchor be dropped when the ship is deactivated?")]
    public bool dropAnchorWhenInactive
    Field Value
    Type Description
    bool
    | Edit this page View Source

    engines

    Ship's engines.

    Declaration
    [Tooltip("List of engines. Each engine is a propulsion system in itself consisting of the engine and the propeller.")]
    [SerializeField]
    public List<Engine> engines
    Field Value
    Type Description
    List<Engine>
    | Edit this page View Source

    input

    Class that handles all of the user input.

    Declaration
    [SerializeField]
    [Tooltip("Class that handles all of the user input.")]
    public ShipInputHandler input
    Field Value
    Type Description
    ShipInputHandler
    | Edit this page View Source

    maxStabilizationTorqueAngle

    Angle at which roll stabilization torque reaches maximum.

    Declaration
    [Tooltip("Angle at which roll stabilization torque reaches maximum.")]
    public float maxStabilizationTorqueAngle
    Field Value
    Type Description
    float
    | Edit this page View Source

    onShipInitialized

    Called after ship initialization.

    Declaration
    [Tooltip("Called after ship initialization.")]
    public UnityEvent onShipInitialized
    Field Value
    Type Description
    UnityEvent
    | Edit this page View Source

    pitchStabilizationMaxTorque

    Torque that will be applied to stabilize pitch when the ship pitch angle reaches maxStabilizationTorqueAngle.

    Declaration
    [Tooltip("Torque that will be applied to stabilize pitch when the ship pitch angle reaches maxStabilizationTorqueAngle.")]
    public float pitchStabilizationMaxTorque
    Field Value
    Type Description
    float
    | Edit this page View Source

    referenceWaterObject

    Declaration
    [FormerlySerializedAs("ReferenceWaterObject")]
    public WaterObject referenceWaterObject
    Field Value
    Type Description
    WaterObject
    | Edit this page View Source

    rollStabilizationMaxTorque

    Torque that will be applied to stabilize roll when the ship roll angle reaches maxStabilizationTorqueAngle.

    Declaration
    [Tooltip("Torque that will be applied to stabilize roll when the ship roll angle reaches maxStabilizationTorqueAngle.")]
    public float rollStabilizationMaxTorque
    Field Value
    Type Description
    float
    | Edit this page View Source

    rudders

    Ship's rudders.

    Declaration
    [SerializeField]
    [Tooltip("Ship's rudders.")]
    public List<Rudder> rudders
    Field Value
    Type Description
    List<Rudder>
    | Edit this page View Source

    stabilizePitch

    Should the ship pitch be stabilized?

    Declaration
    [Tooltip("Should the ship pitch be stabilized?")]
    public bool stabilizePitch
    Field Value
    Type Description
    bool
    | Edit this page View Source

    stabilizeRoll

    Should the ship roll be stabilized?

    Declaration
    [Tooltip("Should the ship roll be stabilized?")]
    public bool stabilizeRoll
    Field Value
    Type Description
    bool
    | Edit this page View Source

    thrusters

    Bow or stern thrusters that a ship has.

    Declaration
    [SerializeField]
    [Tooltip("Bow or stern thrusters that a ship has.")]
    public List<Thruster> thrusters
    Field Value
    Type Description
    List<Thruster>
    | Edit this page View Source

    weighAnchorWhenActive

    Should the anchor be weighed/lifted when the ship is activated?

    Declaration
    [Tooltip("Should the anchor be weighed/lifted when the ship is activated?")]
    public bool weighAnchorWhenActive
    Field Value
    Type Description
    bool

    Properties

    | Edit this page View Source

    Anchor

    Anchor script.

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

    SpeedKnots

    Speed in knots.

    Declaration
    public float SpeedKnots { get; }
    Property Value
    Type Description
    float

    Methods

    | Edit this page View Source

    FixedUpdate()

    Declaration
    public override void FixedUpdate()
    Overrides
    Vehicle.FixedUpdate()
    | Edit this page View Source

    GetPitchAngle()

    Returns pitch angle of the ship in degrees. Positive values indicate bow up, negative values indicate bow down.

    Declaration
    public float GetPitchAngle()
    Returns
    Type Description
    float

    Pitch angle in degrees.

    | Edit this page View Source

    GetRollAngle()

    Returns roll angle of the ship in degrees. Positive values indicate starboard side down, negative values indicate port side down.

    Declaration
    public float GetRollAngle()
    Returns
    Type Description
    float

    Roll angle in degrees.

    | Edit this page View Source

    OnDisable()

    Declaration
    public override void OnDisable()
    Overrides
    Vehicle.OnDisable()
    | Edit this page View Source

    OnEnable()

    Declaration
    public override void OnEnable()
    Overrides
    Vehicle.OnEnable()
    | Edit this page View Source

    Start()

    Declaration
    public void Start()
    | Edit this page View Source

    Update()

    Declaration
    public void Update()

    See Also

    Engine
    Rudder
    Thruster
    Anchor
    ShipInputHandler
    WaterObject
    Vehicle
    • Edit this page
    • View Source
    In this article
    Back to top Copyright © NWH - Vehicle Physics, Aerodynamics, Dynamic Water Physics