{{Quote|Transform math is difficult, so I just use parents to solve my problems|[[User:989onan|989onan]]}}
Look at is a component that is used to make one [[slot]] point to look at another slot via a SwingTwist interpolation.
Look at is a component that is used to make one [[slot]] point to look at another slot via a SwingTwist interpolation.
Swing Twist is a concept that is too complicated to explain on this wiki, but essentially constrains the rotation on two axies when rotating to a point, locking it within a range. kind of like a turret.
Swing Twist is a concept that is too complicated to explain on this wiki, but essentially constrains the rotation on two axies when rotating to a point, locking it within a range. kind of like a turret.
{{Note|Be aware where you put this component in your slot hierarchy, as this component wants to be under the same slot (observer) that is looking at your target. If this is not the case, you might expect some local transform logical errors, like objects shaking as it fights its own rotation.|warning}}
<!--T:2-->
<!--T:2-->
Line 20:
Line 23:
|SwingReference|Float3| The axis to apply "Swing" rotation to.
|SwingReference|Float3| The axis to apply "Swing" rotation to.
|TwistReference|Float3| The axis to apply "Twist" rotation to.
|TwistReference|Float3| The axis to apply "Twist" rotation to.
|MaxSwing|Float| The maximum (pos/neg) amount that the slot can rotate on <code>SwingReference</code>
|MaxSwing|Float| The maximum (pos/neg) amount that the slot can rotate on <code>SwingReference</code>
|MaxTwist|Float| The maximum (pos/neg) amount that the slot can rotate on <code>TwistReference</code>
|MaxTwist|Float| The maximum (pos/neg) amount that the slot can rotate on <code>TwistReference</code>
|_target|{{RootFieldType|FieldDrive`1|[[Type:FloatQ|FloatQ]]}}|TypeAdv9=true| The field to apply the rotation result to.
|_target|{{RootFieldType|FieldDrive`1|[[Type:FloatQ|FloatQ]]}}|TypeAdv9=true| The field to apply the rotation result to.
}}
== Sync Delegates ==
{{Table ComponentTriggers
|SetReferenceAxis:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| Called when the set reference axis button is touched.
Look at is a component that is used to make one slot point to look at another slot via a SwingTwist interpolation.
Swing Twist is a concept that is too complicated to explain on this wiki, but essentially constrains the rotation on two axies when rotating to a point, locking it within a range. kind of like a turret.
Be aware where you put this component in your slot hierarchy, as this component wants to be under the same slot (observer) that is looking at your target. If this is not the case, you might expect some local transform logical errors, like objects shaking as it fights its own rotation.
Called when the set reference axis button is touched.
Usage
Attach the component to a slot and provide a Target or TargetPoint to make it look at or point at a position. It is recommended to put a slot under this component's slot to apply offsets to the rotation.
Examples
This can be used to make a piston base and rod look at each other to stay connected when the piston moves. this can also be used to make a tracking system.