Class AirfoilTransform
Lightweight transform replacement for airfoil positioning and orientation calculations. Provides efficient local-to-world coordinate transformations without the overhead of Unity's Transform component.
Namespace: NWH.Aerodynamics.Airfoils
Assembly: NWH.Aerodynamics.dll
Syntax
[Serializable]
public class AirfoilTransform
Constructors
| Edit this page View SourceAirfoilTransform()
Declaration
public AirfoilTransform()
AirfoilTransform(Transform)
Creates a new AirfoilTransform with the specified parent transform.
Declaration
public AirfoilTransform(Transform t)
Parameters
| Type | Name | Description |
|---|---|---|
| Transform | t | Parent transform to use as reference. |
Fields
| Edit this page View Sourcetransform
Parent Unity Transform used as reference for coordinate transformations.
Declaration
public Transform transform
Field Value
| Type | Description |
|---|---|
| Transform |
Properties
| Edit this page View SourceForward
Gets or sets the forward direction vector in world space. Setting this value updates the rotation to look in the specified direction.
Declaration
public Vector3 Forward { get; set; }
Property Value
| Type | Description |
|---|---|
| Vector3 |
Position
Gets or sets the world space position. Automatically converts between world and local coordinates using the parent transform.
Declaration
public Vector3 Position { get; set; }
Property Value
| Type | Description |
|---|---|
| Vector3 |
Right
Gets or sets the right direction vector in world space. Setting this value updates the rotation to align the right axis with the specified direction.
Declaration
public Vector3 Right { get; set; }
Property Value
| Type | Description |
|---|---|
| Vector3 |
Rotation
Gets or sets the world space rotation. Automatically converts between world and local rotation using the parent transform.
Declaration
public Quaternion Rotation { get; set; }
Property Value
| Type | Description |
|---|---|
| Quaternion |
Up
Gets or sets the up direction vector in world space. Setting this value updates the rotation to align the up axis with the specified direction.
Declaration
public Vector3 Up { get; set; }
Property Value
| Type | Description |
|---|---|
| Vector3 |
localPosition
Gets or sets the local position relative to the parent transform. Setting this value automatically updates the transformation matrices.
Declaration
public Vector3 localPosition { get; set; }
Property Value
| Type | Description |
|---|---|
| Vector3 |
localRotation
Gets or sets the local rotation relative to the parent transform. Setting this value automatically updates the transformation matrices.
Declaration
public Quaternion localRotation { get; set; }
Property Value
| Type | Description |
|---|---|
| Quaternion |
Methods
| Edit this page View SourceInitialize(Transform)
Initializes the AirfoilTransform with a parent transform and updates transformation matrices.
Declaration
public void Initialize(Transform t)
Parameters
| Type | Name | Description |
|---|---|---|
| Transform | t | Parent transform to use as reference. |
InverseTransformDirection(Vector3)
Transforms a direction vector from world space to local space and normalizes the result.
Declaration
public Vector3 InverseTransformDirection(Vector3 value)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | value | Direction in world coordinates. |
Returns
| Type | Description |
|---|---|
| Vector3 | Normalized direction in local coordinates. |
InverseTransformPoint(Vector3)
Transforms a point from world space to local space.
Declaration
public Vector3 InverseTransformPoint(Vector3 point)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | point | Point in world coordinates. |
Returns
| Type | Description |
|---|---|
| Vector3 | Point in local coordinates. |
InverseTransformVector(Vector3)
Transforms a vector from world space to local space using rotation only.
Declaration
public Vector3 InverseTransformVector(Vector3 value)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | value | Vector in world coordinates. |
Returns
| Type | Description |
|---|---|
| Vector3 | Vector in local coordinates. |
TransformDirection(Vector3)
Transforms a direction vector from local space to world space and normalizes the result.
Declaration
public Vector3 TransformDirection(Vector3 value)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | value | Direction in local coordinates. |
Returns
| Type | Description |
|---|---|
| Vector3 | Normalized direction in world coordinates. |
TransformPoint(Vector3)
Transforms a point from local space to world space.
Declaration
public Vector3 TransformPoint(Vector3 point)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | point | Point in local coordinates. |
Returns
| Type | Description |
|---|---|
| Vector3 | Point in world coordinates. |
TransformVector(Vector3)
Transforms a vector from local space to world space using rotation only.
Declaration
public Vector3 TransformVector(Vector3 value)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | value | Vector in local coordinates. |
Returns
| Type | Description |
|---|---|
| Vector3 | Vector in world coordinates. |
UpdateTRSMatrix()
Updates the local-to-world and world-to-local transformation matrices. Call this after modifying local position or rotation to ensure accurate coordinate transformations.
Declaration
public void UpdateTRSMatrix()