Package ch.bailu.gtk.graphene
Class Vec4
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.type.Record
ch.bailu.gtk.graphene.Vec4
- All Implemented Interfaces:
PointerInterface
A structure capable of holding a vector with four dimensions: x, y, z, and w.
The contents of the #graphene_vec4_t structure are private and should
never be accessed directly.
The contents of the #graphene_vec4_t structure are private and should
never be accessed directly.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds each component of the two given vectors.static Vec4Allocates a new #graphene_vec4_t structure.voidDivides each component of the first operand @a by the corresponding
component of the second operand @b, and places the results into the
vector @res.floatComputes the dot product of the two given vectors.booleanChecks whether the two given #graphene_vec4_t are equal.voidfree()Frees the resources allocated by @vstatic ClassHandlerstatic intstatic longstatic TypeSystem.TypeSizestatic longstatic TypeSystem.TypeSizefloatgetW()Retrieves the value of the fourth component of the given #graphene_vec4_t.floatgetX()Retrieves the value of the first component of the given #graphene_vec4_t.voidCreates a #graphene_vec2_t that contains the first two components
of the given #graphene_vec4_t.voidCreates a #graphene_vec3_t that contains the first three components
of the given #graphene_vec4_t.floatgetY()Retrieves the value of the second component of the given #graphene_vec4_t.floatgetZ()Retrieves the value of the third component of the given #graphene_vec4_t.init(float x, float y, float z, float w) Initializes a #graphene_vec4_t using the given values.initFromVec2(Vec2 src, float z, float w) Initializes a #graphene_vec4_t using the components of a
#graphene_vec2_t and the values of @z and @w.initFromVec3(Vec3 src, float w) Initializes a #graphene_vec4_t using the components of a
#graphene_vec3_t and the value of @w.initFromVec4(Vec4 src) Initializes a #graphene_vec4_t using the components of
another #graphene_vec4_t.voidinterpolate(Vec4 v2, double factor, Vec4 res) Linearly interpolates @v1 and @v2 using the given @factor.floatlength()Computes the length of the given #graphene_vec4_t.voidCompares each component of the two given vectors and creates a
vector that contains the maximum values.voidCompares each component of the two given vectors and creates a
vector that contains the minimum values.voidMultiplies each component of the two given vectors.booleanCompares the two given #graphene_vec4_t vectors and checks
whether their values are within the given @epsilon.voidNegates the given #graphene_vec4_t.voidNormalizes the given #graphene_vec4_t.static Vec4one()Retrieves a pointer to a #graphene_vec4_t with all its
components set to 1.voidMultiplies all components of the given vector with the given scalar @factor.voidSubtracts from each component of the first operand @a the
corresponding component of the second operand @b and places
each result into the components of @res.voidStores the components of the given #graphene_vec4_t into an array
of floating point values.static Vec4wAxis()Retrieves a pointer to a #graphene_vec4_t with its
components set to (0, 0, 0, 1).static Vec4xAxis()Retrieves a pointer to a #graphene_vec4_t with its
components set to (1, 0, 0, 0).static Vec4yAxis()Retrieves a pointer to a #graphene_vec4_t with its
components set to (0, 1, 0, 0).static Vec4zAxis()Retrieves a pointer to a #graphene_vec4_t with its
components set to (0, 0, 1, 0).static Vec4zero()Retrieves a pointer to a #graphene_vec4_t with all its
components set to 0.Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacksMethods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNullMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Constructor Details
-
Vec4
-
-
Method Details
-
getClassHandler
-
allocVec4
Allocates a new #graphene_vec4_t structure.
The contents of the returned structure are undefined.
Use graphene_vec4_init() to initialize the vector.- Returns:
- the newly allocated #graphene_vec4_t structure. Use graphene_vec4_free() to free the resources allocated by this function.
-
add
Adds each component of the two given vectors.- Parameters:
b- a #graphene_vec4_tres- return location for the resulting vector
-
divide
Divides each component of the first operand @a by the corresponding
component of the second operand @b, and places the results into the
vector @res.- Parameters:
b- a #graphene_vec4_tres- return location for the resulting vector
-
dot
Computes the dot product of the two given vectors.- Parameters:
b- a #graphene_vec4_t- Returns:
- the value of the dot product
-
equal
Checks whether the two given #graphene_vec4_t are equal.- Parameters:
v2- a #graphene_vec4_t- Returns:
- `true` if the two vectors are equal, and false otherwise
-
free
public void free()Frees the resources allocated by @v -
getW
public float getW()Retrieves the value of the fourth component of the given #graphene_vec4_t.- Returns:
- the value of the fourth component
-
getX
public float getX()Retrieves the value of the first component of the given #graphene_vec4_t.- Returns:
- the value of the first component
-
getXy
Creates a #graphene_vec2_t that contains the first two components
of the given #graphene_vec4_t.- Parameters:
res- return location for a #graphene_vec2_t
-
getXyz
Creates a #graphene_vec3_t that contains the first three components
of the given #graphene_vec4_t.- Parameters:
res- return location for a graphene_vec3_t
-
getY
public float getY()Retrieves the value of the second component of the given #graphene_vec4_t.- Returns:
- the value of the second component
-
getZ
public float getZ()Retrieves the value of the third component of the given #graphene_vec4_t.- Returns:
- the value of the third component
-
init
Initializes a #graphene_vec4_t using the given values.
This function can be called multiple times.- Parameters:
x- the X field of the vectory- the Y field of the vectorz- the Z field of the vectorw- the W field of the vector- Returns:
- a pointer to the initialized vector
-
initFromVec2
Initializes a #graphene_vec4_t using the components of a
#graphene_vec2_t and the values of @z and @w.- Parameters:
src- a #graphene_vec2_tz- the value for the third component of @vw- the value for the fourth component of @v- Returns:
- the initialized vector
-
initFromVec3
Initializes a #graphene_vec4_t using the components of a
#graphene_vec3_t and the value of @w.- Parameters:
src- a #graphene_vec3_tw- the value for the fourth component of @v- Returns:
- the initialized vector
-
initFromVec4
Initializes a #graphene_vec4_t using the components of
another #graphene_vec4_t.- Parameters:
src- a #graphene_vec4_t- Returns:
- the initialized vector
-
interpolate
Linearly interpolates @v1 and @v2 using the given @factor.- Parameters:
v2- a #graphene_vec4_tfactor- the interpolation factorres- the interpolated vector
-
length
public float length()Computes the length of the given #graphene_vec4_t.- Returns:
- the length of the vector
-
max
Compares each component of the two given vectors and creates a
vector that contains the maximum values.- Parameters:
b- a #graphene_vec4_tres- return location for the result vector
-
min
Compares each component of the two given vectors and creates a
vector that contains the minimum values.- Parameters:
b- a #graphene_vec4_tres- return location for the result vector
-
multiply
Multiplies each component of the two given vectors.- Parameters:
b- a #graphene_vec4_tres- return location for the resulting vector
-
near
Compares the two given #graphene_vec4_t vectors and checks
whether their values are within the given @epsilon.- Parameters:
v2- a #graphene_vec4_tepsilon- the threshold between the two vectors- Returns:
- `true` if the two vectors are near each other
-
negate
Negates the given #graphene_vec4_t.- Parameters:
res- return location for the result vector
-
normalize
Normalizes the given #graphene_vec4_t.- Parameters:
res- return location for the normalized vector
-
scale
Multiplies all components of the given vector with the given scalar @factor.- Parameters:
factor- the scalar factorres- return location for the result vector
-
subtract
Subtracts from each component of the first operand @a the
corresponding component of the second operand @b and places
each result into the components of @res.- Parameters:
b- a #graphene_vec4_tres- return location for the resulting vector
-
toFloat
Stores the components of the given #graphene_vec4_t into an array
of floating point values.- Parameters:
dest- return location for an array of floating point values
-
one
Retrieves a pointer to a #graphene_vec4_t with all its
components set to 1.- Returns:
- a constant vector
-
wAxis
Retrieves a pointer to a #graphene_vec4_t with its
components set to (0, 0, 0, 1).- Returns:
- a constant vector
-
xAxis
Retrieves a pointer to a #graphene_vec4_t with its
components set to (1, 0, 0, 0).- Returns:
- a constant vector
-
yAxis
Retrieves a pointer to a #graphene_vec4_t with its
components set to (0, 1, 0, 0).- Returns:
- a constant vector
-
zAxis
Retrieves a pointer to a #graphene_vec4_t with its
components set to (0, 0, 1, 0).- Returns:
- a constant vector
-
zero
Retrieves a pointer to a #graphene_vec4_t with all its
components set to 0.- Returns:
- a constant vector
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-