osg.Quat¶
-
class
osg.Quat¶ Represents: c++ class Wraps: osg::Quat A quaternion class. It can be used to represent an orientation in 3D space. There a numbers a getters/setters to control values of each quaternion’s components (e.g. getter
osg.Quat.y()and setter with the same name with value to set etc.).Constructors:
-
osg.Quat()¶
-
osg.Quat(osg.Quat other) -
Parameters: other ( osg.Quat) –
-
osg.Quat(double x, double y, double z, double w) -
Parameters: - x (
double) – - y (
double) – - z (
double) – - w (
double) –
- x (
-
osg.Quat(double angle, osg.Vec3 axis) -
Parameters: - angle (
double) – - axis (
osg.Vec3) –
- angle (
-
osg.Quat(double angle1, osg.Vec3 axis1, double angle2, osg.Vec3 axis2, double angle3, osg.Vec3 axis3) -
Parameters:
Methods:
-
:
x()¶ -
Return type: double
-
:
x(double x) -
Parameters: x ( double) –
-
:
y()¶ -
Return type: double
-
:
y(double y) -
Parameters: y ( double) –
-
:
z()¶ -
Return type: double
-
:
z(double z) -
Parameters: z ( double) –
-
:
w()¶ -
Return type: double
-
:
w(double w) -
Parameters: w ( double) –
-
:
set(double x, double y, double z, double w)¶ -
Parameters: - x (
double) – - y (
double) – - z (
double) – - w (
double) –
- x (
-
:
set(osg.Vec4 v) -
Parameters: v ( osg.Vec4) –
-
:
set(osg.Matrix m) -
Parameters: m ( osg.Matrix) –
-
:
get()¶ -
Return type: osg.Matrix
-
:
getRotate(double angle, double x, double y, double z) Return the angle and vector components represented by the quaternion.
Parameters: - angle (
double) – - x (
double) – - y (
double) – - z (
double) –
- angle (
-
:
getRotate(double angle, osg.Vec3 axis) Return the angle and vector represented by the quaternion.
Parameters: - angle (
double) – - axis (
osg.Vec3) –
- angle (
-
:
zeroRotation()¶ Return
trueif theosg.Quatrepresents a zero rotation, and therefore can be ignored in computations.Return type: bool
-
:
slerp(double t, osg.Quat q1, osg.Quat q2)¶ Spherical Linear Interpolation.
Parameters:
-
:
length()¶ Length of the quaternion =
sqrt( vec . vec ).Return type: double
-
:
length2()¶ Length of the quaternion =
vec . vec.Return type: double
-
:
makeRotate(double angle, double x, double y, double z)¶ Set a quaternion which will perform a rotation of an angle around the axis given by the vector with x, y and z components.
Parameters: - angle (
double) – - x (
double) – - y (
double) – - z (
double) –
- angle (
-
:
makeRotate(double angle, osg.Vec3 axis) Set a quaternion which will perform a rotation of an angle around the axis given by the vector.
Parameters: - angle (
double) – - axis (
osg.Vec3) –
- angle (
-
:
makeRotate(double angle1, osg.Vec3 axis1, double angle2, osg.Vec3 axis2, double angle3, osg.Vec3 axis3) -
Parameters:
-
:
makeRotate(osg.Vec3 vec1, osg.Vec3 vec2) Make a rotation
osg.Quatwhich will rotate vec1 to vec2. Generally take a dot product to get the angle between these and then use a cross product to get the rotation axis Watch out for the two special cases when the vectors are co-incident or opposite in direction.Parameters:
-