Пример #1
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)))
}
Пример #2
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)))
}
Пример #3
0
func ShowText(text string, x float32, y float32, size float32, colR float32, colG float32, colB float32,
	fontMaterialRes H3DRes) {
	cText := C.CString(text)
	defer C.free(unsafe.Pointer(cText))
	C.h3dutShowText(cText, C.float(x), C.float(y), C.float(size), C.float(colR), C.float(colG),
		C.float(colB), C.H3DRes(fontMaterialRes))
}
Пример #4
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])
}
Пример #5
0
func SetMaterialUniform(materialRes H3DRes, name string, a float32, b float32,
	c float32, d float32) bool {
	cName := C.CString(name)
	defer C.free(unsafe.Pointer(cName))

	return Bool[int(C.h3dSetMaterialUniform(C.H3DRes(materialRes), cName,
		C.float(a), C.float(b), C.float(c), C.float(d)))]
}
Пример #6
0
func RenderTargetData(pipelineRes H3DRes, targetName string, bufIndex int, width *int,
	height *int, compCount *int, dataBuffer []byte) bool {
	cTargetName := C.CString(targetName)
	defer C.free(unsafe.Pointer(cTargetName))

	return Bool[int(C.h3dGetRenderTargetData(C.H3DRes(pipelineRes), cTargetName,
		C.int(bufIndex), (*C.int)(unsafe.Pointer(width)), (*C.int)(unsafe.Pointer(height)),
		(*C.int)(unsafe.Pointer(compCount)), unsafe.Pointer(&dataBuffer[0]), C.int(len(dataBuffer))))]
}
Пример #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))
}
Пример #8
0
func ShowOverlays(verts []float32,
	vertCount int,
	colR float32,
	colG float32,
	colB float32,
	colA float32,
	materialRes H3DRes,
	flags int) {

	C.h3dShowOverlays((*C.float)(unsafe.Pointer(&verts[0])),
		C.int(vertCount),
		C.float(colR),
		C.float(colG),
		C.float(colB),
		C.float(colA),
		C.H3DRes(materialRes),
		C.int(flags))
}
Пример #9
0
func (res H3DRes) SetResParamI(elem int, elemIdx int, param int, value int) {
	C.h3dSetResParamI(C.H3DRes(res), C.int(elem), C.int(elemIdx), C.int(param), C.int(value))
}
Пример #10
0
//MapResStream will return an unsafe pointer to the internal C array in Horde.  Think about using
// other safer typed stream options instead
func (res H3DRes) MapResStream(elem int, elemIdx int, stream int, read bool, write bool) unsafe.Pointer {

	return C.h3dMapResStream(C.H3DRes(res), C.int(elem), C.int(elemIdx), C.int(stream),
		Int[read], Int[write])

}
Пример #11
0
func (res H3DRes) UnmapResStream() {
	C.h3dUnmapResStream(C.H3DRes(res))
}
Пример #12
0
func (res H3DRes) ResParamStr(elem int, elemIdx int, param int) string {
	value := C.h3dGetResParamStr(C.H3DRes(res), C.int(elem), C.int(elemIdx), C.int(param))
	return C.GoString(value)
}
Пример #13
0
func (res H3DRes) SetResParamStr(elem int, elemIdx int, param int, value string) {
	cValue := C.CString(value)
	defer C.free(unsafe.Pointer(cValue))
	C.h3dSetResParamStr(C.H3DRes(res), C.int(elem), C.int(elemIdx), C.int(param), cValue)
}
Пример #14
0
func (res H3DRes) ResParamF(elem int, elemIdx int, param int, compIdx int) float32 {
	return float32(C.h3dGetResParamF(C.H3DRes(res),
		C.int(elem), C.int(elemIdx), C.int(param), C.int(compIdx)))
}
Пример #15
0
func (res H3DRes) SetResParamF(elem int, elemIdx int, param int, compIdx int, value float32) {
	C.h3dSetResParamF(C.H3DRes(res),
		C.int(elem), C.int(elemIdx), C.int(param), C.int(compIdx), C.float(value))
}
Пример #16
0
func ResizePipelineBuffers(pipeRes H3DRes, width int, height int) {
	C.h3dResizePipelineBuffers(C.H3DRes(pipeRes), C.int(width), C.int(height))
}
Пример #17
0
func NextResource(resType int, start H3DRes) H3DRes {
	return H3DRes(C.h3dGetNextResource(C.int(resType), C.H3DRes(start)))
}
Пример #18
0
func (parent H3DNode) AddNodes(sceneGraphRes H3DRes) H3DNode {
	return H3DNode(C.h3dAddNodes(C.H3DNode(parent), C.H3DRes(sceneGraphRes)))
}
Пример #19
0
func (res H3DRes) Type() int {
	return int(C.h3dGetResType(C.H3DRes(res)))
}
Пример #20
0
func (res H3DRes) Unload() {
	C.h3dUnloadResource(C.H3DRes(res))
}
Пример #21
0
func (res H3DRes) Load(data []byte) bool {
	return Bool[int(C.h3dLoadResource(C.H3DRes(res), (*C.char)(unsafe.Pointer(&data[0])), C.int(len(data))))]
}
Пример #22
0
func (res H3DRes) IsLoaded() bool {
	return Bool[int(C.h3dIsResLoaded(C.H3DRes(res)))]
}
Пример #23
0
func (res H3DRes) Remove() int {
	return int(C.h3dRemoveResource(C.H3DRes(res)))
}
Пример #24
0
func (sourceRes H3DRes) Clone(name string) H3DRes {
	cName := C.CString(name)
	defer C.free(unsafe.Pointer(cName))

	return H3DRes(C.h3dCloneResource(C.H3DRes(sourceRes), cName))
}
Пример #25
0
func (res H3DRes) ElemCount(elem int) int {
	return int(C.h3dGetResElemCount(C.H3DRes(res), C.int(elem)))
}
Пример #26
0
func (res H3DRes) Name() string {
	return C.GoString(C.h3dGetResName(C.H3DRes(res)))
}
Пример #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)))
}
Пример #28
0
func (res H3DRes) FindResElem(elem int, param int, value string) int {
	cValue := C.CString(value)
	defer C.free(unsafe.Pointer(cValue))
	return int(C.h3dFindResElem(C.H3DRes(res),
		C.int(elem), C.int(param), cValue))
}
Пример #29
0
func ShowFrameStats(fontMaterialRes H3DRes, panelMaterialRes H3DRes, mode int) {
	C.h3dutShowFrameStats(C.H3DRes(fontMaterialRes), C.H3DRes(panelMaterialRes), C.int(mode))
}
Пример #30
0
func (res H3DRes) ResParamI(elem int, elemIdx int, param int) int {
	return int(C.h3dGetResParamI(C.H3DRes(res), C.int(elem), C.int(elemIdx), C.int(param)))
}