Package ch.bailu.gtk.graphene
Klasse Triangle
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.type.Record
ch.bailu.gtk.graphene.Triangle
- Alle implementierten Schnittstellen:
PointerInterface
A triangle.
-
Feldübersicht
Felder -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic TriangleAllocates a new #graphene_triangle_t.booleanChecks whether the given triangle @t contains the point @p.booleanChecks whether the two given #graphene_triangle_t are equal.voidfree()Frees the resources allocated by graphene_triangle_alloc().floatgetArea()Computes the area of the given #graphene_triangle_t.booleangetBarycoords(Point3D p, Vec2 res) Computes the [barycentric coordinates](http://en.wikipedia.org/wiki/Barycentric_coordinate_system)
of the given point @p.voidgetBoundingBox(Box res) Computes the bounding box of the given #graphene_triangle_t.static ClassHandlerstatic intvoidgetMidpoint(Point3D res) Computes the coordinates of the midpoint of the given #graphene_triangle_t.voidComputes the normal vector of the given #graphene_triangle_t.static longstatic TypeSystem.TypeSizevoidComputes the plane based on the vertices of the given #graphene_triangle_t.voidRetrieves the three vertices of the given #graphene_triangle_t and returns
their coordinates as #graphene_point3d_t.static longstatic TypeSystem.TypeSizebooleanComputes the UV coordinates of the given point @p.voidgetVertices(Vec3 a, Vec3 b, Vec3 c) Retrieves the three vertices of the given #graphene_triangle_t.initFromPoint3d(Point3D a, Point3D b, Point3D c) Initializes a #graphene_triangle_t using the three given 3D points.initFromVec3(Vec3 a, Vec3 b, Vec3 c) Initializes a #graphene_triangle_t using the three given vectors.Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacksVon Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNullVon Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitVon Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Felddetails
-
A
Private field: direct-type- Siehe auch:
-
B
Private field: direct-type- Siehe auch:
-
C
Private field: direct-type- Siehe auch:
-
-
Konstruktordetails
-
Triangle
-
Triangle
public Triangle()
-
-
Methodendetails
-
getClassHandler
-
allocTriangle
Allocates a new #graphene_triangle_t.
The contents of the returned structure are undefined.- Gibt zurück:
- the newly allocated #graphene_triangle_t structure. Use graphene_triangle_free() to free the resources allocated by this function
-
containsPoint
Checks whether the given triangle @t contains the point @p.- Parameter:
p- a #graphene_point3d_t- Gibt zurück:
- `true` if the point is inside the triangle
-
equal
Checks whether the two given #graphene_triangle_t are equal.- Parameter:
b- a #graphene_triangle_t- Gibt zurück:
- `true` if the triangles are equal
-
free
public void free()Frees the resources allocated by graphene_triangle_alloc(). -
getArea
public float getArea()Computes the area of the given #graphene_triangle_t.- Gibt zurück:
- the area of the triangle
-
getBarycoords
Computes the [barycentric coordinates](http://en.wikipedia.org/wiki/Barycentric_coordinate_system)
of the given point @p.
The point @p must lie on the same plane as the triangle @t; if the
point is not coplanar, the result of this function is undefined.
If we place the origin in the coordinates of the triangle's A point,
the barycentric coordinates are `u`, which is on the AC vector; and `v`
which is on the AB vector:

The returned #graphene_vec2_t contains the following values, in order:
- `res.x = u`
- `res.y = v`- Parameter:
p- a #graphene_point3d_tres- return location for the vector with the barycentric coordinates- Gibt zurück:
- `true` if the barycentric coordinates are valid
-
getBoundingBox
Computes the bounding box of the given #graphene_triangle_t.- Parameter:
res- return location for the box
-
getMidpoint
Computes the coordinates of the midpoint of the given #graphene_triangle_t.
The midpoint G is the [centroid](https://en.wikipedia.org/wiki/Centroid#Triangle_centroid)
of the triangle, i.e. the intersection of its medians.- Parameter:
res- return location for the coordinates of the midpoint
-
getNormal
Computes the normal vector of the given #graphene_triangle_t.- Parameter:
res- return location for the normal vector
-
getPlane
Computes the plane based on the vertices of the given #graphene_triangle_t.- Parameter:
res- return location for the plane
-
getPoints
Retrieves the three vertices of the given #graphene_triangle_t and returns
their coordinates as #graphene_point3d_t.- Parameter:
a- return location for the coordinates of the first vertexb- return location for the coordinates of the second vertexc- return location for the coordinates of the third vertex
-
getUv
public boolean getUv(@Nullable Point3D p, @Nonnull Vec2 uv_a, @Nonnull Vec2 uv_b, @Nonnull Vec2 uv_c, @Nonnull Vec2 res) Computes the UV coordinates of the given point @p.
The point @p must lie on the same plane as the triangle @t; if the point
is not coplanar, the result of this function is undefined. If @p is %NULL,
the point will be set in (0, 0, 0).
The UV coordinates will be placed in the @res vector:
- `res.x = u`
- `res.y = v`
See also: graphene_triangle_get_barycoords()- Parameter:
p- a #graphene_point3d_tuv_a- the UV coordinates of the first pointuv_b- the UV coordinates of the second pointuv_c- the UV coordinates of the third pointres- a vector containing the UV coordinates of the given point @p- Gibt zurück:
- `true` if the coordinates are valid
-
getVertices
Retrieves the three vertices of the given #graphene_triangle_t.- Parameter:
a- return location for the first vertexb- return location for the second vertexc- return location for the third vertex
-
initFromPoint3d
Initializes a #graphene_triangle_t using the three given 3D points.- Parameter:
a- a #graphene_point3d_tb- a #graphene_point3d_tc- a #graphene_point3d_t- Gibt zurück:
- the initialized #graphene_triangle_t
-
initFromVec3
Initializes a #graphene_triangle_t using the three given vectors.- Parameter:
a- a #graphene_vec3_tb- a #graphene_vec3_tc- a #graphene_vec3_t- Gibt zurück:
- the initialized #graphene_triangle_t
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-