C# Class Horde3DNET.Horde3D

Mostra file Open project: mgottschlag/horde3d Class Usage Examples

Public Methods

Method Description
addCameraNode ( int parent, string name, int pipelineRes ) : int

This function creates a new Camera node and attaches it to the specified parent node.

addEmitterNode ( int parent, string name, int matRes, int effectRes, int maxParticleCount, int respawnCount ) : int

This function creates a new Emitter node and attaches it to the specified parent node.

addGroupNode ( int parent, string name ) : int

This function creates a new Group node and attaches it to the specified parent node.

addJointNode ( int parent, string name, int jointIndex ) : int

This function creates a new Joint node and attaches it to the specified parent node.

addLightNode ( int parent, string name, int materialRes, string lightingContext, string shadowContext ) : int

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.

addMeshNode ( int parent, string name, int matRes, int batchStart, int batchCount, int vertRStart, int vertREnd ) : int

This function creates a new Mesh node and attaches it to the specified parent node.

addModelNode ( int parent, string name, int geoRes ) : int

This function creates a new Model node and attaches it to the specified parent node.

addNodes ( int parent, int res ) : int

This function creates several new nodes as described in a SceneGraph resource and attaches them to a specified parent node.

addResource ( int type, string name, int flags ) : int

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 found, the handle to the existing resource is returned instead of creating a new one.

advanceEmitterTime ( int node, float timeDelta ) : bool

This function advances the simulation time of a particle system and continues the particle simulation with timeDelta being the time elapsed since the last call of this function.

castRay ( int node, float ox, float oy, float oz, float dx, float dy, float dz, int numNearest ) : int

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.

checkExtension ( string extensionName ) : bool

This function checks if a specified extension is contained in the DLL/shared object of the engine.

checkNodeTransformFlag ( int node, bool reset ) : bool

Checks if a scene node has been transformed by the engine.

checkNodeVisibility ( int node, int cameraNode, bool checkOcclusion, bool calcLod ) : int

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.

clear ( ) : void

This function removes all nodes from the scene graph except the root node and releases all resources. Warning: All resource and node IDs are invalid after calling this function.

clearOverlays ( ) : void

Clears the overlays added before using showOverlay

cloneResource ( int sourceRes, string name ) : int

Duplicates a resource.

*Note: The name string may not contain a colon character (:)*

createTexture2D ( string name, int flags, int width, int height, bool renderable ) : int

Adds a Texture2D resource.

*Note: The name string may not contain a colon character (:)*

finalizeFrame ( ) : bool

This function tells the engine that the current frame is finished and that all subsequent rendering operations will be for the next frame.

findNodes ( int node, string name, int type ) : int

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.

findResource ( int type, string name ) : int

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.

The content path of the specified ResourceType is added automatically.

getCameraProjectionMatrix ( int node, float projMat ) : bool

This function gets the camera projection matrix used for bringing the geometry to screen space and copies it to the specified array.

getCastRayResult ( int index, int node, float &distance, float intersection ) : bool

Returns a result of a previous castRay query.

getMessage ( int &level, float &time ) : string

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.

getNextResource ( int type, int start ) : int

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.

getNodeAABB ( int node, float &minX, float &minY, float &minZ, float &maxX, float &maxY, float &maxZ ) : bool

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.

getNodeChild ( int node, int index ) : int

Returns the handle to a child node.

getNodeFindResult ( int index ) : int

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.

getNodeParamf ( int node, int param ) : float

getNodeParami ( int node, int param ) : int

getNodeParamstr ( int node, int param ) : string

Gets a property of a scene node.

getNodeParent ( int node ) : int

Returns the parent of a scene node.

getNodeTransform ( int node, float &px, float &py, float &pz, float &rx, float &ry, float &rz, float &sx, float &sy, float &sz ) : bool

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.

getNodeTransformMatrices ( int node, IntPtr &relMat, IntPtr &absMat ) : bool

This function returns a pointer to the relative and absolute transformation matrices of the specified node in the specified pointer variables.

getNodeType ( int node ) : SceneNodeTypes

Reads the pixel data of a pipeline render target buffer.

This function returns the type of a specified scene node. If the node handle is invalid, the function returns the node type 'Unknown'.

getOption ( EngineOptions param ) : float

This function gets a specified option parameter and returns its value.

getResourceData ( int res, int param ) : IntPtr

This function returns a pointer to the specified data of a specified resource. For information on the format (int, float, ..) of the pointer see the ResourceData description.

getResourceName ( int res ) : string

Returns the name of a resource.

getResourceParamf ( int res, int param ) : float

Gets a property of a resource.

getResourceParami ( int res, int param ) : int

Gets a property of a resource.

getResourceParamstr ( int res, int param ) : string

Gets a property of a resource.

getResourceType ( int res ) : int

This function returns the type of a specified resource. If the resource handle is invalid, the function returns the resource type 'Unknown'.

getStat ( EngineStats param, bool reset ) : float

Gets a statistic value of the engine.

getVersionString ( ) : string

This function returns a string containing the current version of Horde3D.

hasEmitterFinished ( int emitterNode ) : bool

Checks if an Emitter node is still alive.

init ( ) : bool

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.

isResourceLoaded ( int res ) : bool

Checks if a resource is loaded.

loadResource ( int res, byte data, int size ) : bool

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. *Important Note: XML-data must be NULL-terminated*

queryUnloadedResource ( int index ) : int

Returns handle to an unloaded resource.

release ( ) : void

This function releases the engine and frees all objects and associated memory. It should be called when the application is destroyed.

releaseUnusedResources ( ) : void

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.

removeNode ( int node ) : bool

This function removes the specified node and all of it's children from the scene.

removeResource ( int res ) : int

Removes a resource.

render ( int node ) : bool

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. camera node used for rendering scene true in case of success, otherwise false

setLightContexts ( int node, string lightingContext, string shadowContext ) : bool

This function sets the lighting and shadow shader contexts of the specified light source. The contexts define which shader code is used when doing lighting calculations or rendering the shadow map. The function works on a Light node or a Group node in which case the call is recursively passed to all child Light nodes.

setMaterialSampler ( int materialRes, string name, int texRes ) : bool

Binds a texture to a sampler of a Material resource.

setMaterialUniform ( int materialRes, string name, float a, float b, float c, float d ) : bool

This function sets the specified shader uniform of the specified material to the specified values.

setModelAnimParams ( int node, int stage, float time, float weight ) : bool

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. When the sum of the weights of all stages is more than one, the animations on the lower stages get priority. The function operates on Model nodes but accepts also Group nodes in which case the call is passed recursively to the Model child nodes.

setModelMorpher ( int node, string target, float weight ) : bool

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. The function operates on Model nodes but accepts also Group nodes in which case the call is passed recursively to the Model child nodes. If the specified morph target is not found the function returns false.

setNodeActivation ( int node, bool active ) : bool

This function sets the activation state of the specified node to active or inactive. Inactive nodes are excluded from rendering.

setNodeParamf ( int node, int param, float value ) : bool

setNodeParami ( int node, int param, int value ) : bool

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 ResHandle.

setNodeParamstr ( int node, int param, string value ) : bool

Sets a property of a scene node.

setNodeParent ( int node, int parent ) : bool

Relocates a node in the scene graph.

setNodeTransform ( int node, float px, float py, float pz, float rx, float ry, float rz, float sx, float sy, float sz ) : bool

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.

setNodeTransformMatrix ( int node, float mat4x4 ) : bool

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.

setOption ( EngineOptions param, float value ) : bool

This function sets a specified option parameter to a specified value.

setPipelineStageActivation ( int pipelineRes, string stageName, bool enabled ) : bool

Sets the activation state of a pipeline stage.

setResourceParamf ( int res, int param, float value ) : bool

Sets a property of a resource.

setResourceParami ( int res, int param, int value ) : bool

Sets a property of a resource.

setResourceParamstr ( int res, int param, string value ) : bool

Sets a property of a resource.

setShaderPreambles ( string vertPreamble, string fragPreamble ) : void

Sets preambles of all Shader resources.

setupCameraView ( int node, float fov, float aspect, float nearDist, float farDist ) : bool

This function calculates the view frustum planes of the specified camera node using the specified view parameters.

setupModelAnimStage ( int node, int stage, int res, string animMask, bool additive ) : bool

This function is used to setup the specified animation stage (channel) of the specified Model node.

The function operates on Model nodes but accepts also Group nodes in which case the call is passed recursively to the Model child nodes. The function is used for animation blending. There is a fixed number of stages (by default 16) on which different animations can be played. The animation mask determines which child-nodes of the model (joints or meshes) are affected by the specified animation on the stage to be configured. If the mask is an empty string, the animation affects all nodes. Otherwise the mask can contain several node names separated by the two character sequence. When a mask is specified, the initial state of all nodes is 'not affected by animation'. For every node in the mask the function recurses down the (skeleton-) hierarchy starting at the currently processed node in the mask and inverts the state of the considered nodes. This makes it possible to do complex animation mixing. A simpler 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 to the current transformation of the joints or meshes.

setupViewport ( int x, int y, int width, int height, bool resizeBuffers ) : void

This function sets the location and size of the viewport. It has to be called after engine initialization and whenever the size of the rendering context/window changes. The resizeBuffers parameter specifies whether render targets with a size relative to the viewport dimensions should be resized. This is usually desired after engine initialization and when the window is resized but not for just rendering to a part of the framebuffer.

showOverlay ( float x_ll, float y_ll, float u_ll, float v_ll, float x_lr, float y_lr, float u_lr, float v_lr, float x_ur, float y_ur, float u_ur, float v_ur, float x_ul, float y_ul, float u_ul, float v_ul, float colR, float colG, float colB, float colA, int layer, int material ) : void

This function displays an overlay with a specified material at a specified position on the screen.

An overlay is a 2D image that can be used to render 2D GUI elements. The coordinate system used has its origin (0, 0) at the lower left corner of the screen and its maximum (1, 1) at the upper right corner. Texture coordinates are using the same system, where the coordinates (0, 0) correspond to the lower left corner of the image. Overlays can have different layers which describe the order in which they are drawn. Overlays with smaller layer numbers are drawn before overlays with higher layer numbers.

unloadResource ( int res ) : bool

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.

updateResourceData ( int res, int param, byte data, int size ) : bool

This function updates the content of a resource that was successfully loaded before. The new data must have exactly the same data layout as the data that was loaded.

Notes on available ResourceData parameters: Tex2DPixelData - Sets the image data of a Texture2D resource. The data must point to a memory block that contains the pixels of the image. Each pixel needs to have 32 bit color data in BGRA format. The dimensions of the image (width, height) must be exactly the same as the dimensions of the image that was originally loaded for the resource. PLEASE NOTE: calls to updateResourceData are not threadsafe and so it might not work in case you have a separated render thread.

Method Details

addCameraNode() public static method

This function creates a new Camera node and attaches it to the specified parent node.
public static addCameraNode ( int parent, string name, int pipelineRes ) : int
parent int handle to parent node to which the new node will be attached
name string name of the node
pipelineRes int
return int

addEmitterNode() public static method

This function creates a new Emitter node and attaches it to the specified parent node.
public static addEmitterNode ( int parent, string name, int matRes, int effectRes, int maxParticleCount, int respawnCount ) : int
parent int handle to parent node to which the new node will be attached
name string name of the node
matRes int handle to material resource used for rendering
effectRes int handle to effect resource used for configuring particle properties
maxParticleCount int maximal number of particles living at the same time
respawnCount int number of times a single particle is recreated after dying (-1 for infinite)
return int

addGroupNode() public static method

This function creates a new Group node and attaches it to the specified parent node.
public static addGroupNode ( int parent, string name ) : int
parent int handle to parent node to which the new node will be attached
name string name of the node
return int

addJointNode() public static method

This function creates a new Joint node and attaches it to the specified parent node.
public static addJointNode ( int parent, string name, int jointIndex ) : int
parent int handle to parent node to which the new node will be attached
name string name of the node
jointIndex int index of joint in Geometry resource of parent Model node
return int

addLightNode() public static method

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.
public static addLightNode ( int parent, string name, int materialRes, string lightingContext, string shadowContext ) : int
parent int handle to parent node to which the new node will be attached
name string name of the node
materialRes int material resource for light configuration or 0 if not used
lightingContext string name of the shader context used for doing light calculations
shadowContext string name of the shader context used for doing shadow map rendering
return int

addMeshNode() public static method

This function creates a new Mesh node and attaches it to the specified parent node.
public static addMeshNode ( int parent, string name, int matRes, int batchStart, int batchCount, int vertRStart, int vertREnd ) : int
parent int handle to parent node to which the new node will be attached
name string name of the node
matRes int Material resource used by Mesh node
batchStart int first vertex index in Geometry resource of parent Model node
batchCount int number of vertex indices in Geometry resource of parent Model node
vertRStart int minimum vertex array index contained in Geometry resource indices of parent Model node
vertREnd int maximum vertex array index contained in Geometry resource indices of parent Model node
return int

addModelNode() public static method

This function creates a new Model node and attaches it to the specified parent node.
public static addModelNode ( int parent, string name, int geoRes ) : int
parent int handle to parent node to which the new node will be attached
name string name of the node
geoRes int Geometry resource used by Model node
return int

addNodes() public static method

This function creates several new nodes as described in a SceneGraph resource and attaches them to a specified parent node.
public static addNodes ( int parent, int res ) : int
parent int handle to parent node to which the root of the new nodes will be attached
res int handle to the SceneGraph resource
return int

addResource() public static method

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 found, the handle to the existing resource is returned instead of creating a new one.
public static addResource ( int type, string name, int flags ) : int
type int type of the resource
name string name of the resource
flags int flags used for creating the resource
return int

advanceEmitterTime() public static method

This function advances the simulation time of a particle system and continues the particle simulation with timeDelta being the time elapsed since the last call of this function.
public static advanceEmitterTime ( int node, float timeDelta ) : bool
node int handle to the Emitter node which will be modified
timeDelta float time delta in seconds
return bool

castRay() public static method

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.
public static castRay ( int node, float ox, float oy, float oz, float dx, float dy, float dz, int numNearest ) : int
node int node at which intersection check is beginning
ox float ray origin
oy float ray origin
oz float ray origin
dx float ray direction vector also specifying ray length
dy float ray direction vector also specifying ray length
dz float ray direction vector also specifying ray length
numNearest int maximum number of intersection points to be stored (0 for all)
return int

checkExtension() public static method

This function checks if a specified extension is contained in the DLL/shared object of the engine.
public static checkExtension ( string extensionName ) : bool
extensionName string name of the extension
return bool

checkNodeTransformFlag() public static method

Checks if a scene node has been transformed by the engine.
public static checkNodeTransformFlag ( int node, bool reset ) : bool
node int handle to the node to be accessed
reset bool flag indicating whether transformation flag shall be reset
return bool

checkNodeVisibility() public static method

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.
public static checkNodeVisibility ( int node, int cameraNode, bool checkOcclusion, bool calcLod ) : int
node int node to be checked for visibility
cameraNode int camera node from which the visibility test is done
checkOcclusion bool specifies if occlusion info from previous frame should be taken into account
calcLod bool specifies if LOD level should be computed
return int

clear() public static method

This function removes all nodes from the scene graph except the root node and releases all resources. Warning: All resource and node IDs are invalid after calling this function.
public static clear ( ) : void
return void

clearOverlays() public static method

Clears the overlays added before using showOverlay
public static clearOverlays ( ) : void
return void

cloneResource() public static method

Duplicates a resource.
*Note: The name string may not contain a colon character (:)*
public static cloneResource ( int sourceRes, string name ) : int
sourceRes int handle to resource to be cloned
name string name of new resource (can be empty for auto-naming)
return int

createTexture2D() public static method

Adds a Texture2D resource.
*Note: The name string may not contain a colon character (:)*
public static createTexture2D ( string name, int flags, int width, int height, bool renderable ) : int
name string name of the resource
flags int flags used for creating the resource
width int width of the texture image
height int height of the texture image
renderable bool flag indicating whether the texture can be used as an output buffer for a Camera node
return int

finalizeFrame() public static method

This function tells the engine that the current frame is finished and that all subsequent rendering operations will be for the next frame.
public static finalizeFrame ( ) : bool
return bool

findNodes() public static method

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.
public static findNodes ( int node, string name, int type ) : int
node int
name string
type int
return int

findResource() public static method

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.
The content path of the specified ResourceType is added automatically.
public static findResource ( int type, string name ) : int
type int type of the resource
name string name of the resource
return int

getCameraProjectionMatrix() public static method

This function gets the camera projection matrix used for bringing the geometry to screen space and copies it to the specified array.
public static getCameraProjectionMatrix ( int node, float projMat ) : bool
node int handle to Camera node
projMat float pointer to float array with 16 elements
return bool

getCastRayResult() public static method

Returns a result of a previous castRay query.
public static getCastRayResult ( int index, int node, float &distance, float intersection ) : bool
index int index of result to be accessed (range: 0 to number of results returned by castRay)
node int handle of intersected node
distance float distance from ray origin to intersection point
intersection float coordinates of intersection point (float[3] array)
return bool

getMessage() public static method

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.
public static getMessage ( int &level, float &time ) : string
level int pointer to variable for storing message level indicating importance (can be NULL)
time float pointer to variable for stroing time when message was added (can be NULL)
return string

getNextResource() public static method

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.
public static getNextResource ( int type, int start ) : int
type int type of the resource
start int name of the resource
return int

getNodeAABB() public static method

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.
public static getNodeAABB ( int node, float &minX, float &minY, float &minZ, float &maxX, float &maxY, float &maxZ ) : bool
node int handle to the node which will be accessed
minX float variable where minimum x-coordinates will be stored
minY float variable where minimum y-coordinates will be stored
minZ float variable where minimum z-coordinates will be stored
maxX float variable where maximum x-coordinates will be stored
maxY float variable where maximum y-coordinates will be stored
maxZ float variable where maximum z-coordinates will be stored
return bool

getNodeChild() public static method

Returns the handle to a child node.
public static getNodeChild ( int node, int index ) : int
node int handle to the parent node
index int index of the child node
return int

getNodeFindResult() public static method

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.
public static getNodeFindResult ( int index ) : int
index int index of search result
return int

getNodeParamf() public static method

public static getNodeParamf ( int node, int param ) : float
node int
param int
return float

getNodeParami() public static method

public static getNodeParami ( int node, int param ) : int
node int
param int
return int

getNodeParamstr() public static method

Gets a property of a scene node.
public static getNodeParamstr ( int node, int param ) : string
node int handle to the node to be accessed
param int parameter to be accessed
return string

getNodeParent() public static method

Returns the parent of a scene node.
public static getNodeParent ( int node ) : int
node int handle to the scene node
return int

getNodeTransform() public static method

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.
public static getNodeTransform ( int node, float &px, float &py, float &pz, float &rx, float &ry, float &rz, float &sx, float &sy, float &sz ) : bool
node int handle to the node which will be accessed
px float x variable where position of the node will be stored
py float y variable where position of the node will be stored
pz float z variable where position of the node will be stored
rx float x variable where rotation of the node in Euler angles (degrees) will be stored
ry float y variable where rotation of the node in Euler angles (degrees) will be stored
rz float z variable where rotation of the node in Euler angles (degrees) will be stored
sx float x variable where scale of the node will be stored
sy float y variable where scale of the node will be stored
sz float z variable where scale of the node will be stored
return bool

getNodeTransformMatrices() public static method

This function returns a pointer to the relative and absolute transformation matrices of the specified node in the specified pointer variables.
public static getNodeTransformMatrices ( int node, IntPtr &relMat, IntPtr &absMat ) : bool
node int handle to the scene node whose matrices will be accessed
relMat System.IntPtr pointer to a variable where the address of the relative transformation matrix will be stored
absMat System.IntPtr pointer to a variable where the address of the absolute transformation matrix will be stored
return bool

getNodeType() public static method

Reads the pixel data of a pipeline render target buffer. This function returns the type of a specified scene node. If the node handle is invalid, the function returns the node type 'Unknown'.
public static getNodeType ( int node ) : SceneNodeTypes
node int handle to the scene node whose type will be returned
return SceneNodeTypes

getOption() public static method

This function gets a specified option parameter and returns its value.
public static getOption ( EngineOptions param ) : float
param EngineOptions option parameter
return float

getResourceData() public static method

This function returns a pointer to the specified data of a specified resource. For information on the format (int, float, ..) of the pointer see the ResourceData description.
public static getResourceData ( int res, int param ) : IntPtr
res int handle to the resource to be accessed
param int parameter indicating data of the resource that will be accessed
return IntPtr

getResourceName() public static method

Returns the name of a resource.
public static getResourceName ( int res ) : string
res int handle to the resource
return string

getResourceParamf() public static method

Gets a property of a resource.
public static getResourceParamf ( int res, int param ) : float
res int handle to the resource to be accessed
param int parameter to be accessed
return float

getResourceParami() public static method

Gets a property of a resource.
public static getResourceParami ( int res, int param ) : int
res int handle to the resource to be accessed
param int parameter to be accessed
return int

getResourceParamstr() public static method

Gets a property of a resource.
public static getResourceParamstr ( int res, int param ) : string
res int handle to the resource to be accessed
param int parameter to be accessed
return string

getResourceType() public static method

This function returns the type of a specified resource. If the resource handle is invalid, the function returns the resource type 'Unknown'.
public static getResourceType ( int res ) : int
res int handle to the resource whose type will be returned
return int

getStat() public static method

Gets a statistic value of the engine.
public static getStat ( EngineStats param, bool reset ) : float
param EngineStats statistic parameter
reset bool flag specifying whether statistic value should be reset
return float

getVersionString() public static method

This function returns a string containing the current version of Horde3D.
public static getVersionString ( ) : string
return string

hasEmitterFinished() public static method

Checks if an Emitter node is still alive.
public static hasEmitterFinished ( int emitterNode ) : bool
emitterNode int emitterNode - handle to the Emitter node which is checked
return bool

init() public static method

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.
public static init ( ) : bool
return bool

isResourceLoaded() public static method

Checks if a resource is loaded.
public static isResourceLoaded ( int res ) : bool
res int handle to the resource to be checked
return bool

loadResource() public static method

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. *Important Note: XML-data must be NULL-terminated*
public static loadResource ( int res, byte data, int size ) : bool
res int
data byte the data to be loaded
size int size of the data block
return bool

queryUnloadedResource() public static method

Returns handle to an unloaded resource.
public static queryUnloadedResource ( int index ) : int
index int index of unloaded resource within the internal list of unloaded resources (starting with 0)
return int

release() public static method

This function releases the engine and frees all objects and associated memory. It should be called when the application is destroyed.
public static release ( ) : void
return void

releaseUnusedResources() public static method

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.
public static releaseUnusedResources ( ) : void
return void

removeNode() public static method

This function removes the specified node and all of it's children from the scene.
public static removeNode ( int node ) : bool
node int handle to the node to be removed
return bool

removeResource() public static method

Removes a resource.
public static removeResource ( int res ) : int
res int handle to the resource to be removed
return int

render() public static method

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. camera node used for rendering scene true in case of success, otherwise false
public static render ( int node ) : bool
node int
return bool

setLightContexts() public static method

This function sets the lighting and shadow shader contexts of the specified light source. The contexts define which shader code is used when doing lighting calculations or rendering the shadow map. The function works on a Light node or a Group node in which case the call is recursively passed to all child Light nodes.
public static setLightContexts ( int node, string lightingContext, string shadowContext ) : bool
node int handle to the node to be modified
lightingContext string name of the shader context used for performing lighting calculations
shadowContext string
return bool

setMaterialSampler() public static method

Binds a texture to a sampler of a Material resource.
public static setMaterialSampler ( int materialRes, string name, int texRes ) : bool
materialRes int
name string
texRes int
return bool

setMaterialUniform() public static method

This function sets the specified shader uniform of the specified material to the specified values.
public static setMaterialUniform ( int materialRes, string name, float a, float b, float c, float d ) : bool
materialRes int
name string name of the uniform as defined in Material resource
a float value of first component
b float value of second component
c float value of third component
d float value of fourth component
return bool

setModelAnimParams() public static method

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. When the sum of the weights of all stages is more than one, the animations on the lower stages get priority. The function operates on Model nodes but accepts also Group nodes in which case the call is passed recursively to the Model child nodes.
public static setModelAnimParams ( int node, int stage, float time, float weight ) : bool
node int handle to the node to be modified
stage int index of the animation stage to be modified
time float new animation time
weight float new animation weight
return bool

setModelMorpher() public static method

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. The function operates on Model nodes but accepts also Group nodes in which case the call is passed recursively to the Model child nodes. If the specified morph target is not found the function returns false.
public static setModelMorpher ( int node, string target, float weight ) : bool
node int handle to the node to be modified
target string name of morph target
weight float new weight for morph target
return bool

setNodeActivation() public static method

This function sets the activation state of the specified node to active or inactive. Inactive nodes are excluded from rendering.
public static setNodeActivation ( int node, bool active ) : bool
node int handle to the node to be modified
active bool boolean value indicating whether node is active or inactive
return bool

setNodeParamf() public static method

public static setNodeParamf ( int node, int param, float value ) : bool
node int
param int
value float
return bool

setNodeParami() public static method

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 ResHandle.
public static setNodeParami ( int node, int param, int value ) : bool
node int handle to the node to be modified
param int parameter to be modified
value int new value for the specified parameter
return bool

setNodeParamstr() public static method

Sets a property of a scene node.
public static setNodeParamstr ( int node, int param, string value ) : bool
node int handle to the node to be modified
param int parameter to be modified
value string new value for the specified parameter
return bool

setNodeParent() public static method

Relocates a node in the scene graph.
public static setNodeParent ( int node, int parent ) : bool
node int handle to the scene node to be relocated
parent int handle to the new parent node
return bool

setNodeTransform() public static method

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.
public static setNodeTransform ( int node, float px, float py, float pz, float rx, float ry, float rz, float sx, float sy, float sz ) : bool
node int handle to the node which will be modified
px float x position of the node
py float y position of the node
pz float z position of the node
rx float x rotation of the node in Euler angles (degrees)
ry float y rotation of the node in Euler angles (degrees)
rz float z rotation of the node in Euler angles (degrees)
sx float x scale of the node
sy float y scale of the node
sz float z scale of the node
return bool

setNodeTransformMatrix() public static method

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.
public static setNodeTransformMatrix ( int node, float mat4x4 ) : bool
node int handle to the scene node whose matrix will be updated
mat4x4 float array of a 4x4 matrix in column major order
return bool

setOption() public static method

This function sets a specified option parameter to a specified value.
public static setOption ( EngineOptions param, float value ) : bool
param EngineOptions option parameter
value float value of the option parameter
return bool

setPipelineStageActivation() public static method

Sets the activation state of a pipeline stage.
public static setPipelineStageActivation ( int pipelineRes, string stageName, bool enabled ) : bool
pipelineRes int handle to the Pipeline resource to be accessed
stageName string name of the stage to be modified
enabled bool flag indicating whether the stage shall be enabled or disabled
return bool

setResourceParamf() public static method

Sets a property of a resource.
public static setResourceParamf ( int res, int param, float value ) : bool
res int handle to the node to be modified
param int parameter to be modified
value float new value for the specified parameter
return bool

setResourceParami() public static method

Sets a property of a resource.
public static setResourceParami ( int res, int param, int value ) : bool
res int handle to the node to be modified
param int parameter to be modified
value int new value for the specified parameter
return bool

setResourceParamstr() public static method

Sets a property of a resource.
public static setResourceParamstr ( int res, int param, string value ) : bool
res int handle to the node to be modified
param int parameter to be modified
value string new value for the specified parameter
return bool

setShaderPreambles() public static method

Sets preambles of all Shader resources.
public static setShaderPreambles ( string vertPreamble, string fragPreamble ) : void
vertPreamble string preamble text of vertex shaders (default: empty string)
fragPreamble string preamble text of fragment shaders (default: empty string)
return void

setupCameraView() public static method

This function calculates the view frustum planes of the specified camera node using the specified view parameters.
public static setupCameraView ( int node, float fov, float aspect, float nearDist, float farDist ) : bool
node int handle to the Camera node which will be modified
fov float field of view (FOV) in degrees
aspect float aspect ratio
nearDist float distance of near clipping plane
farDist float distance of far clipping plane
return bool

setupModelAnimStage() public static method

This function is used to setup the specified animation stage (channel) of the specified Model node.
The function operates on Model nodes but accepts also Group nodes in which case the call is passed recursively to the Model child nodes. The function is used for animation blending. There is a fixed number of stages (by default 16) on which different animations can be played. The animation mask determines which child-nodes of the model (joints or meshes) are affected by the specified animation on the stage to be configured. If the mask is an empty string, the animation affects all nodes. Otherwise the mask can contain several node names separated by the two character sequence. When a mask is specified, the initial state of all nodes is 'not affected by animation'. For every node in the mask the function recurses down the (skeleton-) hierarchy starting at the currently processed node in the mask and inverts the state of the considered nodes. This makes it possible to do complex animation mixing. A simpler 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 to the current transformation of the joints or meshes.
public static setupModelAnimStage ( int node, int stage, int res, string animMask, bool additive ) : bool
node int handle to the node to be modified
stage int index of the animation stage to be configured
res int handle to Animation resource
animMask string mask defining which nodes will be affected by animation
additive bool flag indicating whether stage is additive
return bool

setupViewport() public static method

This function sets the location and size of the viewport. It has to be called after engine initialization and whenever the size of the rendering context/window changes. The resizeBuffers parameter specifies whether render targets with a size relative to the viewport dimensions should be resized. This is usually desired after engine initialization and when the window is resized but not for just rendering to a part of the framebuffer.
public static setupViewport ( int x, int y, int width, int height, bool resizeBuffers ) : void
x int the x-position of the viewport in the rendering context
y int the y-position of the viewport in the rendering context
width int the width of the viewport
height int the height of the viewport
resizeBuffers bool specifies whether render targets should be adapted to new size
return void

showOverlay() public static method

This function displays an overlay with a specified material at a specified position on the screen.
An overlay is a 2D image that can be used to render 2D GUI elements. The coordinate system used has its origin (0, 0) at the lower left corner of the screen and its maximum (1, 1) at the upper right corner. Texture coordinates are using the same system, where the coordinates (0, 0) correspond to the lower left corner of the image. Overlays can have different layers which describe the order in which they are drawn. Overlays with smaller layer numbers are drawn before overlays with higher layer numbers.
public static showOverlay ( float x_ll, float y_ll, float u_ll, float v_ll, float x_lr, float y_lr, float u_lr, float v_lr, float x_ur, float y_ur, float u_ur, float v_ur, float x_ul, float y_ul, float u_ul, float v_ul, float colR, float colG, float colB, float colA, int layer, int material ) : void
x_ll float x position of the lower left corner
y_ll float y position of the lower left corner
u_ll float u texture coordinate of the lower left corner
v_ll float v texture coordinate of the lower left corner
x_lr float x position of the lower right corner
y_lr float y position of the lower right corner
u_lr float u texture coordinate of the lower right corner
v_lr float v texture coordinate of the lower right corner
x_ur float x position of the upper right corner
y_ur float y position of the upper right corner
u_ur float u texture coordinate of the upper right corner
v_ur float v texture coordinate of the upper right corner
x_ul float x position of the upper left corner
y_ul float y position of the upper left corner
u_ul float u texture coordinate of the upper left corner
v_ul float v texture coordinate of the upper left corner
colR float red color value of the overlay that is set for the material's shader
colG float green color value of the overlay that is set for the material's shader
colB float blue color value of the overlay that is set for the material's shader
colA float alpha color value of the overlay that is set for the material's shader
layer int layer index of the overlay (Values: from 0 to 7)
material int material resource used for rendering
return void

unloadResource() public static method

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.
public static unloadResource ( int res ) : bool
res int handle to resource to be unloaded
return bool

updateResourceData() public static method

This function updates the content of a resource that was successfully loaded before. The new data must have exactly the same data layout as the data that was loaded.
Notes on available ResourceData parameters: Tex2DPixelData - Sets the image data of a Texture2D resource. The data must point to a memory block that contains the pixels of the image. Each pixel needs to have 32 bit color data in BGRA format. The dimensions of the image (width, height) must be exactly the same as the dimensions of the image that was originally loaded for the resource. PLEASE NOTE: calls to updateResourceData are not threadsafe and so it might not work in case you have a separated render thread.
public static updateResourceData ( int res, int param, byte data, int size ) : bool
res int handle to the resource for which the data is modified
param int data structure which will be updated
data byte the new data
size int size of the new data block
return bool