Package ch.bailu.gtk.graphene
Class Quaternion
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.type.Record
ch.bailu.gtk.graphene.Quaternion
- All Implemented Interfaces:
PointerInterface
A quaternion.
The contents of the #graphene_quaternion_t structure are private
and should never be accessed directly.
The contents of the #graphene_quaternion_t structure are private
and should never be accessed directly.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(Quaternion b, Quaternion res) Adds two #graphene_quaternion_t @a and @b.static Quaternion
Allocates a new #graphene_quaternion_t.float
dot
(Quaternion b) Computes the dot product of two #graphene_quaternion_t.boolean
equal
(Quaternion b) Checks whether the given quaternions are equal.void
free()
Releases the resources allocated by graphene_quaternion_alloc().static ClassHandler
float
float
float
float
static int
static long
static TypeSystem.TypeSize
static long
static TypeSystem.TypeSize
init
(float x, float y, float z, float w) Initializes a #graphene_quaternion_t using the given four values.initFromAngles
(float deg_x, float deg_y, float deg_z) Initializes a #graphene_quaternion_t using the values of
the [Euler angles](http://en.wikipedia.org/wiki/Euler_angles)
on each axis.initFromAngleVec3
(float angle, Vec3 axis) Initializes a #graphene_quaternion_t using an @angle on a
specific @axis.Initializes a #graphene_quaternion_t using the given #graphene_euler_t.Initializes a #graphene_quaternion_t using the rotation components
of a transformation matrix.Initializes a #graphene_quaternion_t with the values from @src.initFromRadians
(float rad_x, float rad_y, float rad_z) Initializes a #graphene_quaternion_t using the values of
the [Euler angles](http://en.wikipedia.org/wiki/Euler_angles)
on each axis.initFromVec4
(Vec4 src) Initializes a #graphene_quaternion_t with the values from @src.Initializes a #graphene_quaternion_t using the identity
transformation.void
invert
(Quaternion res) Inverts a #graphene_quaternion_t, and returns the conjugate
quaternion of @q.void
multiply
(Quaternion b, Quaternion res) Multiplies two #graphene_quaternion_t @a and @b.void
normalize
(Quaternion res) Normalizes a #graphene_quaternion_t.void
scale
(float factor, Quaternion res) Scales all the elements of a #graphene_quaternion_t @q using
the given scalar factor.void
slerp
(Quaternion b, float factor, Quaternion res) Interpolates between the two given quaternions using a spherical
linear interpolation, or [SLERP](http://en.wikipedia.org/wiki/Slerp),
using the given interpolation @factor.void
Converts a #graphene_quaternion_t to its corresponding rotations
on the [Euler angles](http://en.wikipedia.org/wiki/Euler_angles)
on each axis.void
toAngleVec3
(Flt angle, Vec3 axis) Converts a quaternion into an @angle, @axis pair.void
Converts a quaternion into a transformation matrix expressing
the rotation defined by the #graphene_quaternion_t.void
Converts a #graphene_quaternion_t to its corresponding rotations
on the [Euler angles](http://en.wikipedia.org/wiki/Euler_angles)
on each axis.void
Copies the components of a #graphene_quaternion_t into a
#graphene_vec4_t.Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Field Details
-
X
- See Also:
-
Y
- See Also:
-
Z
- See Also:
-
W
- See Also:
-
-
Constructor Details
-
Quaternion
-
Quaternion
public Quaternion()
-
-
Method Details
-
getClassHandler
-
getFieldX
public float getFieldX() -
getFieldY
public float getFieldY() -
getFieldZ
public float getFieldZ() -
getFieldW
public float getFieldW() -
allocQuaternion
Allocates a new #graphene_quaternion_t.
The contents of the returned value are undefined.- Returns:
- the newly allocated #graphene_quaternion_t
-
add
Adds two #graphene_quaternion_t @a and @b.- Parameters:
b
- a #graphene_quaternion_tres
- the result of the operation
-
dot
Computes the dot product of two #graphene_quaternion_t.- Parameters:
b
- a #graphene_quaternion_t- Returns:
- the value of the dot products
-
equal
Checks whether the given quaternions are equal.- Parameters:
b
- a #graphene_quaternion_t- Returns:
- `true` if the quaternions are equal
-
free
public void free()Releases the resources allocated by graphene_quaternion_alloc(). -
init
Initializes a #graphene_quaternion_t using the given four values.- Parameters:
x
- the first component of the quaterniony
- the second component of the quaternionz
- the third component of the quaternionw
- the fourth component of the quaternion- Returns:
- the initialized quaternion
-
initFromAngleVec3
Initializes a #graphene_quaternion_t using an @angle on a
specific @axis.- Parameters:
angle
- the rotation on a given axis, in degreesaxis
- the axis of rotation, expressed as a vector- Returns:
- the initialized quaternion
-
initFromAngles
Initializes a #graphene_quaternion_t using the values of
the [Euler angles](http://en.wikipedia.org/wiki/Euler_angles)
on each axis.
See also: graphene_quaternion_init_from_euler()- Parameters:
deg_x
- rotation angle on the X axis (yaw), in degreesdeg_y
- rotation angle on the Y axis (pitch), in degreesdeg_z
- rotation angle on the Z axis (roll), in degrees- Returns:
- the initialized quaternion
-
initFromEuler
Initializes a #graphene_quaternion_t using the given #graphene_euler_t.- Parameters:
e
- a #graphene_euler_t- Returns:
- the initialized #graphene_quaternion_t
-
initFromMatrix
Initializes a #graphene_quaternion_t using the rotation components
of a transformation matrix.- Parameters:
m
- a #graphene_matrix_t- Returns:
- the initialized quaternion
-
initFromQuaternion
Initializes a #graphene_quaternion_t with the values from @src.- Parameters:
src
- a #graphene_quaternion_t- Returns:
- the initialized quaternion
-
initFromRadians
Initializes a #graphene_quaternion_t using the values of
the [Euler angles](http://en.wikipedia.org/wiki/Euler_angles)
on each axis.
See also: graphene_quaternion_init_from_euler()- Parameters:
rad_x
- rotation angle on the X axis (yaw), in radiansrad_y
- rotation angle on the Y axis (pitch), in radiansrad_z
- rotation angle on the Z axis (roll), in radians- Returns:
- the initialized quaternion
-
initFromVec4
Initializes a #graphene_quaternion_t with the values from @src.- Parameters:
src
- a #graphene_vec4_t- Returns:
- the initialized quaternion
-
initIdentity
Initializes a #graphene_quaternion_t using the identity
transformation.- Returns:
- the initialized quaternion
-
invert
Inverts a #graphene_quaternion_t, and returns the conjugate
quaternion of @q.- Parameters:
res
- return location for the inverted quaternion
-
multiply
Multiplies two #graphene_quaternion_t @a and @b.- Parameters:
b
- a #graphene_quaternion_tres
- the result of the operation
-
normalize
Normalizes a #graphene_quaternion_t.- Parameters:
res
- return location for the normalized quaternion
-
scale
Scales all the elements of a #graphene_quaternion_t @q using
the given scalar factor.- Parameters:
factor
- a scaling factorres
- the result of the operation
-
slerp
Interpolates between the two given quaternions using a spherical
linear interpolation, or [SLERP](http://en.wikipedia.org/wiki/Slerp),
using the given interpolation @factor.- Parameters:
b
- a #graphene_quaternion_tfactor
- the linear interpolation factorres
- return location for the interpolated quaternion
-
toAngleVec3
Converts a quaternion into an @angle, @axis pair.- Parameters:
angle
- return location for the angle, in degreesaxis
- return location for the rotation axis
-
toAngles
Converts a #graphene_quaternion_t to its corresponding rotations
on the [Euler angles](http://en.wikipedia.org/wiki/Euler_angles)
on each axis.- Parameters:
deg_x
- return location for the rotation angle on the X axis (yaw), in degreesdeg_y
- return location for the rotation angle on the Y axis (pitch), in degreesdeg_z
- return location for the rotation angle on the Z axis (roll), in degrees
-
toMatrix
Converts a quaternion into a transformation matrix expressing
the rotation defined by the #graphene_quaternion_t.- Parameters:
m
- a #graphene_matrix_t
-
toRadians
Converts a #graphene_quaternion_t to its corresponding rotations
on the [Euler angles](http://en.wikipedia.org/wiki/Euler_angles)
on each axis.- Parameters:
rad_x
- return location for the rotation angle on the X axis (yaw), in radiansrad_y
- return location for the rotation angle on the Y axis (pitch), in radiansrad_z
- return location for the rotation angle on the Z axis (roll), in radians
-
toVec4
Copies the components of a #graphene_quaternion_t into a
#graphene_vec4_t.- Parameters:
res
- return location for a #graphene_vec4_t
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-