Class Bone
Represents a single animated transform in the rigging system. Can rotate to look at targets and stretch/scale to match distances for visual representation of mechanical linkages.
Namespace: NWH.Aerodynamics
Assembly: NWH.Aerodynamics.dll
Syntax
[Serializable]
public class Bone
Remarks
Bones are used to animate control surfaces, hydraulic actuators, linkages, and other aircraft components. Common use cases:
- Control surface rotation (aileron/elevator/rudder deflection visualization)
- Landing gear struts (stretch with suspension compression)
- Hydraulic actuators (stretch/compress with surface movement)
- Cables and pushrods (stretch between attachment points) Bones update each frame to track their target transforms providing real-time visual feedback.
Fields
| Edit this page View SourcedoubleSided
When true, positions this bone midway between targetTransform and targetTransformB. Used for symmetric components like center-mounted control surfaces or double-ended actuators.
Declaration
[Tooltip("Should the object be positioned between two points. Also affects position besides rotation.")]
public bool doubleSided
Field Value
| Type | Description |
|---|---|
| bool |
lookAtTarget
When true, rotates this bone to point toward targetTransform. Used to visualize control surface deflections and actuator angles.
Declaration
[Tooltip("Should the object be rotated to look at the target?")]
public bool lookAtTarget
Field Value
| Type | Description |
|---|---|
| bool |
stretchToTarget
When true, scales this bone along its local Z-axis to span the distance to targetTransform. Used for hydraulic rams, pushrods, and suspension struts that change length.
Declaration
[Tooltip("Should the object be stretched between pivot and target?")]
public bool stretchToTarget
Field Value
| Type | Description |
|---|---|
| bool |
targetTransform
Primary target transform. Bone will rotate toward this target (if lookAtTarget) and/or stretch to reach it (if stretchToTarget). For control surfaces, this is typically the control surface transform driven by input deflections.
Declaration
[Tooltip("The transform that represents the lookAtTarget and stretch target.")]
public Transform targetTransform
Field Value
| Type | Description |
|---|---|
| Transform |
targetTransformB
Secondary target transform used only when doubleSided is true. Bone will be positioned midway between targetTransform and targetTransformB. Used for double-acting actuators or symmetric linkages.
Declaration
[Tooltip(" Second target. Object will be stretched positioned between targetTransform and targetTransformB if doubleSided is\r\n true.")]
public Transform targetTransformB
Field Value
| Type | Description |
|---|---|
| Transform |
thisTransform
The transform of this bone that will be animated. This is the visual representation (mesh, linkage, actuator) that moves to reflect aircraft state.
Declaration
[Tooltip("The transform that represents the bone.")]
public Transform thisTransform
Field Value
| Type | Description |
|---|---|
| Transform |
Methods
| Edit this page View SourceInitialize()
Initializes the bone by storing initial distance and scale. Called once during rigging setup to establish reference values for stretch calculations.
Declaration
public void Initialize()
Update(Vector3, Vector3)
Updates the bone's position, rotation, and scale based on current target positions. Called each frame by the Rigging system to animate the bone.
Declaration
public void Update(Vector3 forward, Vector3 up)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | forward | Aircraft forward direction for reference frame (currently unused) |
| Vector3 | up | Aircraft up direction used as rotation axis when looking at target |