Add new functions
This commit is contained in:
parent
ec25c4ec9e
commit
914ca1ffdc
3 changed files with 62 additions and 4 deletions
|
@ -194,6 +194,14 @@ func UnloadModel(model Model) {
|
|||
C.UnloadModel(*cmodel)
|
||||
}
|
||||
|
||||
// GetModelBoundingBox - Compute model bounding box limits (considers all meshes
|
||||
func GetModelBoundingBox(model Model) BoundingBox {
|
||||
cmodel := model.cptr()
|
||||
ret := C.GetModelBoundingBox(*cmodel)
|
||||
v := newBoundingBoxFromPointer(unsafe.Pointer(&ret))
|
||||
return v
|
||||
}
|
||||
|
||||
// UnloadMesh - Unload mesh from memory (RAM and/or VRAM)
|
||||
func UnloadMesh(mesh *Mesh) {
|
||||
cmesh := mesh.cptr()
|
||||
|
@ -208,6 +216,16 @@ func ExportMesh(mesh Mesh, fileName string) {
|
|||
C.ExportMesh(*cmesh, cfileName)
|
||||
}
|
||||
|
||||
// GenMeshPoly - Generate polygonal mesh
|
||||
func GenMeshPoly(sides int, radius float32) Mesh {
|
||||
csides := (C.int)(sides)
|
||||
cradius := (C.float)(radius)
|
||||
|
||||
ret := C.GenMeshPoly(csides, cradius)
|
||||
v := newMeshFromPointer(unsafe.Pointer(&ret))
|
||||
return v
|
||||
}
|
||||
|
||||
// GenMeshPlane - Generate plane mesh (with subdivisions)
|
||||
func GenMeshPlane(width, length float32, resX, resZ int) Mesh {
|
||||
cwidth := (C.float)(width)
|
||||
|
@ -264,6 +282,17 @@ func GenMeshCylinder(radius, height float32, slices int) Mesh {
|
|||
return v
|
||||
}
|
||||
|
||||
// GenMeshCone - Generate cone/pyramid mesh
|
||||
func GenMeshCone(radius, height float32, slices int) Mesh {
|
||||
cradius := (C.float)(radius)
|
||||
cheight := (C.float)(height)
|
||||
cslices := (C.int)(slices)
|
||||
|
||||
ret := C.GenMeshCone(cradius, cheight, cslices)
|
||||
v := newMeshFromPointer(unsafe.Pointer(&ret))
|
||||
return v
|
||||
}
|
||||
|
||||
// GenMeshTorus - Generate torus mesh
|
||||
func GenMeshTorus(radius, size float32, radSeg, sides int) Mesh {
|
||||
cradius := (C.float)(radius)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue