Class Rudder
Represents a ship rudder that rotates based on steering input. Provides visual rotation only - actual steering forces are applied by WaterObject components on the rudder itself. Multiple rudders can be used on a single ship.
Namespace: NWH.DWP2.ShipController
Assembly: NWH.DWP2.dll
Syntax
[Serializable]
public class Rudder
Fields
| Edit this page View SourcelocalRotationAxis
Axis around which the rudder will be rotated.
Declaration
[Tooltip("Axis around which the rudder will be rotated.")]
public Vector3 localRotationAxis
Field Value
| Type | Description |
|---|---|
| Vector3 |
maxAngle
Max angle in degrees rudder will be able to reach.
Declaration
[Tooltip("Max angle in degrees rudder will be able to reach.")]
public float maxAngle
Field Value
| Type | Description |
|---|---|
| float |
name
Name of the rudder. Can be any string.
Declaration
[Tooltip("Name of the rudder. Can be any string.")]
public string name
Field Value
| Type | Description |
|---|---|
| string |
rotationSpeed
Rotation speed in degrees per second.
Declaration
[Tooltip("Rotation speed in degrees per second.")]
public float rotationSpeed
Field Value
| Type | Description |
|---|---|
| float |
rudderTransform
Transform representing the rudder.
Declaration
[Tooltip("Transform representing the rudder.")]
public Transform rudderTransform
Field Value
| Type | Description |
|---|---|
| Transform |
Properties
| Edit this page View SourceAngle
Current angle of the rudder in degrees. Positive angles indicate starboard turn, negative angles indicate port turn.
Declaration
public float Angle { get; }
Property Value
| Type | Description |
|---|---|
| float |
AnglePercent
Current rudder angle as a normalized value between -1 and 1.
Declaration
public float AnglePercent { get; }
Property Value
| Type | Description |
|---|---|
| float |
Methods
| Edit this page View SourceInitialize(AdvancedShipController)
Initializes the rudder with a reference to its parent ship controller.
Declaration
public void Initialize(AdvancedShipController sc)
Parameters
| Type | Name | Description |
|---|---|---|
| AdvancedShipController | sc | The ship controller this rudder belongs to. |
Update()
Declaration
public virtual void Update()