add remaining info, thanks for filling what I needed to understand this!
(7 intermediate revisions by 3 users not shown)
Line 7:
Line 7:
|Name=Axis Rotation Aligner
|Name=Axis Rotation Aligner
}}
}}
The '''AxisRotationAligner''' can be used to keep a slot facing a direction relative to a space.
<!--T:2-->
<!--T:2-->
== Fields ==
== Fields ==
{{Table ComponentFields
{{Table ComponentFields
|LocalDirection|Float3|
|LocalDirection|Float3| A vector direction in this slot's local space to align to <code>TargetDirection</code> via rotating this slot.
|TargetDirection|Float3|
|TargetDirection|Float3| The direction vector to align to.
|LocalSpace|Slot|
|DirectionSpace|{{RootFieldType|RootSpace}}|TypeAdv2=true| The coordinate space that <code>TargetDirection</code> is in.
|UseParentSpace|Bool|
|LocalRotation|FloatQ| A rotation offset to the alignment.
|OverrideRootSpace|RootSpace|
|_rotation|{{RootFieldType|FieldDrive`1|[[Type:FloatQ|FloatQ]]}}|TypeAdv4=true| The rotation field of the slot this component is on. Is driven to do the rotation alignment.
|LocalRotation|FloatQ|
|_rotation|IField`1|TypeString4=IField<floatQ>|
}}
}}
<!--T:3-->
<!--T:3-->
== Usage ==
== Usage ==
The defined <code>LocalDirection</code> will be rotated to line up with the <code>TargetDirection</code> inside <code>DirectionSpace</code>'s coordinate space.
<!--T:4-->
<!--T:4-->
== Examples ==
== Examples ==
A common use of the '''AxisRotationAligner''' is to make a slot's upward direction always match the upward direction of root.