graphene.triangle

Module for [Triangle] class

class Triangle

Types 1

A triangle.

Methods
void * _cPtr(Flag!"Dup" dup = No.Dup) nothrow
GType _getGType() static nothrow
GType _gType() @property nothrow
Triangle self() nothrowReturns `this`, for use in `with` statements.
graphene.triangle.Triangle alloc() static nothrowAllocates a new #graphene_triangle_t.
bool containsPoint(graphene.point3_d.Point3D p) nothrowChecks whether the given triangle `t` contains the point `p`.
bool equal(graphene.triangle.Triangle b) nothrowChecks whether the two given #graphene_triangle_t are equal.
float getArea() nothrowComputes the area of the given #graphene_triangle_t. Returns: the area of the triangle
bool getBarycoords(graphene.point3_d.Point3D p, out graphene.vec2.Vec2 res) nothrowComputes the [barycentric coordinates](http://en.wikipedia.org/wiki/Barycentric_coordinate_system) of the given point `p`.
void getBoundingBox(out graphene.box.Box res) nothrowComputes the bounding box of the given #graphene_triangle_t.
void getMidpoint(out graphene.point3_d.Point3D res) nothrowComputes the coordinates of the midpoint of the given #graphene_triangle_t.
void getNormal(out graphene.vec3.Vec3 res) nothrowComputes the normal vector of the given #graphene_triangle_t.
void getPlane(out graphene.plane.Plane res) nothrowComputes the plane based on the vertices of the given #graphene_triangle_t.
void getPoints(out graphene.point3_d.Point3D a, out graphene.point3_d.Point3D b, out graphene.point3_d.Point3D c) nothrowRetrieves the three vertices of the given #graphene_triangle_t and returns their coordinates as #graphene_point3d_t.
bool getUv(graphene.point3_d.Point3D p, graphene.vec2.Vec2 uvA, graphene.vec2.Vec2 uvB, graphene.vec2.Vec2 uvC, out graphene.vec2.Vec2 res) nothrowComputes the UV coordinates of the given point `p`.
void getVertices(out graphene.vec3.Vec3 a, out graphene.vec3.Vec3 b, out graphene.vec3.Vec3 c) nothrowRetrieves the three vertices of the given #graphene_triangle_t.
graphene.triangle.Triangle initFromFloat(float[] a, float[] b, float[] c) nothrowInitializes a #graphene_triangle_t using the three given arrays of floating point values, each representing the coordinates of a point in 3D space.
graphene.triangle.Triangle initFromPoint3d(graphene.point3_d.Point3D a, graphene.point3_d.Point3D b, graphene.point3_d.Point3D c) nothrowInitializes a #graphene_triangle_t using the three given 3D points.
graphene.triangle.Triangle initFromVec3(graphene.vec3.Vec3 a = null, graphene.vec3.Vec3 b = null, graphene.vec3.Vec3 c = null) nothrowInitializes a #graphene_triangle_t using the three given vectors.
Constructors
this()Create a `triangle.Triangle` boxed type.
this(void * ptr, Flag!"Take" take)