Package ch.bailu.gtk.graphene
Class Plane
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.type.Record
ch.bailu.gtk.graphene.Plane
- All Implemented Interfaces:
PointerInterface
A 2D plane that extends infinitely in a 3D volume.
The contents of the `graphene_plane_t` are private, and should not be
modified directly.
The contents of the `graphene_plane_t` are private, and should not be
modified directly.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Plane
Allocates a new #graphene_plane_t structure.float
Computes the distance of @point from a #graphene_plane_t.boolean
Checks whether the two given #graphene_plane_t are equal.void
free()
Frees the resources allocated by graphene_plane_alloc().static ClassHandler
float
Retrieves the distance along the normal vector of the
given #graphene_plane_t from the origin.float
static int
void
Retrieves the normal vector pointing towards the origin of the
given #graphene_plane_t.static long
static TypeSystem.TypeSize
static long
static TypeSystem.TypeSize
Initializes the given #graphene_plane_t using the given @normal vector
and @constant values.initFromPlane
(Plane src) Initializes the given #graphene_plane_t using the normal
vector and constant of another #graphene_plane_t.initFromPoint
(Vec3 normal, Point3D point) Initializes the given #graphene_plane_t using the given normal vector
and an arbitrary co-planar point.initFromPoints
(Point3D a, Point3D b, Point3D c) Initializes the given #graphene_plane_t using the 3 provided co-planar
points.initFromVec4
(Vec4 src) Initializes the given #graphene_plane_t using the components of
the given #graphene_vec4_t vector.void
Negates the normal vector and constant of a #graphene_plane_t, effectively
mirroring the plane across the origin.void
Normalizes the vector of the given #graphene_plane_t,
and adjusts the constant accordingly.void
Transforms a #graphene_plane_t @p using the given @matrix
and @normal_matrix.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
-
NORMAL
Private field: direct-type- See Also:
-
CONSTANT
- See Also:
-
-
Constructor Details
-
Plane
-
Plane
public Plane()
-
-
Method Details
-
getClassHandler
-
getFieldConstant
public float getFieldConstant() -
allocPlane
Allocates a new #graphene_plane_t structure.
The contents of the returned structure are undefined.- Returns:
- the newly allocated #graphene_plane_t. Use graphene_plane_free() to free the resources allocated by this function
-
distance
Computes the distance of @point from a #graphene_plane_t.- Parameters:
point
- a #graphene_point3d_t- Returns:
- the distance of the given #graphene_point3d_t from the plane
-
equal
Checks whether the two given #graphene_plane_t are equal.- Parameters:
b
- a #graphene_plane_t- Returns:
- `true` if the given planes are equal
-
free
public void free()Frees the resources allocated by graphene_plane_alloc(). -
getConstant
public float getConstant()Retrieves the distance along the normal vector of the
given #graphene_plane_t from the origin.- Returns:
- the constant value of the plane
-
getNormal
Retrieves the normal vector pointing towards the origin of the
given #graphene_plane_t.- Parameters:
normal
- return location for the normal vector
-
init
Initializes the given #graphene_plane_t using the given @normal vector
and @constant values.- Parameters:
normal
- a unit length normal vector defining the plane pointing towards the origin; if unset, we use the X axis by defaultconstant
- the distance from the origin to the plane along the normal vector; the sign determines the half-space occupied by the plane- Returns:
- the initialized plane
-
initFromPlane
Initializes the given #graphene_plane_t using the normal
vector and constant of another #graphene_plane_t.- Parameters:
src
- a #graphene_plane_t- Returns:
- the initialized plane
-
initFromPoint
Initializes the given #graphene_plane_t using the given normal vector
and an arbitrary co-planar point.- Parameters:
normal
- a normal vector defining the plane pointing towards the originpoint
- a #graphene_point3d_t- Returns:
- the initialized plane
-
initFromPoints
Initializes the given #graphene_plane_t using the 3 provided co-planar
points.
The winding order is counter-clockwise, and determines which direction
the normal vector will point.- Parameters:
a
- a #graphene_point3d_tb
- a #graphene_point3d_tc
- a #graphene_point3d_t- Returns:
- the initialized plane
-
initFromVec4
Initializes the given #graphene_plane_t using the components of
the given #graphene_vec4_t vector.- Parameters:
src
- a #graphene_vec4_t containing the normal vector in its first three components, and the distance in its fourth component- Returns:
- the initialized plane
-
negate
Negates the normal vector and constant of a #graphene_plane_t, effectively
mirroring the plane across the origin.- Parameters:
res
- return location for the negated plane
-
normalize
Normalizes the vector of the given #graphene_plane_t,
and adjusts the constant accordingly.- Parameters:
res
- return location for the normalized plane
-
transform
Transforms a #graphene_plane_t @p using the given @matrix
and @normal_matrix.
If @normal_matrix is %NULL, a transformation matrix for the plane
normal will be computed from @matrix. If you are transforming
multiple planes using the same @matrix it's recommended to compute
the normal matrix beforehand to avoid incurring in the cost of
recomputing it every time.- Parameters:
matrix
- a #graphene_matrix_tnormal_matrix
- a #graphene_matrix_tres
- the transformed plane
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-