Ejemplo n.º 1
0
func (parent H3DNode) AddMeshNode(name string, materialRes H3DRes, batchStart int, batchCount int,
	vertRStart int, vertEnd int) H3DNode {
	cName := C.CString(name)
	defer C.free(unsafe.Pointer(cName))
	return H3DNode(C.h3dAddMeshNode(C.H3DNode(parent), cName, C.H3DRes(materialRes), C.int(batchStart),
		C.int(batchCount), C.int(vertRStart), C.int(vertEnd)))
}
Ejemplo n.º 2
0
func PickRay(cameraNode H3DNode, nwx float32, nwy float32, ox *float32, oy *float32, oz *float32,
	dx *float32, dy *float32, dz *float32) {
	C.h3dutPickRay(C.H3DNode(cameraNode), C.float(nwx), C.float(nwy), (*C.float)(unsafe.Pointer(ox)),
		(*C.float)(unsafe.Pointer(oy)), (*C.float)(unsafe.Pointer(oz)),
		(*C.float)(unsafe.Pointer(dx)), (*C.float)(unsafe.Pointer(dy)),
		(*C.float)(unsafe.Pointer(dz)))
}
Ejemplo n.º 3
0
func (node H3DNode) AABB(minX *float32, minY *float32, minZ *float32,
	maxX *float32, maxY *float32, maxZ *float32) {
	C.h3dGetNodeAABB(C.H3DNode(node), (*C.float)(unsafe.Pointer(minX)),
		(*C.float)(unsafe.Pointer(minY)), (*C.float)(unsafe.Pointer(minZ)),
		(*C.float)(unsafe.Pointer(maxX)), (*C.float)(unsafe.Pointer(maxY)),
		(*C.float)(unsafe.Pointer(maxZ)))
}
Ejemplo n.º 4
0
func (parent H3DNode) AddEmitterNode(name string, materialRes H3DRes, particleEffectRes H3DRes,
	maxParticleCount int, respawnCount int) H3DNode {
	cName := C.CString(name)
	defer C.free(unsafe.Pointer(cName))
	return H3DNode(C.h3dAddEmitterNode(C.H3DNode(parent), cName, C.H3DRes(materialRes),
		C.H3DRes(particleEffectRes), C.int(maxParticleCount), C.int(respawnCount)))
}
Ejemplo n.º 5
0
func (node H3DNode) Transform(tx *float32, ty *float32, tz *float32,
	rx *float32, ry *float32, rz *float32, sx *float32, sy *float32, sz *float32) {
	C.h3dGetNodeTransform(C.H3DNode(node), (*C.float)(unsafe.Pointer(tx)), (*C.float)(unsafe.Pointer(ty)),
		(*C.float)(unsafe.Pointer(tz)), (*C.float)(unsafe.Pointer(rx)), (*C.float)(unsafe.Pointer(ry)),
		(*C.float)(unsafe.Pointer(rz)), (*C.float)(unsafe.Pointer(sx)), (*C.float)(unsafe.Pointer(sy)),
		(*C.float)(unsafe.Pointer(sz)))
}
Ejemplo n.º 6
0
func SetupModelAnimStage(modelNode H3DNode, stage int, animationRes H3DRes, layer int,
	startNode string, additive bool) {
	cStartNode := C.CString(startNode)
	defer C.free(unsafe.Pointer(cStartNode))
	C.h3dSetupModelAnimStage(C.H3DNode(modelNode), C.int(stage), C.H3DRes(animationRes),
		C.int(layer), cStartNode, Int[additive])
}
Ejemplo n.º 7
0
func (parent H3DNode) AddLightNode(name string, materialRes H3DRes, lightingContext string,
	shadowContext string) H3DNode {
	cName := C.CString(name)
	defer C.free(unsafe.Pointer(cName))
	cLightingContext := C.CString(lightingContext)
	defer C.free(unsafe.Pointer(cLightingContext))
	cShadowContext := C.CString(shadowContext)
	defer C.free(unsafe.Pointer(cShadowContext))

	return H3DNode(C.h3dAddLightNode(C.H3DNode(parent), cName, C.H3DRes(materialRes), cLightingContext,
		cShadowContext))
}
Ejemplo n.º 8
0
func (node H3DNode) TransMats(relMat *[16]float32, absMat *[16]float32) {
	var rel **C.float
	var abs **C.float

	if relMat != nil {
		rel = (**C.float)(unsafe.Pointer(&relMat[0]))
	}
	if absMat != nil {
		abs = (**C.float)(unsafe.Pointer(&absMat[0]))
	}

	C.h3dGetNodeTransMats(C.H3DNode(node), rel, abs)

	if relMat != nil {
		C.CopyFloatArray(*rel, (*C.float)(&relMat[0]), 16)
		//prepSlice(unsafe.Pointer(&relMat), unsafe.Pointer(*rel), 16)

	}
	if absMat != nil {
		C.CopyFloatArray(*abs, (*C.float)(&absMat[0]), 16)
		//prepSlice(unsafe.Pointer(&absMat), unsafe.Pointer(*abs), 16)
	}
}
Ejemplo n.º 9
0
func FindNodes(node H3DNode, name string, nodeType int) int {
	cName := C.CString(name)
	defer C.free(unsafe.Pointer(cName))
	return int(C.h3dFindNodes(C.H3DNode(node), cName, C.int(nodeType)))
}
Ejemplo n.º 10
0
func (node H3DNode) SetFlags(flags int, recursive bool) {
	C.h3dSetNodeFlags(C.H3DNode(node), C.int(flags), Int[recursive])
}
Ejemplo n.º 11
0
func (node H3DNode) Parent() H3DNode {
	return H3DNode(C.h3dGetNodeParent(C.H3DNode(node)))
}
Ejemplo n.º 12
0
func (node H3DNode) SetNodeParamStr(param int, value string) {
	cValue := C.CString(value)
	C.free(unsafe.Pointer(cValue))
	C.h3dSetNodeParamStr(C.H3DNode(node), C.int(param), cValue)
}
Ejemplo n.º 13
0
func (node H3DNode) Flags() int {
	return int(C.h3dGetNodeFlags(C.H3DNode(node)))
}
Ejemplo n.º 14
0
func (node H3DNode) SetNodeParamF(param int, compIdx int, value float32) {
	C.h3dSetNodeParamF(C.H3DNode(node), C.int(param), C.int(compIdx), C.float(value))
}
Ejemplo n.º 15
0
func (node H3DNode) NodeParamStr(param int) string {
	value := C.h3dGetNodeParamStr(C.H3DNode(node), C.int(param))
	return C.GoString(value)
}
Ejemplo n.º 16
0
func (node H3DNode) SetParent(parent H3DNode) bool {
	return Bool[int(C.h3dSetNodeParent(C.H3DNode(node), C.H3DNode(parent)))]
}
Ejemplo n.º 17
0
func (node H3DNode) NodeParamF(param int, compIdx int) float32 {
	return float32(C.h3dGetNodeParamF(C.H3DNode(node), C.int(param), C.int(compIdx)))
}
Ejemplo n.º 18
0
func (parent H3DNode) AddGroupNode(name string) H3DNode {
	cName := C.CString(name)
	defer C.free(unsafe.Pointer(cName))
	return H3DNode(C.h3dAddGroupNode(C.H3DNode(parent), cName))
}
Ejemplo n.º 19
0
func (node H3DNode) Child(index int) H3DNode {
	return H3DNode(C.h3dGetNodeChild(C.H3DNode(node), C.int(index)))
}
Ejemplo n.º 20
0
func (node H3DNode) CastRay(ox float32, oy float32, oz float32,
	dx float32, dy float32, dz float32, numNearest int) int {
	return int(C.h3dCastRay(C.H3DNode(node), C.float(ox), C.float(oy), C.float(oz),
		C.float(dx), C.float(dy), C.float(dz), C.int(numNearest)))
}
Ejemplo n.º 21
0
func (node H3DNode) SetTransform(tx float32, ty float32, tz float32,
	rx float32, ry float32, rz float32, sx float32, sy float32, sz float32) {
	C.h3dSetNodeTransform(C.H3DNode(node), C.float(tx), C.float(ty), C.float(tz),
		C.float(rx), C.float(ry), C.float(rz), C.float(sx), C.float(sy), C.float(sz))
}
Ejemplo n.º 22
0
func (parent H3DNode) AddNodes(sceneGraphRes H3DRes) H3DNode {
	return H3DNode(C.h3dAddNodes(C.H3DNode(parent), C.H3DRes(sceneGraphRes)))
}
Ejemplo n.º 23
0
func (node H3DNode) CheckNodeTransFlag(reset bool) bool {
	return Bool[int(C.h3dCheckNodeTransFlag(C.H3DNode(node), Int[reset]))]
}
Ejemplo n.º 24
0
func (node H3DNode) Remove() {
	C.h3dRemoveNode(C.H3DNode(node))
}
Ejemplo n.º 25
0
func (node H3DNode) CheckNodeVisibility(cameraNode H3DNode, checkOcclusion bool, calcLod bool) int {
	return int(C.h3dCheckNodeVisibility(C.H3DNode(node), C.H3DNode(cameraNode),
		Int[checkOcclusion], Int[calcLod]))
}
Ejemplo n.º 26
0
func (node H3DNode) SetNodeTransMat(mat4x4 *[16]float32) {
	C.h3dSetNodeTransMat(C.H3DNode(node), (*C.float)(unsafe.Pointer(&mat4x4[0])))
}
Ejemplo n.º 27
0
func (parent H3DNode) AddModelNode(name string, geometryRes H3DRes) H3DNode {
	cName := C.CString(name)
	defer C.free(unsafe.Pointer(cName))
	return H3DNode(C.h3dAddModelNode(C.H3DNode(parent), cName, C.H3DRes(geometryRes)))
}
Ejemplo n.º 28
0
func (node H3DNode) NodeParamI(param int) int {
	return int(C.h3dGetNodeParamI(C.H3DNode(node), C.int(param)))
}
Ejemplo n.º 29
0
func PickNode(cameraNode H3DNode, nwx float32, nwy float32) H3DNode {
	return H3DNode(C.h3dutPickNode(C.H3DNode(cameraNode), C.float(nwx), C.float(nwy)))
}
Ejemplo n.º 30
0
func (node H3DNode) SetNodeParamI(param int, value int) {
	C.h3dSetNodeParamI(C.H3DNode(node), C.int(param), C.int(value))
}