Triangle

A triangle.

Constructors

this
this(graphene_triangle_t* graphene_triangle, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this()

Allocates a new #graphene_triangle_t.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

containsPoint
bool containsPoint(Point3D p)

Checks whether the given triangle @t contains the point @p.

equal
bool equal(Triangle b)

Checks whether the two given #graphene_triangle_t are equal.

free
void free()

Frees the resources allocated by graphene_triangle_alloc().

getArea
float getArea()

Computes the area of the given #graphene_triangle_t.

getBarycoords
bool getBarycoords(Point3D p, Vec2 res)

Computes the barycentric coordinates of the given point @p.

getBoundingBox
void getBoundingBox(Box res)

Computes the bounding box of the given #graphene_triangle_t.

getMidpoint
void getMidpoint(Point3D res)

Computes the coordinates of the midpoint of the given #graphene_triangle_t.

getNormal
void getNormal(Vec3 res)

Computes the normal vector of the given #graphene_triangle_t.

getPlane
void getPlane(Plane res)

Computes the plane based on the vertices of the given #graphene_triangle_t.

getPoints
void getPoints(Point3D a, Point3D b, Point3D c)

Retrieves the three vertices of the given #graphene_triangle_t and returns their coordinates as #graphene_point3d_t.

getStruct
void* getStruct()

the main Gtk struct as a void*

getTriangleStruct
graphene_triangle_t* getTriangleStruct(bool transferOwnership)

Get the main Gtk struct

getUv
bool getUv(Point3D p, Vec2 uvA, Vec2 uvB, Vec2 uvC, Vec2 res)

Computes the UV coordinates of the given point @p.

getVertices
void getVertices(Vec3 a, Vec3 b, Vec3 c)

Retrieves the three vertices of the given #graphene_triangle_t.

initFromFloat
Triangle initFromFloat(float[3] a, float[3] b, float[3] c)

Initializes a #graphene_triangle_t using the three given arrays of floating point values, each representing the coordinates of a point in 3D space.

initFromPoint3d
Triangle initFromPoint3d(Point3D a, Point3D b, Point3D c)

Initializes a #graphene_triangle_t using the three given 3D points.

initFromVec3
Triangle initFromVec3(Vec3 a, Vec3 b, Vec3 c)

Initializes a #graphene_triangle_t using the three given vectors.

Static functions

getType
GType getType()

Variables

graphene_triangle
graphene_triangle_t* graphene_triangle;

the main Gtk struct

ownedRef
bool ownedRef;
Undocumented in source.

Meta