A triangle.
function Contains_Point
(Self : not null access Graphene_Triangle_T;
P : not null access Graphene.Point3d.Graphene_Point3D_T)
return Boolean
Checks whether the given triangle T contains the point P. Since: gtk+ 1.2
a Graphene.Point3d.Graphene_Point3D_T
true if the point is inside the triangle
function Equal
(Self : not null access Graphene_Triangle_T;
B : not null access Graphene_Triangle_T) return Boolean
Checks whether the two given Graphene.Triangle.Graphene_Triangle_T are equal. Since: gtk+ 1.2
a Graphene.Triangle.Graphene_Triangle_T
true if the triangles are equal
procedure Free (Self : not null access Graphene_Triangle_T)
Frees the resources allocated by graphene_triangle_alloc. Since: gtk+ 1.2
function From_Object_Free
(B : not null access Graphene_Triangle_T) return Graphene_Triangle_T
Return the underlying object and free the pointer. This is meant to be used internally by GtkAda, and should not in general be called by user code.
function Get_Area
(Self : not null access Graphene_Triangle_T)
return Interfaces.C.C_float
Computes the area of the given Graphene.Triangle.Graphene_Triangle_T. Since: gtk+ 1.2
the area of the triangle
function Get_Barycoords
(Self : not null access Graphene_Triangle_T;
P : access Graphene.Point3d.Graphene_Point3D_T;
Res : not null access Graphene.Vec2.Graphene_Vec2_T) return Boolean
Computes the barycentric 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 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.Graphene_Vec2_T contains the following values, in order:
res.x = u - res.y = v
Since: gtk+ 1.2
a Graphene.Point3d.Graphene_Point3D_T
return location for the vector with the barycentric coordinates
true if the barycentric coordinates are valid
procedure Get_Bounding_Box
(Self : not null access Graphene_Triangle_T;
Res : not null access Graphene.Box.Graphene_Box_T)
Computes the bounding box of the given Graphene.Triangle.Graphene_Triangle_T. Since: gtk+ 1.2
return location for the box
procedure Get_Midpoint
(Self : not null access Graphene_Triangle_T;
Res : not null access Graphene.Point3d.Graphene_Point3D_T)
Computes the coordinates of the midpoint of the given Graphene.Triangle.Graphene_Triangle_T. The midpoint G is the centroid of the triangle, i.e. the intersection of its medians. Since: gtk+ 1.2
return location for the coordinates of the midpoint
procedure Get_Normal
(Self : not null access Graphene_Triangle_T;
Res : not null access Graphene.Vec3.Graphene_Vec3_T)
Computes the normal vector of the given Graphene.Triangle.Graphene_Triangle_T. Since: gtk+ 1.2
return location for the normal vector
procedure Get_Plane
(Self : not null access Graphene_Triangle_T;
Res : not null access Graphene.Plane.Graphene_Plane_T)
Computes the plane based on the vertices of the given Graphene.Triangle.Graphene_Triangle_T. Since: gtk+ 1.2
return location for the plane
procedure Get_Points
(Self : not null access Graphene_Triangle_T;
A : not null access Graphene.Point3d.Graphene_Point3D_T;
B : not null access Graphene.Point3d.Graphene_Point3D_T;
C : not null access Graphene.Point3d.Graphene_Point3D_T)
Retrieves the three vertices of the given Graphene.Triangle.Graphene_Triangle_T and returns their coordinates as Graphene.Point3d.Graphene_Point3D_T. Since: gtk+ 1.2
return location for the coordinates of the first vertex
return location for the coordinates of the second vertex
return location for the coordinates of the third vertex
function Get_Type return Glib.GType
function Get_Uv
(Self : not null access Graphene_Triangle_T;
P : access Graphene.Point3d.Graphene_Point3D_T;
Uv_A : not null access Graphene.Vec2.Graphene_Vec2_T;
Uv_B : not null access Graphene.Vec2.Graphene_Vec2_T;
Uv_C : not null access Graphene.Vec2.Graphene_Vec2_T;
Res : not null access Graphene.Vec2.Graphene_Vec2_T) return Boolean
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 Since: gtk+ 1.10
a Graphene.Point3d.Graphene_Point3D_T
the UV coordinates of the first point
the UV coordinates of the second point
the UV coordinates of the third point
a vector containing the UV coordinates of the given point P
true if the coordinates are valid
procedure Get_Vertices
(Self : not null access Graphene_Triangle_T;
A : not null access Graphene.Vec3.Graphene_Vec3_T;
B : not null access Graphene.Vec3.Graphene_Vec3_T;
C : not null access Graphene.Vec3.Graphene_Vec3_T)
Retrieves the three vertices of the given Graphene.Triangle.Graphene_Triangle_T. Since: gtk+ 1.2
return location for the first vertex
return location for the second vertex
return location for the third vertex
type Graphene_Triangle_T is record
A : Graphene.Vec3.Graphene_Vec3_T;
B : Graphene.Vec3.Graphene_Vec3_T;
C : Graphene.Vec3.Graphene_Vec3_T;
end record;
A triangle.
function Init_From_Point3D
(Self : not null access Graphene_Triangle_T;
A : access Graphene.Point3d.Graphene_Point3D_T;
B : access Graphene.Point3d.Graphene_Point3D_T;
C : access Graphene.Point3d.Graphene_Point3D_T)
return access Graphene_Triangle_T
Initializes a Graphene.Triangle.Graphene_Triangle_T using the three given 3D points. Since: gtk+ 1.2
a Graphene.Point3d.Graphene_Point3D_T
a Graphene.Point3d.Graphene_Point3D_T
a Graphene.Point3d.Graphene_Point3D_T
the initialized Graphene.Triangle.Graphene_Triangle_T
function Init_From_Vec3
(Self : not null access Graphene_Triangle_T;
A : access Graphene.Vec3.Graphene_Vec3_T;
B : access Graphene.Vec3.Graphene_Vec3_T;
C : access Graphene.Vec3.Graphene_Vec3_T)
return access Graphene_Triangle_T
Initializes a Graphene.Triangle.Graphene_Triangle_T using the three given vectors. Since: gtk+ 1.2
a Graphene.Vec3.Graphene_Vec3_T
a Graphene.Vec3.Graphene_Vec3_T
a Graphene.Vec3.Graphene_Vec3_T
the initialized Graphene.Triangle.Graphene_Triangle_T