Horde3D API | |
Conventions | Some conventions for the API. |
Typedefs and constants | |
Typedefs | |
Predefined constants | |
Enumerations | |
H3DRenderDevice | The available engine Renderer backends. |
H3DOptions | The available engine option parameters. |
H3DStats | The available engine statistic parameters. |
H3DDeviceCapabilities | The available GPU capabilities. |
H3DResTypes | The available resource types. |
H3DResFlags | The available flags used when adding a resource. |
H3DFormats | The available resource stream formats. |
H3DGeoRes | The available Geometry resource accessors. |
H3DAnimRes | The available Animation resource accessors. |
H3DMatRes | The available Material resource accessors. |
H3DShaderRes | The available Shader resource accessors. |
H3DTexRes | The available Texture resource accessors. |
H3DPartEffRes | The available ParticleEffect resource accessors. |
H3DPipeRes | The available Pipeline resource accessors. |
H3DComputeBufRes | The available ComputeBuffer resource accessors. |
H3DNodeTypes | The available scene node types. |
H3DNodeFlags | The available scene node flags. |
H3DNodeParams | The available scene node parameters. |
H3DModel | The available Model node parameters |
H3DMesh | The available Mesh node parameters. |
H3DJoint | The available Joint node parameters. |
H3DLight | The available Light node parameters. |
H3DCamera | The available Camera node parameters. |
H3DEmitter | The available Emitter node parameters. |
H3DComputeNode | The available compute node parameters. |
H3DModelUpdateFlags | The available flags for h3dUpdateModel. |
Basic functions | |
h3dGetVersionString | Returns the engine version string. |
h3dCheckExtension | Checks if an extension is part of the engine library. |
h3dGetError | Checks if an error occured. |
h3dInit | Initializes the engine. |
h3dRelease | Releases the engine. |
h3dCompute | Asynchronous processing of arbitrary data on GPU. |
h3dRender | Main rendering function. |
h3dFinalizeFrame | Marker for end of frame. |
h3dClear | Removes all resources and scene nodes. |
h3dGetMessage | Gets the next message from the message queue. |
h3dGetOption | Gets an option parameter of the engine. |
h3dSetOption | Sets an option parameter for the engine. |
h3dGetStat | Gets a statistic value of the engine. |
h3dGetDeviceCapabilities | Checks whether GPU supports a certain feature. |
h3dShowOverlays | Displays overlays on the screen. |
h3dClearOverlays | Removes all overlays. |
General resource management functions | |
h3dGetResType | Returns the type of a resource. |
h3dGetResName | Returns the name of a resource. |
h3dGetNextResource | Returns the next resource of the specified type. |
h3dFindResource | Finds a resource and returns its handle. |
h3dAddResource | Adds a resource. |
h3dCloneResource | Duplicates a resource. |
h3dRemoveResource | Removes a resource. |
h3dIsResLoaded | Checks if a resource is loaded. |
h3dLoadResource | Loads a resource. |
h3dUnloadResource | Unloads a resource. |
h3dGetResElemCount | Gets the number of elements in a resource. |
h3dFindResElem | Finds a resource element with the specified property value. |
h3dGetResParamI | Gets an integer property of a resource element. |
h3dSetResParamI | Sets an integer property of a resource element. |
h3dGetResParamF | Gets a float property of a resource element. |
h3dSetResParamF | Sets a float property of a resource element. |
h3dGetResParamStr | Gets a string property of a resource element. |
h3dSetResParamStr | Sets a string property of a resource element. |
h3dMapResStream | Maps the stream of a resource element. |
h3dUnmapResStream | Unmaps a previously mapped resource stream. |
h3dQueryUnloadedResource | Returns handle to an unloaded resource. |
h3dReleaseUnusedResources | Frees resources that are no longer used. |
Specific resource management functions | |
h3dCreateTexture | Creates a Texture resource. |
h3dSetShaderPreambles | Sets preambles of all Shader resources. |
h3dSetMaterialUniform | Sets a shader uniform of a Material resource. |
h3dResizePipelineBuffers | Changes the size of the render targets of a pipeline. |
h3dGetRenderTargetData | Reads back the pixel data of a render target buffer. |
General scene graph functions | |
h3dGetNodeType | Returns the type of a scene node. |
h3dGetNodeParent | Returns the parent of a scene node. |
h3dSetNodeParent | Relocates a node in the scene graph. |
h3dGetNodeChild | Returns the handle to a child node. |
h3dAddNodes | Adds nodes from a SceneGraph resource to the scene. |
h3dRemoveNode | Removes a node from the scene. |
h3dCheckNodeTransFlag | Checks if a scene node has been transformed by the engine. |
h3dGetNodeTransform | Gets the relative transformation of a node. |
h3dSetNodeTransform | Sets the relative transformation of a node. |
h3dGetNodeTransMats | Returns the transformation matrices of a node. |
h3dSetNodeTransMat | Sets the relative transformation matrix of a node. |
h3dGetNodeParamI | Gets a property of a scene node. |
h3dSetNodeParamI | Sets a property of a scene node. |
h3dGetNodeParamF | Gets a property of a scene node. |
h3dSetNodeParamF | Sets a property of a scene node. |
h3dGetNodeParamStr | Gets a property of a scene node. |
h3dSetNodeParamStr | Sets a property of a scene node. |
h3dGetNodeFlags | Gets the scene node flags. |
h3dSetNodeFlags | Sets the scene node flags. |
h3dGetNodeAABB | Gets the bounding box of a scene node. |
h3dFindNodes | Finds scene nodes with the specified properties. |
h3dGetNodeFindResult | Gets a result from the findNodes query. |
h3dSetNodeUniforms | Sets per-instance uniform data for a node. |
h3dCastRay | Performs a recursive ray collision query. |
h3dGetCastRayResult | Returns a result of a previous castRay query. |
h3dCheckNodeVisibility | Checks if a node is visible. |
Group-specific scene graph functions | |
h3dAddGroupNode | Adds a Group node to the scene. |
Model-specific scene graph functions | |
h3dAddModelNode | Adds a Model node to the scene. |
h3dSetupModelAnimStage | Configures an animation stage of a Model node. |
h3dGetModelAnimParams | Gets the animation stage parameters of a Model node. |
h3dSetModelAnimParams | Sets the animation stage parameters of a Model node. |
h3dSetModelMorpher | Sets the weight of a morph target. |
h3dUpdateModel | Applies animation and/or geometry updates. |
Mesh-specific scene graph functions | |
h3dAddMeshNode | Adds a Mesh node to the scene. |
Joint-specific scene graph functions | |
h3dAddJointNode | Adds a Joint node to the scene. |
Light-specific scene graph functions | |
h3dAddLightNode | Adds a Light node to the scene. |
Camera-specific scene graph functions | |
h3dAddCameraNode | Adds a Camera node to the scene. |
h3dSetupCameraView | Sets the planes of a camera viewing frustum. |
h3dGetCameraProjMat | Gets the camera projection matrix. |
h3dSetCameraProjMat | Sets the camera projection matrix. |
Emitter-specific scene graph functions | |
h3dAddEmitterNode | Adds a Emitter node to the scene. |
h3dUpdateEmitter | Advances emitter time and performs particle simulation. |
h3dHasEmitterFinished | Checks if an Emitter node is still alive. |
Compute-specific scene graph functions | |
h3dAddComputeNode | Adds a Compute node to the scene. |
Some conventions for the API.
Horde3D uses a right-handed coordinate system, where y is the up-axis and the positive z-axis is pointing out of the screen. The rotations are specified in degrees and rotation direction is counter-clockwise when looking down the axis from the the positive end towards the origin. View vectors like the camera or light direction are always pointing along the negative z-axis when no transformation is applied. Matrices in Horde are stored in a column-major memory layout. When Euler angles are used, the rotation order is YXZ [*vec], so the z-rotation is applied first.
The available engine option parameters.
The available engine statistic parameters.
The available resource types.
The available flags used when adding a resource.
The available Geometry resource accessors.
The available Material resource accessors.
The available Shader resource accessors.
The available Texture resource accessors.
The available ParticleEffect resource accessors.
The available ComputeBuffer resource accessors.
The available scene node types.
The available Model node parameters
The available Mesh node parameters.
The available Light node parameters.
The available Camera node parameters.
The available Emitter node parameters.
The available compute node parameters.
DLL bool h3dCheckExtension( const char * extensionName )
Checks if an extension is part of the engine library.
This function checks if a specified extension is contained in the DLL/shared object of the engine.
extensionName | name of the extension |
true if extension is implemented, otherwise false
DLL bool h3dGetError()
Checks if an error occured.
This function checks if an error occured in a previous API function call. If an error flag is set, the function resets the flag and returns true. The function will solely report errors that originate from a violated precondition, like an invalid parameter that is passed to an API function. Errors that happen during the execution of a function, for example failure of initializing the engine due to a missing hardware feature, can be catched by checking the return value of the corresponding API function. More information about the error can be retrieved by checking the message queue, provided that the message level is set accordingly.
none
true in there was an error, otherwise false
DLL bool h3dInit( H3DRenderDevice:: List deviceType )
Initializes the engine.
This function initializes the graphics engine and makes it ready for use. It has to be the first call to the engine except for getVersionString. In order to successfully initialize the engine the calling application must provide a valid OpenGL context. The function can be called several times on different rendering contexts in order to initialize them.
deviceType | type of the render device |
true in case of success, otherwise false
DLL void h3dCompute( H3DRes materialRes, const char * context, int groupX, int groupY, int groupZ )
Asynchronous processing of arbitrary data on GPU.
This function is used for processing data on GPU via compute shaders. Compute shaders are commonly used in tiled rendering, particles generation, image compression/decompression, some even use them for AI calculation. Calculation results can be stored in a texture or a buffer. Data in buffers can also be used for rendering via Compute Buffer Resource.
materialRes | material that specifies the shader used and various input parameters for compute shader |
context | specifies the shader program that will be executed (one shader file may contain a large number of compute shader programs) |
groupX | number of work groups in X dimension [1,65535] |
groupY | number of work groups in Y dimension [1,65535] |
groupZ | number of work groups in Z dimension [1,65535] |
nothing
DLL void h3dRender( H3DNode cameraNode )
Main rendering function.
This is the main function of the engine. It executes all the rendering, animation and other tasks. The function can be called several times per frame, for example in order to write to different output buffers.
cameraNode | camera node used for rendering scene |
nothing
DLL const char *h3dGetMessage( int * level, float * time )
Gets the next message from the message queue.
This function returns the next message string from the message queue and writes additional information to the specified variables. If no message is left over in the queue an empty string is returned.
level | pointer to variable for storing message level indicating importance (can be NULL) |
time | pointer to variable for storing time when message was added (can be NULL) |
message string or empty string if no message is in queue
DLL bool h3dSetOption( H3DOptions:: List param, float value )
Sets an option parameter for the engine.
This function sets a specified option parameter to a specified value.
param | option parameter |
value | value of the option parameter |
true if the option could be set to the specified value, otherwise false
DLL float h3dGetStat( H3DStats:: List param, bool reset )
Gets a statistic value of the engine.
This function returns the value of the specified statistic. The reset flag makes it possible to reset the statistic value after reading.
param | statistic parameter |
reset | flag specifying whether statistic value should be reset |
current value of the specified statistic parameter
DLL float h3dGetDeviceCapabilities( H3DDeviceCapabilities:: List param )
Checks whether GPU supports a certain feature.
This function returns a value, indicating the support of a certain GPU capability.
param | requested GPU feature |
1, if feature is supported, 0 otherwise
DLL void h3dShowOverlays( const float * verts, int vertCount, float colR, float colG, float colB, float colA, H3DRes materialRes, int flags )
Displays overlays on the screen.
This function displays one or more overlays with a specified material and color. An overlay is a screen-space quad that can be used to render 2D GUI elements. The overlay coordinate system has its origin (0, 0) at the top-left corner of the screen and its maximum (aspect, 1) at the bottom-right corner. As the x coordinate of the maximum corresponds to the aspect ratio of the viewport, the size of overlays can always be the same, even when different screen formats (standard 4:3, widescreen 16:9, etc.) are used. Texture coordinates are using a system where the coordinates (0, 0) correspond to the lower left corner of the image. Overlays are drawn in the order in which they are pushed using this function. Overlays with the same state will be batched together, so it can make sense to group overlays that have the same material, color and flags in order to achieve best performance. Note that the overlays have to be removed manually using the function h3dClearOverlays.
verts | vertex data (x, y, u, v), interpreted as quads |
vertCount | number of vertices (must be multiple of 4) |
colR, colG, colB, colA | color (and transparency) of overlays |
materialRes | material resource used for rendering |
flags | overlay flags (reserved for future use) |
nothing
DLL const char *h3dGetResName( H3DRes res )
Returns the name of a resource.
This function returns a pointer to the name of a specified resource. If the resource handle is invalid, the function returns an empty string.
Important Note: The pointer is const and allows only read access to the data. Do never try to modify the data of the pointer since that can corrupt the engine’s internal states!
res | handle to the resource |
name of the resource or empty string in case of failure
DLL H3DRes h3dGetNextResource( int type, H3DRes start )
Returns the next resource of the specified type.
This function searches the next resource of the specified type and returns its handle. The search begins after the specified start handle. If a further resource of the queried type does not exist, a zero handle is returned. The function can be used to iterate over all resources of a given type by using as start the return value of the previous iteration step. The first iteration step should start at 0 and iteration can be ended when the function returns 0.
type | type of resource to be searched (H3DResTypes::Undefined for all types) |
start | resource handle after which the search begins (can be 0 for beginning of resource list) |
handle to the found resource or 0 if it does not exist
DLL H3DRes h3dFindResource( int type, const char * name )
Finds a resource and returns its handle.
This function searches the resource of the specified type and name and returns its handle. If the resource is not available in the resource manager a zero handle is returned.
type | type of the resource |
name | name of the resource |
handle to the resource or 0 if not found
DLL H3DRes h3dAddResource( int type, const char * name, int flags )
Adds a resource.
This function tries to add a resource of a specified type and name to the resource manager. If a resource of the same type and name is already existing, the handle to the existing resource is returned instead of creating a new one and the user reference count of the resource is increased.
type | type of the resource |
name | name of the resource |
flags | flags used for creating the resource |
handle to the resource to be added or 0 in case of failure
DLL H3DRes h3dCloneResource( H3DRes sourceRes, const char * name )
Duplicates a resource.
This function duplicates a specified resource. In the cloning process a new resource with the specified name is added to the resource manager and filled with the data of the specified source resource. If the specified name for the new resource is already in use, the function fails and returns 0. If the name string is empty, a unique name for the resource is generated automatically.
sourceRes | handle to resource to be cloned |
name | name of new resource (can be empty for auto-naming) |
handle to the cloned resource or 0 in case of failure
DLL int h3dRemoveResource( H3DRes res )
Removes a resource.
This function decreases the user reference count of a specified resource. When the user reference count is zero and there are no internal references, the resource can be released and removed using the API fuction releaseUnusedResources.
res | handle to the resource to be removed |
the number of references that the application is still holding after removal or -1 in case of an error
DLL bool h3dLoadResource( H3DRes res, const char * data, int size )
Loads a resource.
This function loads data for a resource that was previously added to the resource manager. If data is a NULL-pointer the resource manager is told that the resource doesn’t have any data (e.g. the corresponding file was not found). In this case, the resource remains in the unloaded state but is no more returned when querying unloaded resources. When the specified resource is already loaded, the function returns false.
res | handle to the resource for which data will be loaded |
data | pointer to the data to be loaded |
size | size of the data block |
true in case of success, otherwise false
DLL void h3dUnloadResource( H3DRes res )
Unloads a resource.
This function unloads a previously loaded resource and restores the default values it had before loading. The state is set back to unloaded which makes it possible to load the resource again.
res | handle to resource to be unloaded |
nothing
DLL int h3dGetResElemCount( H3DRes res, int elem )
Gets the number of elements in a resource.
This function returns how many elements of the specified element type a specified resource has.
res | handle to the resource to be accessed |
elem | element type |
number of elements
DLL int h3dFindResElem( H3DRes res, int elem, int param, const char * value )
Finds a resource element with the specified property value.
This function searches in a specified resource for the first element of the specified type that has the property with the specified name set to the specified search value. If such element is found, its index is returned, otherwise the function returns -1. All string comparisons done for the search are case-sensitive.
res | handle to the resource to be accessed |
elem | element type |
param | parameter name |
value | parameter value to be searched for |
index of element or -1 if element not found
DLL int h3dGetResParamI( H3DRes res, int elem, int elemIdx, int param )
Gets an integer property of a resource element.
This function returns a specified property of the specified resource element. The property must be of the type int.
res | handle to the resource to be accessed |
elem | element type |
elemIdx | index of element |
param | parameter to be accessed |
value of the parameter
DLL void h3dSetResParamI( H3DRes res, int elem, int elemIdx, int param, int value )
Sets an integer property of a resource element.
This function sets a specified property of the specified resource element to the specified value. The property must be of the type int.
res | handle to the resource to be modified |
elem | element type |
elemIdx | index of element |
param | parameter to be modified |
value | new value for the specified parameter |
nothing
DLL float h3dGetResParamF( H3DRes res, int elem, int elemIdx, int param, int compIdx )
Gets a float property of a resource element.
This function returns the specified component of the specified resource element property. The property must be of the type float. Float properties can have several indexed components, for example the x, y and z components of a vector.
res | handle to the resource to be accessed |
elem | element type |
elemIdx | index of element |
param | parameter to be accessed |
compIdx | component of the parameter to be accessed |
value of the parameter
DLL void h3dSetResParamF( H3DRes res, int elem, int elemIdx, int param, int compIdx, float value )
Sets a float property of a resource element.
This function sets the specified component of the specified resource element property to the specified value. The property must be of the type float.
res | handle to the resource to be modified |
elem | element type |
elemIdx | index of element |
param | parameter to be modified |
compIdx | component of the parameter to be modified |
value | new value for the specified parameter |
nothing
DLL const char *h3dGetResParamStr( H3DRes res, int elem, int elemIdx, int param )
Gets a string property of a resource element.
This function returns a specified property of the specified resource element. The property must be of the type string (const char *).
Important Note: The pointer is const and allows only read access to the data. Do never try to modify the data of the pointer since that can corrupt the engine’s internal states!
res | handle to the resource to be accessed |
elem | element type |
elemIdx | index of element |
param | parameter to be accessed |
value of the property or empty string if no such property exists
DLL void h3dSetResParamStr( H3DRes res, int elem, int elemIdx, int param, const char * value )
Sets a string property of a resource element.
This function sets a specified property of the specified resource element to the specified value. The property must be of the type string (const char *).
res | handle to the resource to be modified |
elem | element type |
elemIdx | index of element |
param | parameter to be modified |
value | new value for the specified parameter |
nothing
DLL void *h3dMapResStream( H3DRes res, int elem, int elemIdx, int stream, bool read, bool write )
Maps the stream of a resource element.
This function maps the specified stream of a specified resource element and returns a pointer to the stream data. The required access to the data can be specified with the read write parameters. If read is false, the pointer will usually not contain meaningful data. Not all resource streams can be mapped with both read and write access. If it is not possible to map the stream, the function will return a NULL pointer. A mapped stream should be unmapped again as soon as possible but always before subsequent API calls are made. It is only possible to map one stream per resource at a time.
res | handle to the resource to be mapped |
elem | element type |
elemIdx | index of element |
stream | stream to be mapped |
read | flag indicating whether read access is required |
write | flag indicating whether write access is required |
pointer to stream data or NULL if stream cannot be mapped
DLL H3DRes h3dQueryUnloadedResource( int index )
Returns handle to an unloaded resource.
This function looks for a resource that is not yet loaded and returns its handle. If there are no unloaded resources or the zero based index specified is greater than the number of the currently unloaded resources, 0 is returned.
index | index of unloaded resource within the internal list of unloaded resources (starting with 0) |
handle to an unloaded resource or 0
DLL void h3dReleaseUnusedResources()
Frees resources that are no longer used.
This function releases resources that are no longer used. Unused resources were either told to be released by the user calling removeResource or are no more referenced by any other engine objects.
none
nothing
DLL H3DRes h3dCreateTexture( const char * name, int width, int height, int fmt, int flags )
Creates a Texture resource.
This function tries to create and add a Texture resource with the specified name to the resource manager. If a Texture resource with the same name is already existing, the function fails. The texture is initialized with the specified dimensions and the resource is declared as loaded. This function is especially useful to create dynamic textures (e.g. for displaying videos) or output buffers for render-to-texture.
name | name of the resource |
width | width of the texture image |
height | height of the texture image |
fmt | texture format (see stream formats) |
flags | flags used for creating the resource |
handle to the created resource or 0 in case of failure
DLL void h3dSetShaderPreambles( const char * vertPreamble, const char * fragPreamble, const char * geomPreamble, const char * tessControlPreamble, const char * tessEvalPreamble, const char * computePreamble )
Sets preambles of all Shader resources.
This function defines a header that is inserted at the beginning of all shaders. The preamble is used when a shader is compiled, so changing it will not affect any shaders that are already compiled. The preamble is useful for setting platform-specific defines that can be employed for creating several shader code paths, e.g. for supporting different hardware capabilities. Based on render device requirements, engine may internally set shader preambles. OpenGL 4 render device sets shader preambles to specify minimum version, required to compile a shader program of required type.
vertPreamble | preamble text of vertex shaders (default: empty string) |
fragPreamble | preamble text of fragment shaders (default: empty string) |
geomPreamble | preamble text of geometry shaders (default: empty string) |
tessControlPreamble | preamble text of tessellation control shaders (default: empty string) |
tessEvalPreamble | preamble text of tessellation evaluation shaders (default: empty string) |
computePreamble | preamble text of compute shaders (default: empty string) |
nothing
DLL bool h3dSetMaterialUniform( H3DRes materialRes, const char * name, float a, float b, float c, float d )
Sets a shader uniform of a Material resource.
This function sets the specified shader uniform of the specified material to the specified values.
materialRes | handle to the Material resource to be accessed |
name | name of the uniform as defined in Material resource |
a, b, c, d | values of the four components |
true if uniform was found, otherwise false
DLL void h3dResizePipelineBuffers( H3DRes pipeRes, int width, int height )
Changes the size of the render targets of a pipeline.
This function sets the base width and height which affects render targets with relative (in percent) size specification. Changing the base size is usually desired after engine initialization and when the window is being resized. Note that in case several cameras use the same pipeline resource instance, the change will affect all cameras.
pipeRes | the pipeline resource instance to be changed |
width | base width in pixels used for render targets with relative size |
height | base height in pixels used for render targets with relative size |
nothing
DLL bool h3dGetRenderTargetData( H3DRes pipelineRes, const char * targetName, int bufIndex, int * width, int * height, int * compCount, void * dataBuffer, int bufferSize )
Reads back the pixel data of a render target buffer.
This function reads back the pixels of a specified render target. If no pipeline resource is specified, the color data of the backbuffer is read back as RGBA float. Otherwise, the specified buffer of the specified render target is read back and stored in dataBuffer as RGBA float values. To compute the required size of the output buffer to which the data is written, the function can be called with a NULL pointer for dataBuffer and pointers to variables where the buffer width, height and the number of components will be stored. As this function has a considerable performance overhead, it is only intended for debugging purposes and screenshots. For more information about the render buffers, refer to the Pipeline documentation.
pipelineRes | handle to pipeline resource (0 for backbuffer) |
targetName | name of render target to be accessed (ignored for backbuffer) |
bufIndex | index of buffer to be accessed (32 for depth buffer) |
width | pointer to variable where the width of the buffer will be stored (can be NULL) |
height | pointer to variable where the height of the buffer will be stored (can be NULL) |
compCount | pointer to variable where the number of components will be stored (can be NULL) |
dataBuffer | pointer to array where the pixel data will be stored (can be NULL) |
bufferSize | size of dataBuffer array in bytes |
true if specified render target could be found, otherwise false
DLL H3DNode h3dGetNodeParent( H3DNode node )
Returns the parent of a scene node.
This function returns the handle to the parent node of a specified scene node. If the specified node handle is invalid or the root node, 0 is returned.
node | handle to the scene node |
handle to parent node or 0 in case of failure
DLL bool h3dSetNodeParent( H3DNode node, H3DNode parent )
Relocates a node in the scene graph.
This function relocates a scene node. It detaches the node from its current parent and attaches it to the specified new parent node. If the attachment to the new parent is not possible, the function returns false. Relocation is not possible for the H3DRootNode.
node | handle to the scene node to be relocated |
parent | handle to the new parent node |
true if node could be relocated, otherwise false
DLL H3DNode h3dGetNodeChild( H3DNode node, int index )
Returns the handle to a child node.
This function looks for the n-th (index) child node of a specified node and returns its handle. If the child doesn’t exist, the function returns 0.
node | handle to the parent node |
index | index of the child node |
handle to the child node or 0 if child doesn’t exist
DLL H3DNode h3dAddNodes( H3DNode parent, H3DRes sceneGraphRes )
Adds nodes from a SceneGraph resource to the scene.
This function creates several new nodes as described in a SceneGraph resource and attaches them to a specified parent node. If an invalid scenegraph resource is specified or the scenegraph resource is unloaded, the function returns 0.
parent | handle to parent node to which the root of the new nodes will be attached |
sceneGraphRes | handle to loaded SceneGraph resource |
handle to the root of the created nodes or 0 in case of failure
DLL bool h3dCheckNodeTransFlag( H3DNode node, bool reset )
Checks if a scene node has been transformed by the engine.
This function checks if a scene node has been transformed by the engine since the last time the transformation flag was reset. Therefore, it stores a flag that is set to true when a setTransformation function is called explicitely by the application or when the node transformation has been updated by the animation system. The function also makes it possible to reset the transformation flag.
node | handle to the node to be accessed |
reset | flag indicating whether transformation flag shall be reset |
true if node has been transformed, otherwise false
DLL void h3dGetNodeTransform( H3DNode node, float * tx, float * ty, float * tz, float * rx, float * ry, float * rz, float * sx, float * sy, float * sz )
Gets the relative transformation of a node.
This function gets the translation, rotation and scale of a specified scene node object. The coordinates are in local space and contain the transformation of the node relative to its parent.
node | handle to the node which will be accessed |
tx, ty, tz | pointers to variables where translation of the node will be stored (can be NULL) |
rx, ry, rz | pointers to variables where rotation of the node in Euler angles will be stored (can be NULL) |
sx, sy, sz | pointers to variables where scale of the node will be stored (can be NULL) |
nothing
DLL void h3dSetNodeTransform( H3DNode node, float tx, float ty, float tz, float rx, float ry, float rz, float sx, float sy, float sz )
Sets the relative transformation of a node.
This function sets the relative translation, rotation and scale of a specified scene node object. The coordinates are in local space and contain the transformation of the node relative to its parent.
node | handle to the node which will be modified |
tx, ty, tz | translation of the node |
rx, ry, rz | rotation of the node in Euler angles |
sx, sy, sz | scale of the node |
nothing
DLL void h3dGetNodeTransMats( H3DNode node, const float ** relMat, const float ** absMat )
Returns the transformation matrices of a node.
This function stores a pointer to the relative and absolute transformation matrices of the specified node in the specified pointer varaibles.
node | handle to the scene node to be accessed |
relMat | pointer to a variable where the address of the relative transformation matrix will be stored (can be NULL if matrix is not required) |
absMat | pointer to a variable where the address of the absolute transformation matrix will be stored (can be NULL if matrix is not required) |
nothing
DLL void h3dSetNodeTransMat( H3DNode node, const float * mat4x4 )
Sets the relative transformation matrix of a node.
This function sets the relative transformation matrix of the specified scene node. It is basically the same as setNodeTransform but takes directly a matrix instead of individual transformation parameters.
node | handle to the node which will be modified |
mat4x4 | pointer to a 4x4 matrix in column major order |
nothing
DLL int h3dGetNodeParamI( H3DNode node, int param )
Gets a property of a scene node.
This function returns a specified property of the specified node. The property must be of the type int or H3DRes.
node | handle to the node to be accessed |
param | parameter to be accessed |
value of the parameter
DLL void h3dSetNodeParamI( H3DNode node, int param, int value )
Sets a property of a scene node.
This function sets a specified property of the specified node to a specified value. The property must be of the type int or H3DRes.
node | handle to the node to be modified |
param | parameter to be modified |
value | new value for the specified parameter |
nothing
DLL float h3dGetNodeParamF( H3DNode node, int param, int compIdx )
Gets a property of a scene node.
This function returns a specified property of the specified node. Float properties can have several indexed components, for example the x, y and z components of a vector. The property must be of the type float.
node | handle to the node to be accessed |
param | parameter to be accessed |
compIdx | component of the parameter to be accessed |
value of the parameter
DLL void h3dSetNodeParamF( H3DNode node, int param, int compIdx, float value )
Sets a property of a scene node.
This function sets a specified property of the specified node to a specified value. The property must be of the type float.
node | handle to the node to be modified |
param | parameter to be modified |
compIdx | component of the parameter to be modified |
value | new value for the specified parameter |
nothing
DLL const char *h3dGetNodeParamStr( H3DNode node, int param )
Gets a property of a scene node.
This function returns a specified property of the specified node. The property must be of the type string (const char *).
Important Note: The pointer is const and allows only read access to the data. Do never try to modify the data of the pointer since that can corrupt the engine’s internal states!
node | handle to the node to be accessed |
param | parameter to be accessed |
value of the property or empty string if no such property exists
DLL void h3dSetNodeParamStr( H3DNode node, int param, const char * value )
Sets a property of a scene node.
This function sets a specified property of the specified node to a specified value. The property must be of the type string (const char *).
node | handle to the node to be modified |
param | parameter to be modified |
value | new value for the specified parameter |
nothing
DLL void h3dSetNodeFlags( H3DNode node, int flags, bool recursive )
Sets the scene node flags.
This function sets the flags of the specified scene node.
node | handle to the node to be modified |
flags | new flag bitmask |
recursive | specifies whether flags should be applied recursively to all child nodes |
nothing
DLL void h3dGetNodeAABB( H3DNode node, float * minX, float * minY, float * minZ, float * maxX, float * maxY, float * maxZ )
Gets the bounding box of a scene node.
This function stores the world coordinates of the axis aligned bounding box of a specified node in the specified variables. The bounding box is represented using the minimum and maximum coordinates on all three axes.
node | handle to the node which will be accessed |
minX, minY, minZ | pointers to variables where minimum coordinates will be stored |
maxX, maxY, maxZ | pointers to variables where maximum coordinates will be stored |
nothing
DLL int h3dFindNodes( H3DNode startNode, const char * name, int type )
Finds scene nodes with the specified properties.
This function loops recursively over all children of startNode and adds them to an internal list of results if they match the specified name and type. The result list is cleared each time this function is called. The function returns the number of nodes which were found and added to the list.
startNode | handle to the node where the search begins |
name | name of nodes to be searched (empty string for all nodes) |
type | type of nodes to be searched (H3DNodeTypes::Undefined for all types) |
number of search results
DLL H3DNode h3dGetNodeFindResult( int index )
Gets a result from the findNodes query.
This function returns the n-th (index) result of a previous findNodes query. The result is the handle to a scene node with the poperties specified at the findNodes query. If the index doesn’t exist in the result list the function returns 0.
index | index of search result |
handle to scene node from findNodes query or 0 if result doesn’t exist
DLL void h3dSetNodeUniforms( H3DNode node, float * uniformData, int count )
Sets per-instance uniform data for a node.
This function sets the custom per-instance uniform data for a node that can be accessed from within a shader. The specified number of floats is copied from the specified memory location. Currently only Model nodes will store this data.
node | node for which data will be set |
uniformData | pointer to float array |
count | number of floats to be copied |
nothing
DLL int h3dCastRay( H3DNode node, float ox, float oy, float oz, float dx, float dy, float dz, int numNearest )
Performs a recursive ray collision query.
This function checks recursively if the specified ray intersects the specified node or one of its children. The function finds intersections relative to the ray origin and returns the number of intersecting scene nodes. The ray is a line segment and is specified by a starting point (the origin) and a finite direction vector which also defines its length. Currently this function is limited to returning intersections with Meshes. For Meshes, the base LOD (LOD0) is always used for performing the ray-triangle intersection tests.
node | node at which intersection check is beginning |
ox, oy, oz | ray origin |
dx, dy, dz | ray direction vector also specifying ray length |
numNearest | maximum number of intersection points to be stored (0 for all) |
number of intersections
DLL bool h3dGetCastRayResult( int index, H3DNode * node, float * distance, float * intersection )
Returns a result of a previous castRay query.
This functions is used to access the results of a previous castRay query. The index is used to access a specific result. The intersection data is copied to the specified variables.
index | index of result to be accessed (range: 0 to number of results returned by castRay) |
node | handle of intersected node |
distance | distance from ray origin to intersection point |
intersection | coordinates of intersection point (float[3] array) |
true if index was valid and data could be copied, otherwise false
DLL int h3dCheckNodeVisibility( H3DNode node, H3DNode cameraNode, bool checkOcclusion, bool calcLod )
Checks if a node is visible.
This function checks if a specified node is visible from the perspective of a specified camera. The function always checks if the node is in the camera’s frustum. If checkOcclusion is true, the function will take into account the occlusion culling information from the previous frame (if occlusion culling is disabled the flag is ignored). The flag calcLod determines whether the detail level for the node should be returned in case it is visible. The function returns -1 if the node is not visible, otherwise 0 (base LOD level) or the computed LOD level.
node | node to be checked for visibility |
cameraNode | camera node from which the visibility test is done |
checkOcclusion | specifies if occlusion info from previous frame should be taken into account |
calcLod | specifies if LOD level should be computed |
computed LOD level or -1 if node is not visible
DLL H3DNode h3dAddGroupNode( H3DNode parent, const char * name )
Adds a Group node to the scene.
This function creates a new Group node and attaches it to the specified parent node.
parent | handle to parent node to which the new node will be attached |
name | name of the node |
handle to the created node or 0 in case of failure
DLL H3DNode h3dAddModelNode( H3DNode parent, const char * name, H3DRes geometryRes )
Adds a Model node to the scene.
This function creates a new Model node and attaches it to the specified parent node.
parent | handle to parent node to which the new node will be attached |
name | name of the node |
geometryRes | Geometry resource used by Model node |
handle to the created node or 0 in case of failure
DLL void h3dSetupModelAnimStage( H3DNode modelNode, int stage, H3DRes animationRes, int layer, const char * startNode, bool additive )
Configures an animation stage of a Model node.
This function is used to setup the specified animation stage/slot of the specified Model node.
The function can be used for animation blending and mixing. There is a fixed number of stages (by default 16) on which different animations can be played. The start node determines the first node (Joint or Mesh) to which the animation is recursively applied. If the start node is an empty string, the animation affects all animatable nodes (Joints and Meshes) of the model. If a NULL-handle is used for animationRes, the stage is cleared and the currently set animation is removed.
The layer determines the priority of the animation and how the weights are distributed. See h3dSetModelAnimParams for more information.
A simple way to do animation mixing is using additive animations. If a stage is configured to be additive, the engine calculates the difference between the current frame and the first frame in the animation and adds this delta, scaled by the weight factor, to the current transformation of the joints or meshes. Additive animations completely ignore the layer settings. They are only applied by the engine if a non-additive animation is assigned to the model as well.
modelNode | handle to the Model node to be modified |
stage | index of the animation stage to be configured |
animationRes | handle to Animation resource (can be 0) |
layer | layer id |
startNode | name of first node to which animation shall be applied (or empty string) |
additive | flag indicating whether stage is additive |
nothing
DLL void h3dGetModelAnimParams( H3DNode modelNode, int stage, float * time, float * weight )
Gets the animation stage parameters of a Model node.
This function gets the current animation time and weight for a specified stage of the specified model. The time corresponds to the frames of the animation and the animation is looped if the time is higher than the maximum number of frames in the Animation resource. The weight is used for animation blending and determines how much influence the stage has compared to the other active stages.
modelNode | handle to the Model node to be accessed |
stage | index of the animation stage to be accessed |
time | pointer to variable where the time of the animation stage will be stored (can be NULL if not required) |
weight | pointer to variable where the blend weight of the animation stage will be stored (can be NULL if not required) |
nothing
DLL void h3dSetModelAnimParams( H3DNode modelNode, int stage, float time, float weight )
Sets the animation stage parameters of a Model node.
This function sets the current animation time and weight for a specified stage of the specified model. The time corresponds to the frames of the animation and the animation is looped if the time is higher than the maximum number of frames in the Animation resource. The weight is used for animation blending and determines how much influence the stage has compared to the other active stages. All weights of stages that are on the same layer are normalized. Stages with a higher layer id are animated before stages with lower layers. The blend weight is distributed across the layers. If the weight sum of a layer is smaller than 1.0, the remaining weight is propagated to the next lower layer. So if a layer uses a weight of 100%, the lower layers will not get any weight and consequently not contribute to the overall animation.
modelNode | handle to the Model node to be modified |
stage | index of the animation stage to be modified |
time | new animation time/frame |
weight | new blend weight |
nothing
DLL bool h3dSetModelMorpher( H3DNode modelNode, const char * target, float weight )
Sets the weight of a morph target.
This function sets the weight of a specified morph target. If the target parameter is an empty string the weight of all morph targets in the specified Model node is modified. If the specified morph target is not found the function returns false.
modelNode | handle to the Model node to be modified |
target | name of morph target |
weight | new weight for morph target |
true if morph target was found, otherwise false
DLL void h3dUpdateModel( H3DNode modelNode, int flags )
Applies animation and/or geometry updates.
This function applies skeletal animation and geometry updates to the specified model, depending on the specified update flags. Geometry updates include morph targets and software skinning if enabled. If the animation or morpher parameters did not change, the function returns immediately. This function has to be called so that changed animation or morpher parameters will take effect.
modelNode | handle to the Model node to be updated |
flags | combination of H3DModelUpdate flags |
nothing
DLL H3DNode h3dAddMeshNode( H3DNode parent, const char * name, H3DRes materialRes, int batchStart, int batchCount, int vertRStart, int vertREnd )
Adds a Mesh node to the scene.
This function creates a new Mesh node and attaches it to the specified parent node.
parent | handle to parent node to which the new node will be attached |
name | name of the node |
materialRes | material resource used by Mesh node |
batchStart | first triangle index of mesh in Geometry resource of parent Model node |
batchCount | number of triangle indices used for drawing mesh |
vertRStart | first vertex in Geometry resource of parent Model node |
vertREnd | last vertex in Geometry resource of parent Model node |
handle to the created node or 0 in case of failure
DLL H3DNode h3dAddJointNode( H3DNode parent, const char * name, int jointIndex )
Adds a Joint node to the scene.
This function creates a new Joint node and attaches it to the specified parent node.
parent | handle to parent node to which the new node will be attached |
name | name of the node |
jointIndex | index of joint in Geometry resource of parent Model node |
handle to the created node or 0 in case of failure
DLL H3DNode h3dAddLightNode( H3DNode parent, const char * name, H3DRes materialRes, const char * lightingContext, const char * shadowContext )
Adds a Light node to the scene.
This function creates a new Light node and attaches it to the specified parent node. The direction vector of the untransformed light node is pointing along the the negative z-axis. The specified material resource can define uniforms and projective textures. Furthermore it can contain a shader for doing lighting calculations if deferred shading is used. If no material is required the parameter can be zero. The context names define which shader contexts are used when rendering shadow maps or doing light calculations for forward rendering configurations.
parent | handle to parent node to which the new node will be attached |
name | name of the node |
materialRes | material resource for light configuration or 0 if not used |
lightingContext | name of the shader context used for doing light calculations |
shadowContext | name of the shader context used for doing shadow map rendering |
handle to the created node or 0 in case of failure
DLL H3DNode h3dAddCameraNode( H3DNode parent, const char * name, H3DRes pipelineRes )
Adds a Camera node to the scene.
This function creates a new Camera node and attaches it to the specified parent node.
parent | handle to parent node to which the new node will be attached |
name | name of the node |
pipelineRes | pipeline resource used for rendering |
handle to the created node or 0 in case of failure
DLL void h3dSetupCameraView( H3DNode cameraNode, float fov, float aspect, float nearDist, float farDist )
Sets the planes of a camera viewing frustum.
This function calculates the view frustum planes of the specified camera node using the specified view parameters.
cameraNode | handle to the Camera node which will be modified |
fov | field of view (FOV) angle |
aspect | aspect ratio |
nearDist | distance of near clipping plane |
farDist | distance of far clipping plane |
nothing
DLL void h3dGetCameraProjMat( H3DNode cameraNode, float * projMat )
Gets the camera projection matrix.
This function gets the camera projection matrix used for bringing the geometry to screen space and copies it to the specified array.
cameraNode | handle to Camera node |
projMat | pointer to float array with 16 elements |
nothing
DLL void h3dSetCameraProjMat( H3DNode cameraNode, float * projMat )
Sets the camera projection matrix.
Details : This function sets the camera projection matrix used for bringing the geometry to screen space.
Parameters : cameraNode - handle to Camera node projMat - pointer to float array with 16 elements
Returns : nothing
DLL H3DNode h3dAddEmitterNode( H3DNode parent, const char * name, H3DRes materialRes, H3DRes particleEffectRes, int maxParticleCount, int respawnCount )
Adds a Emitter node to the scene.
This function creates a new Emitter node and attaches it to the specified parent node.
parent | handle to parent node to which the new node will be attached |
name | name of the node |
materialRes | handle to Material resource used for rendering |
particleEffectRes | handle to ParticleEffect resource used for configuring particle properties |
maxParticleCount | maximal number of particles living at the same time |
respawnCount | number of times a single particle is recreated after dying (-1 for infinite) |
handle to the created node or 0 in case of failure
DLL void h3dUpdateEmitter( H3DNode emitterNode, float timeDelta )
Advances emitter time and performs particle simulation.
This function advances the simulation time of a particle system and performs the particle simulation with timeDelta being the time elapsed since the last call of this function. The specified node must be an Emitter node.
emitterNode | handle to the Emitter node which will be updated |
timeDelta | time delta in seconds |
nothing
DLL bool h3dHasEmitterFinished( H3DNode emitterNode )
Checks if an Emitter node is still alive.
This function checks if a particle system is still active and has living particles or will spawn new particles. The specified node must be an Emitter node. The function can be used to check when a not infinitely running emitter for an effect like an explosion can be removed from the scene.
emitterNode | handle to the Emitter node which is checked |
true if Emitter will no more emit any particles, otherwise or in case of failure false
DLL H3DNode h3dAddComputeNode( H3DNode parent, const char * name, H3DRes materialRes, H3DRes compBufferRes, int drawType, int elementsCount )
Adds a Compute node to the scene.
This function creates a new Compute node and attaches it to the specified parent node. Compute node is used for drawing results of compute shader work.
parent | handle to parent node to which the new node will be attached |
name | name of the node |
materialRes | handle to Material resource used for rendering |
compBufferRes | handle to ComputeBuffer resource that is used as vertex storage |
drawType | specifies how to treat data in the compute buffer. 0 - Triangles, 1 - Lines, 2 - Points |
elementsCount | number of elements that need to be drawn |
handle to the created node or 0 in case of failure
Returns the engine version string.
DLL const char *h3dGetVersionString()
Checks if an extension is part of the engine library.
DLL bool h3dCheckExtension( const char * extensionName )
Checks if an error occured.
DLL bool h3dGetError()
Initializes the engine.
DLL bool h3dInit( H3DRenderDevice:: List deviceType )
Releases the engine.
DLL void h3dRelease()
Asynchronous processing of arbitrary data on GPU.
DLL void h3dCompute( H3DRes materialRes, const char * context, int groupX, int groupY, int groupZ )
Main rendering function.
DLL void h3dRender( H3DNode cameraNode )
Marker for end of frame.
DLL void h3dFinalizeFrame()
Removes all resources and scene nodes.
DLL void h3dClear()
Gets the next message from the message queue.
DLL const char *h3dGetMessage( int * level, float * time )
Gets an option parameter of the engine.
DLL float h3dGetOption( H3DOptions:: List param )
Sets an option parameter for the engine.
DLL bool h3dSetOption( H3DOptions:: List param, float value )
Gets a statistic value of the engine.
DLL float h3dGetStat( H3DStats:: List param, bool reset )
Checks whether GPU supports a certain feature.
DLL float h3dGetDeviceCapabilities( H3DDeviceCapabilities:: List param )
Displays overlays on the screen.
DLL void h3dShowOverlays( const float * verts, int vertCount, float colR, float colG, float colB, float colA, H3DRes materialRes, int flags )
Removes all overlays.
DLL void h3dClearOverlays()
Returns the type of a resource.
DLL int h3dGetResType( H3DRes res )
Returns the name of a resource.
DLL const char *h3dGetResName( H3DRes res )
Returns the next resource of the specified type.
DLL H3DRes h3dGetNextResource( int type, H3DRes start )
Finds a resource and returns its handle.
DLL H3DRes h3dFindResource( int type, const char * name )
Adds a resource.
DLL H3DRes h3dAddResource( int type, const char * name, int flags )
Duplicates a resource.
DLL H3DRes h3dCloneResource( H3DRes sourceRes, const char * name )
Removes a resource.
DLL int h3dRemoveResource( H3DRes res )
Checks if a resource is loaded.
DLL bool h3dIsResLoaded( H3DRes res )
Loads a resource.
DLL bool h3dLoadResource( H3DRes res, const char * data, int size )
Unloads a resource.
DLL void h3dUnloadResource( H3DRes res )
Gets the number of elements in a resource.
DLL int h3dGetResElemCount( H3DRes res, int elem )
Finds a resource element with the specified property value.
DLL int h3dFindResElem( H3DRes res, int elem, int param, const char * value )
Gets an integer property of a resource element.
DLL int h3dGetResParamI( H3DRes res, int elem, int elemIdx, int param )
Sets an integer property of a resource element.
DLL void h3dSetResParamI( H3DRes res, int elem, int elemIdx, int param, int value )
Gets a float property of a resource element.
DLL float h3dGetResParamF( H3DRes res, int elem, int elemIdx, int param, int compIdx )
Sets a float property of a resource element.
DLL void h3dSetResParamF( H3DRes res, int elem, int elemIdx, int param, int compIdx, float value )
Gets a string property of a resource element.
DLL const char *h3dGetResParamStr( H3DRes res, int elem, int elemIdx, int param )
Sets a string property of a resource element.
DLL void h3dSetResParamStr( H3DRes res, int elem, int elemIdx, int param, const char * value )
Maps the stream of a resource element.
DLL void *h3dMapResStream( H3DRes res, int elem, int elemIdx, int stream, bool read, bool write )
Unmaps a previously mapped resource stream.
DLL void h3dUnmapResStream( H3DRes res )
Returns handle to an unloaded resource.
DLL H3DRes h3dQueryUnloadedResource( int index )
Frees resources that are no longer used.
DLL void h3dReleaseUnusedResources()
Creates a Texture resource.
DLL H3DRes h3dCreateTexture( const char * name, int width, int height, int fmt, int flags )
Sets preambles of all Shader resources.
DLL void h3dSetShaderPreambles( const char * vertPreamble, const char * fragPreamble, const char * geomPreamble, const char * tessControlPreamble, const char * tessEvalPreamble, const char * computePreamble )
Sets a shader uniform of a Material resource.
DLL bool h3dSetMaterialUniform( H3DRes materialRes, const char * name, float a, float b, float c, float d )
Changes the size of the render targets of a pipeline.
DLL void h3dResizePipelineBuffers( H3DRes pipeRes, int width, int height )
Reads back the pixel data of a render target buffer.
DLL bool h3dGetRenderTargetData( H3DRes pipelineRes, const char * targetName, int bufIndex, int * width, int * height, int * compCount, void * dataBuffer, int bufferSize )
Returns the type of a scene node.
DLL int h3dGetNodeType( H3DNode node )
Returns the parent of a scene node.
DLL H3DNode h3dGetNodeParent( H3DNode node )
Relocates a node in the scene graph.
DLL bool h3dSetNodeParent( H3DNode node, H3DNode parent )
Returns the handle to a child node.
DLL H3DNode h3dGetNodeChild( H3DNode node, int index )
Adds nodes from a SceneGraph resource to the scene.
DLL H3DNode h3dAddNodes( H3DNode parent, H3DRes sceneGraphRes )
Removes a node from the scene.
DLL void h3dRemoveNode( H3DNode node )
Checks if a scene node has been transformed by the engine.
DLL bool h3dCheckNodeTransFlag( H3DNode node, bool reset )
Gets the relative transformation of a node.
DLL void h3dGetNodeTransform( H3DNode node, float * tx, float * ty, float * tz, float * rx, float * ry, float * rz, float * sx, float * sy, float * sz )
Sets the relative transformation of a node.
DLL void h3dSetNodeTransform( H3DNode node, float tx, float ty, float tz, float rx, float ry, float rz, float sx, float sy, float sz )
Returns the transformation matrices of a node.
DLL void h3dGetNodeTransMats( H3DNode node, const float ** relMat, const float ** absMat )
Sets the relative transformation matrix of a node.
DLL void h3dSetNodeTransMat( H3DNode node, const float * mat4x4 )
Gets a property of a scene node.
DLL int h3dGetNodeParamI( H3DNode node, int param )
Sets a property of a scene node.
DLL void h3dSetNodeParamI( H3DNode node, int param, int value )
Gets a property of a scene node.
DLL float h3dGetNodeParamF( H3DNode node, int param, int compIdx )
Sets a property of a scene node.
DLL void h3dSetNodeParamF( H3DNode node, int param, int compIdx, float value )
Gets a property of a scene node.
DLL const char *h3dGetNodeParamStr( H3DNode node, int param )
Sets a property of a scene node.
DLL void h3dSetNodeParamStr( H3DNode node, int param, const char * value )
Gets the scene node flags.
DLL int h3dGetNodeFlags( H3DNode node )
Sets the scene node flags.
DLL void h3dSetNodeFlags( H3DNode node, int flags, bool recursive )
Gets the bounding box of a scene node.
DLL void h3dGetNodeAABB( H3DNode node, float * minX, float * minY, float * minZ, float * maxX, float * maxY, float * maxZ )
Finds scene nodes with the specified properties.
DLL int h3dFindNodes( H3DNode startNode, const char * name, int type )
Gets a result from the findNodes query.
DLL H3DNode h3dGetNodeFindResult( int index )
Sets per-instance uniform data for a node.
DLL void h3dSetNodeUniforms( H3DNode node, float * uniformData, int count )
Performs a recursive ray collision query.
DLL int h3dCastRay( H3DNode node, float ox, float oy, float oz, float dx, float dy, float dz, int numNearest )
Returns a result of a previous castRay query.
DLL bool h3dGetCastRayResult( int index, H3DNode * node, float * distance, float * intersection )
Checks if a node is visible.
DLL int h3dCheckNodeVisibility( H3DNode node, H3DNode cameraNode, bool checkOcclusion, bool calcLod )
Adds a Group node to the scene.
DLL H3DNode h3dAddGroupNode( H3DNode parent, const char * name )
Adds a Model node to the scene.
DLL H3DNode h3dAddModelNode( H3DNode parent, const char * name, H3DRes geometryRes )
Configures an animation stage of a Model node.
DLL void h3dSetupModelAnimStage( H3DNode modelNode, int stage, H3DRes animationRes, int layer, const char * startNode, bool additive )
Gets the animation stage parameters of a Model node.
DLL void h3dGetModelAnimParams( H3DNode modelNode, int stage, float * time, float * weight )
Sets the animation stage parameters of a Model node.
DLL void h3dSetModelAnimParams( H3DNode modelNode, int stage, float time, float weight )
Sets the weight of a morph target.
DLL bool h3dSetModelMorpher( H3DNode modelNode, const char * target, float weight )
Applies animation and/or geometry updates.
DLL void h3dUpdateModel( H3DNode modelNode, int flags )
Adds a Mesh node to the scene.
DLL H3DNode h3dAddMeshNode( H3DNode parent, const char * name, H3DRes materialRes, int batchStart, int batchCount, int vertRStart, int vertREnd )
Adds a Joint node to the scene.
DLL H3DNode h3dAddJointNode( H3DNode parent, const char * name, int jointIndex )
Adds a Light node to the scene.
DLL H3DNode h3dAddLightNode( H3DNode parent, const char * name, H3DRes materialRes, const char * lightingContext, const char * shadowContext )
Adds a Camera node to the scene.
DLL H3DNode h3dAddCameraNode( H3DNode parent, const char * name, H3DRes pipelineRes )
Sets the planes of a camera viewing frustum.
DLL void h3dSetupCameraView( H3DNode cameraNode, float fov, float aspect, float nearDist, float farDist )
Gets the camera projection matrix.
DLL void h3dGetCameraProjMat( H3DNode cameraNode, float * projMat )
Sets the camera projection matrix.
DLL void h3dSetCameraProjMat( H3DNode cameraNode, float * projMat )
Adds a Emitter node to the scene.
DLL H3DNode h3dAddEmitterNode( H3DNode parent, const char * name, H3DRes materialRes, H3DRes particleEffectRes, int maxParticleCount, int respawnCount )
Advances emitter time and performs particle simulation.
DLL void h3dUpdateEmitter( H3DNode emitterNode, float timeDelta )
Checks if an Emitter node is still alive.
DLL bool h3dHasEmitterFinished( H3DNode emitterNode )
Adds a Compute node to the scene.
DLL H3DNode h3dAddComputeNode( H3DNode parent, const char * name, H3DRes materialRes, H3DRes compBufferRes, int drawType, int elementsCount )