A simple way to use four of millions of dollars
The four-dollar function in Unity3d is to show rotation.
Angleaxis
Creates a rotation that rotates around an axis and returns a four-dollar number.
The opposite function is achieved with Toangleaxis.
Angle
Returns the angle between two rotation values (four yuan), which is the value of the angle of float type.
(I don't know what it's for after this value is calculated.)
Dot
I don't quite understand the point of the multiplication.
See
Eulerangles
Returns a Euler angle that represents rotation (Vector3 is 3 values)
(If an object is called, it means that the object's current position is rotated from its original position.
Actually is the inspector in the rotation 3 values)
Euler
Feeling is opposite to eulerangles (tested, yes)
The input is 3 values of Euler's angle, and returns a rotation (four-dollar number)
Fromtorotation
The parameter is two direction (VECTOR3), which returns a quaternion
I think the main purpose is to turn the object's orientation into the same direction as the B object (quaternion).
And then call transform.rotate and you can spin a to be the same as B.
Identity
Can be understood as a unit of four yuan
Inverse
is a rotation of the anti-rotation, in fact, is the rotation of the just turn back.
Lerp
Interpolation, it can be understood that the direction of an object can be turned to the same as another object, with the time can be slowly rotated.
Lookrotation
You can keep a object facing the B object.
Refer to the following article to import Thirdpersoncontroller
http://blog.csdn.net/lijing_hi/article/details/7272089
Quaternion
constructor, parameter is a value of 4 float
Rotatetowards
Like Slerp.
Setfromtorotation
Just like the Fromtorotation function, only the calling method is different.
Setlookrotation
Just like the Lookrotation function, only the calling method is different.
Slerp
Rotates an angle from the from into to.
This[int Index]
Like an array called X, Y, Z, W, it feels better to call it directly with. x.
It may be convenient for recycling.
Toangleaxis
Turn a rotation into a angle-axis form. The opposite function is achieved with Angleaxis.
Passed in angle and axis in a quoted way.
This is very similar to transform.localeulerangles.
Input: transform.localeulerangles= (0,0,0);
Output: Angle=0, axis= (1,0,0);
Input: transform.localeulerangles= (0,90,0);
Output: angle=90,axis= (0,1,0);
Input: transform.localeulerangles= (270,0,0);
Output: angle=90,axis= ( -1,0,0)
Tostring
Formatting into a string
Reference: http://blog.csdn.net/yustarg/article/details/8623687
Four USD quaternion