// Package graphene was automatically generated by github.com/bnema/puregotk DO NOT EDIT package graphene import ( "structs" "unsafe" "github.com/ebitengine/purego" "github.com/bnema/puregotk/pkg/core" "github.com/bnema/puregotk/v4/gobject/types" ) // A triangle. type Triangle struct { _ structs.HostLayout A uintptr B uintptr C uintptr } var xTriangleGLibType func() types.GType func TriangleGLibType() types.GType { return xTriangleGLibType() } func (x *Triangle) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } var xTriangleAlloc func() *Triangle // Allocates a new #graphene_triangle_t. // // The contents of the returned structure are undefined. func TriangleAlloc() *Triangle { cret := xTriangleAlloc() return cret } var xTriangleContainsPoint func(uintptr, *Point3D) bool // Checks whether the given triangle @t contains the point @p. func (x *Triangle) ContainsPoint(PVar *Point3D) bool { cret := xTriangleContainsPoint(x.GoPointer(), PVar) return cret } var xTriangleEqual func(uintptr, *Triangle) bool // Checks whether the two given #graphene_triangle_t are equal. func (x *Triangle) Equal(BVar *Triangle) bool { cret := xTriangleEqual(x.GoPointer(), BVar) return cret } var xTriangleFree func(uintptr) // Frees the resources allocated by graphene_triangle_alloc(). func (x *Triangle) Free() { xTriangleFree(x.GoPointer()) } var xTriangleGetArea func(uintptr) float32 // Computes the area of the given #graphene_triangle_t. func (x *Triangle) GetArea() float32 { cret := xTriangleGetArea(x.GoPointer()) return cret } var xTriangleGetBarycoords func(uintptr, *Point3D, *Vec2) bool // 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: // // ![](triangle-barycentric.png) // // The returned #graphene_vec2_t contains the following values, in order: // // - `res.x = u` // - `res.y = v` func (x *Triangle) GetBarycoords(PVar *Point3D, ResVar *Vec2) bool { cret := xTriangleGetBarycoords(x.GoPointer(), PVar, ResVar) return cret } var xTriangleGetBoundingBox func(uintptr, *Box) // Computes the bounding box of the given #graphene_triangle_t. func (x *Triangle) GetBoundingBox(ResVar *Box) { xTriangleGetBoundingBox(x.GoPointer(), ResVar) } var xTriangleGetMidpoint func(uintptr, *Point3D) // 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. func (x *Triangle) GetMidpoint(ResVar *Point3D) { xTriangleGetMidpoint(x.GoPointer(), ResVar) } var xTriangleGetNormal func(uintptr, *Vec3) // Computes the normal vector of the given #graphene_triangle_t. func (x *Triangle) GetNormal(ResVar *Vec3) { xTriangleGetNormal(x.GoPointer(), ResVar) } var xTriangleGetPlane func(uintptr, *Plane) // Computes the plane based on the vertices of the given #graphene_triangle_t. func (x *Triangle) GetPlane(ResVar *Plane) { xTriangleGetPlane(x.GoPointer(), ResVar) } var xTriangleGetPoints func(uintptr, *Point3D, *Point3D, *Point3D) // Retrieves the three vertices of the given #graphene_triangle_t and returns // their coordinates as #graphene_point3d_t. func (x *Triangle) GetPoints(AVar *Point3D, BVar *Point3D, CVar *Point3D) { xTriangleGetPoints(x.GoPointer(), AVar, BVar, CVar) } var xTriangleGetUv func(uintptr, *Point3D, *Vec2, *Vec2, *Vec2, *Vec2) bool // 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() func (x *Triangle) GetUv(PVar *Point3D, UvAVar *Vec2, UvBVar *Vec2, UvCVar *Vec2, ResVar *Vec2) bool { cret := xTriangleGetUv(x.GoPointer(), PVar, UvAVar, UvBVar, UvCVar, ResVar) return cret } var xTriangleGetVertices func(uintptr, *Vec3, *Vec3, *Vec3) // Retrieves the three vertices of the given #graphene_triangle_t. func (x *Triangle) GetVertices(AVar *Vec3, BVar *Vec3, CVar *Vec3) { xTriangleGetVertices(x.GoPointer(), AVar, BVar, CVar) } var xTriangleInitFromFloat func(uintptr, *[3]float32, *[3]float32, *[3]float32) *Triangle // Initializes a #graphene_triangle_t using the three given arrays // of floating point values, each representing the coordinates of // a point in 3D space. func (x *Triangle) InitFromFloat(AVar [3]float32, BVar [3]float32, CVar [3]float32) *Triangle { cret := xTriangleInitFromFloat(x.GoPointer(), &AVar, &BVar, &CVar) return cret } var xTriangleInitFromPoint3d func(uintptr, *Point3D, *Point3D, *Point3D) *Triangle // Initializes a #graphene_triangle_t using the three given 3D points. func (x *Triangle) InitFromPoint3d(AVar *Point3D, BVar *Point3D, CVar *Point3D) *Triangle { cret := xTriangleInitFromPoint3d(x.GoPointer(), AVar, BVar, CVar) return cret } var xTriangleInitFromVec3 func(uintptr, *Vec3, *Vec3, *Vec3) *Triangle // Initializes a #graphene_triangle_t using the three given vectors. func (x *Triangle) InitFromVec3(AVar *Vec3, BVar *Vec3, CVar *Vec3) *Triangle { cret := xTriangleInitFromVec3(x.GoPointer(), AVar, BVar, CVar) return cret } func init() { core.SetPackageName("GRAPHENE", "graphene-gobject-1.0") core.SetSharedLibraries("GRAPHENE", []string{"libgraphene-1.0.so.0"}) var libs []uintptr for _, libPath := range core.GetPaths("GRAPHENE") { lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) if err != nil { panic(err) } libs = append(libs, lib) } core.PuregoSafeRegister(&xTriangleGLibType, libs, "graphene_triangle_get_type") core.PuregoSafeRegister(&xTriangleAlloc, libs, "graphene_triangle_alloc") core.PuregoSafeRegister(&xTriangleContainsPoint, libs, "graphene_triangle_contains_point") core.PuregoSafeRegister(&xTriangleEqual, libs, "graphene_triangle_equal") core.PuregoSafeRegister(&xTriangleFree, libs, "graphene_triangle_free") core.PuregoSafeRegister(&xTriangleGetArea, libs, "graphene_triangle_get_area") core.PuregoSafeRegister(&xTriangleGetBarycoords, libs, "graphene_triangle_get_barycoords") core.PuregoSafeRegister(&xTriangleGetBoundingBox, libs, "graphene_triangle_get_bounding_box") core.PuregoSafeRegister(&xTriangleGetMidpoint, libs, "graphene_triangle_get_midpoint") core.PuregoSafeRegister(&xTriangleGetNormal, libs, "graphene_triangle_get_normal") core.PuregoSafeRegister(&xTriangleGetPlane, libs, "graphene_triangle_get_plane") core.PuregoSafeRegister(&xTriangleGetPoints, libs, "graphene_triangle_get_points") core.PuregoSafeRegister(&xTriangleGetUv, libs, "graphene_triangle_get_uv") core.PuregoSafeRegister(&xTriangleGetVertices, libs, "graphene_triangle_get_vertices") core.PuregoSafeRegister(&xTriangleInitFromFloat, libs, "graphene_triangle_init_from_float") core.PuregoSafeRegister(&xTriangleInitFromPoint3d, libs, "graphene_triangle_init_from_point3d") core.PuregoSafeRegister(&xTriangleInitFromVec3, libs, "graphene_triangle_init_from_vec3") }