Golang C.H3DNode类(方法)实例源码

下面列出了Golang C.H3DNode 类(方法)源码代码实例,从而了解它的用法。

作者:floffel0    项目:gohord   
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)))
}

作者:floffel0    项目:gohord   
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)))
}

作者:floffel0    项目:gohord   
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)))
}

作者:floffel0    项目:gohord   
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)))
}

作者:floffel0    项目:gohord   
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)))
}

作者:floffel0    项目:gohord   
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])
}

作者:floffel0    项目:gohord   
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))
}

作者:floffel0    项目:gohord   
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)
	}
}

作者:floffel0    项目:gohord   
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)))
}

作者:floffel0    项目:gohord   
func (node H3DNode) SetFlags(flags int, recursive bool) {
	C.h3dSetNodeFlags(C.H3DNode(node), C.int(flags), Int[recursive])
}

作者:floffel0    项目:gohord   
func (node H3DNode) Parent() H3DNode {
	return H3DNode(C.h3dGetNodeParent(C.H3DNode(node)))
}

作者:floffel0    项目:gohord   
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)
}

作者:floffel0    项目:gohord   
func (node H3DNode) Flags() int {
	return int(C.h3dGetNodeFlags(C.H3DNode(node)))
}

作者:floffel0    项目:gohord   
func (node H3DNode) SetNodeParamF(param int, compIdx int, value float32) {
	C.h3dSetNodeParamF(C.H3DNode(node), C.int(param), C.int(compIdx), C.float(value))
}

作者:floffel0    项目:gohord   
func (node H3DNode) NodeParamStr(param int) string {
	value := C.h3dGetNodeParamStr(C.H3DNode(node), C.int(param))
	return C.GoString(value)
}

作者:floffel0    项目:gohord   
func (node H3DNode) SetParent(parent H3DNode) bool {
	return Bool[int(C.h3dSetNodeParent(C.H3DNode(node), C.H3DNode(parent)))]
}

作者:floffel0    项目:gohord   
func (node H3DNode) NodeParamF(param int, compIdx int) float32 {
	return float32(C.h3dGetNodeParamF(C.H3DNode(node), C.int(param), C.int(compIdx)))
}

作者:floffel0    项目:gohord   
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))
}

作者:floffel0    项目:gohord   
func (node H3DNode) Child(index int) H3DNode {
	return H3DNode(C.h3dGetNodeChild(C.H3DNode(node), C.int(index)))
}

作者:floffel0    项目:gohord   
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)))
}


问题


面经


文章

微信
公众号

扫码关注公众号