Unofficial LSL Reference

[[types:rotation]]


Unofficial LSL reference

User Tools

Login

You are currently not logged in! Enter your authentication credentials below to log in. You need to have cookies enabled to log in.

Login

Forgotten your password? Get a new one: Set new password

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

types:rotation [2015-09-22 09:34 SLT]
sei Add note on <0,0,0,0> vs <0,0,0,1> and talk about ZERO_ROTATION
types:rotation [2015-09-22 10:16 SLT] (current)
sei change tutorial link to point to articles
Line 2: Line 2:
  
 <WRAP round info>​**IMPORTANT:​**\\ <WRAP round info>​**IMPORTANT:​**\\
-Please note that this is **NOT** an introductory text on rotations, but a reference on the usage of the rotation type in LSL. If you want to learn on rotations, you may want to check the [[/​rotations]] tutorial.+Please note that this is **NOT** an introductory text on rotations, but a reference on the usage of the rotation type in LSL. If you want to learn on rotations, you may want to check the $lart[Rotations] tutorial.
 </​WRAP>​ </​WRAP>​
 ===== Rotation type ===== ===== Rotation type =====
Line 41: Line 41:
 === Inverse of a rotation === === Inverse of a rotation ===
  
-The rotation that cancels a given rotation can be obtained by negating the **s** component. Unfortunately,​ LSL does not support an operand ​that does this, so it has to be done by hand. For example: ''<​q.x,​ q.y, q.z, -q.s>''​ is the inverse rotation of **q**, or if you want to invert the variable you can do: ''​q.s = -q.s;''​+The rotation that cancels a given rotation can be obtained by negating the **s** component. Unfortunately,​ LSL does not support an operator ​that does this, so it has to be done by hand. For example: ''<​q.x,​ q.y, q.z, -q.s>''​ is the inverse rotation of **q**, or if you want to invert the variable you can do: ''​q.s = -q.s;''​
  
 === Type casting a quaternion === === Type casting a quaternion ===
Line 49: Line 49:
   * ''​(rotation)rotation_value''​ does nothing special to the value, as expected.   * ''​(rotation)rotation_value''​ does nothing special to the value, as expected.
   * ''​(rotation)string_value''​ is supported; see $lty[string#​Type casting of strings] for details.   * ''​(rotation)string_value''​ is supported; see $lty[string#​Type casting of strings] for details.
-  * ''​(string)rotation_value''​ is supported too; see $lty[float#Precision] for details.+  * ''​(string)rotation_value''​ is supported too; see $lty[float#Type casting a float to string] for details.
   * ''​(list)rotation_value''​ results in a list with one single element of type $ty[rotation].   * ''​(list)rotation_value''​ results in a list with one single element of type $ty[rotation].