kanzi::Renderer3D Class Reference

Renderer is the core component for assigning lights, meshes, cameras, skin animations etc. to lower level rendering. More...

#include <kanzi/core.ui/platform/graphics_backend/gl/renderer3d.hpp>

Public Types

typedef function< void(Renderer3D &, RenderPass &, KzuTransformedObjectNode &)> ApplyNodeFunction
 Function object type for applying specific type of nodes for rendering. More...
 
typedef MaterialSharedPtr(* OverrideMaterialCallback) (const KzuTransformedObjectNode *transformedObjectNode, MaterialSharedPtr material, unsigned int cluster, void *userData)
 Callback function for override materials. More...
 
typedef void(* FramebufferCallback) (unsigned int framebufferHandle)
 Callback prototype for setActiveFramebuffer. More...
 

Public Member Functions

 Renderer3D (const KzcMemoryManager *memoryManager, ResourceManager *resourceManager, Renderer *renderer)
 
 ~Renderer3D ()
 
void setLogging (bool logging)
 Enables or disables debug log writing. More...
 
void reset ()
 Resets renderer, that is, puts it to initial state. More...
 
void resetFrame ()
 Resets user renderer for frame, that is, clear property stack and core renderer per-frame variables. More...
 
void endFrame ()
 Ends a frame. More...
 
unsigned int getFrameCount () const
 Gets number of frames rendered by renderer. More...
 
void resetPass ()
 Resets pass for renderer, that is, per-render pass specific properties, such as lighting. More...
 
void printInfo () const
 Ends frame for renderer. More...
 
void applyLight (Light *lightNode, Matrix4x4 worldTransformation)
 Adds light property to rendering pipeline. Lights should be reset each pass by calling Renderer3DResetPass. More...
 
void applyRenderable (RenderPass &renderPass, KzuTransformedObjectNode &transformedNode)
 Applies renderable object for rendering. More...
 
void setTransformedObjectList (KzcDynamicArray *transformedObjectList)
 Sets transformed object list for renderer, used for fetching bones for mesh. More...
 
KzcDynamicArraygetTransformedObjectList () const
 Gets transformed object list from renderer. More...
 
void drawBuffers (Mesh *mesh, Node *baseNode, unsigned int cluster, const Material &material)
 Applies transformation and draws vertex and index buffers with current settings. More...
 
void drawBuffers (Morph *morph, Node *baseNode, unsigned int cluster, const Material &material)
 
ResourceManagergetResourceManager () const
 Gets renderer resource manager. More...
 
void applyFixedUniforms (ShaderProgram &shader)
 Apply fixed uniforms. More...
 
bool applyMaterial (const Node *node, const Material &material)
 Applies material to renderer, attaches the shader and uniforms. More...
 
bool applyMaterialStrict (const Node *node, const Material &material)
 Applies material to renderer, attaches the shader and uniforms. Does not allow material which shader has samplers without corresponding texture properties. More...
 
void applyCameraMatrix (Matrix4x4 cameraProjectionMatrix, Matrix4x4 cameraTransformationMatrix, float near, float far) const
 Applies camera matrices to renderer so that they can be applied as uniforms to shaders. More...
 
void setClearColorOverride (ColorRGBA colorRGBA)
 Sets clear color override for rendering. More...
 
void removeClearColorOverride ()
 Removes clear color override. More...
 
optional< ColorRGBAgetClearColorOverride () const
 Gets clear color override from renderer. Returns true if override enabled. More...
 
void setCullFaceOverride (bool enabled, GraphicsCullMode overriddenCullMode)
 Sets cull mode override. More...
 
bool getCullFaceOverride (GraphicsCullMode *out_overriddenCullMode) const
 Returns cull face override. More...
 
void setClearColorBufferOverride (bool enabled)
 Sets clear color buffer override for renderer. More...
 
bool getClearColorBufferOverride () const
 Returns if clear color buffer override is set. More...
 
void setDisableColorWrite (bool setDisabled)
 Sets color write disabled, overrides render pass settings. More...
 
bool isColorWriteDisabled () const
 Returns if color write is disabled. More...
 
void setRenderPassInputObjectSourceOverride (FilterObjectSourceSharedPtr overrideObjectSource)
 Sets render pass input object source override. 0 to not override. More...
 
FilterObjectSourceSharedPtr getRenderPassInputObjectSourceOverride () const
 Gets render pass input object source override. More...
 
void setForcedMaterial (Material *material)
 Sets forced material for rendering, none of the properties are inherited from the object node. More...
 
void setOverrideMaterial (MaterialSharedPtr material)
 Sets current override material, which is used instead of all default materials. Setting material to 0 disables overrides. More...
 
MaterialSharedPtr getOverrideClusterMaterial (const KzuTransformedObjectNode *transformedObjectNode, MaterialSharedPtr clusterMaterial, unsigned int clusterIndex) const
 Gets overriding material for given transformed object node and cluster material. More...
 
void setActiveGraphicsOutput (const GraphicsOutput *graphicsOutput)
 Sets active graphics output for renderer. More...
 
const GraphicsOutputgetActiveGraphicsOutput () const
 Gets active graphics output from renderer. More...
 
void setSubRectangleProjection (float x, float y, float width, float height)
 Turn on sub-rectangle of what would be the normal projection with given relative parameters. More...
 
void disableSubRectangleProjection ()
 Disable sub-rectangle of projection. More...
 
float getInheritedAspectRatioMultiplier () const
 Get the multiplier to inherited aspect ratio. More...
 
RenderergetCoreRenderer () const
 Returns core renderer from user renderer. More...
 
void setBoundingBoxVisualizationEnabled (bool enabled)
 Sets bounding box visualization enabled / disabled. More...
 
bool isBoundingBoxVisualizationEnabled () const
 Returns if bounding box visualization is enabled. More...
 
void setSkeletonVisualizationEnabled (bool enabled)
 Sets skeleton visualization enabled / disabled. More...
 
bool isSkeletonVisualizationEnabled () const
 Returns if skeleton visualization is enabled. More...
 
float * getFloatBuffer () const
 Returns float buffer from renderer. More...
 
void setOverrideMaterialCallback (OverrideMaterialCallback callbackFunction, void *userData)
 Set override material callback. Pass 0 to disable. More...
 
OverrideMaterialCallback getOverrideMaterialCallback () const
 Gets override material callback from renderer, 0 if not enabled. More...
 
void * getOverrideMaterialCallbackUserData () const
 Gets override material callback user data from renderer. More...
 
void setFramebufferCallback (FramebufferCallback callbackFunction)
 Sets callback function for setActiveFrameBuffer. Called each time engine changes framebuffer. More...
 
CompositionStackgetCompositionStack ()
 Returns the render context stack. More...
 
void drawLayerOutlineQuad (float width, float height, Material &material, float textureHeight, float textureOffset, ColorRGBA color, Matrix4x4 worldTransformation)
 
void drawBoundingVolumeRaw (const KzuBoundingVolume *boundingVolume, KzcMatrix4x4 &worldTransformation)
 Draw bounding volume. Material has already been defined. More...
 
void drawTransformedBoundingVolumeSolidNormal (const KzuTransformedBoundingVolume &volume)
 Draws a transformed solid bounding volume with the current rendering settings. More...
 
void drawSelectionIndicator (const KzuBoundingVolume *boundingVolume, Matrix4x4 worldTransformation, Material &material, ColorRGBA color)
 Draws a selection indicator, resembles a bounding volume. More...
 
void drawPrimitives (const float *vertexList, unsigned int vertexCount, GraphicsPrimitiveType type, Matrix4x4 worldTransformation) const
 Draws primitives of the given type. More...
 
void drawPrimitivesNormal (const float *vertexList, const float *normalList, unsigned int vertexCount, GraphicsPrimitiveType type, Matrix4x4 worldTransformation)
 Draws primitives of the given type. More...
 
void drawLineList (const float *lineList, unsigned int lineCount, Matrix4x4 worldTransformation) const
 Draws a line list with current settings. Handles only position data. More...
 
void drawPrimitiveBufferUntextured (const float *coordinateBuffer, Matrix4x4 worldTransform, GraphicsPrimitiveType type, unsigned int count) const
 Draw primitive buffer. More...
 
void drawPrimitiveBufferTextured (const float *coordinateBuffer, const float *texCoordBuffer, Matrix4x4 worldTransform, GraphicsPrimitiveType type, unsigned int count) const
 Draw primitive buffer. More...
 
void drawQuad (Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4, Vector2 textureSpan, Material &material, optional< ColorRGBA > color, Matrix4x4 worldTransformation)
 Draws a quad. More...
 
void drawLayerQuad (Vector2 renderOffset, Vector2 renderSize, Vector2 contentOffset, Vector2 contentSize, float depth, Matrix3x3 renderTransform)
 Render a layer quad. More...
 
void drawLayerQuadWithMaterial (const Material &material, Vector2 renderOffset, Vector2 renderSize, Vector2 contentOffset, Vector2 contentSize, float depth, Matrix3x3 renderTransform)
 Render a layer quad. More...
 
void drawUntexturedLayerQuad (Vector2 renderOffset, Vector2 renderSize, const Material &material, Matrix4x4 worldTransformation)
 As rendering a layer quad, but omit everything concerning texture coordinates. More...
 
void drawViewportQuadWithTextureSpan (Vector2 offset, Vector2 limits, Material &material, TextureSharedPtr texture)
 Draws viewport quad, fills with given pattern. More...
 
void drawViewportQuadWithTextureSpan (Vector2 offset, Vector2 limits, Material &material, TextureSharedPtr texture, ColorRGBA color)
 Draws viewport quad, fills with given pattern. More...
 
void drawViewportQuadWithTextureSpan (Vector2 offset, Vector2 limits, Material &material, Vector2 textureSpan, ColorRGBA color)
 Draws viewport quad, fills with given pattern. More...
 
void applyStencilSettings (bool stencilTestEnabled, unsigned int stencilRef, unsigned int stencilMask, GraphicsCompareFunction stencilFunction, GraphicsStencilOperation stencilOperationStencilFail, GraphicsStencilOperation stencilOperationStencilPassDepthFail, GraphicsStencilOperation stencilOperationStencilPassDepthPass) const
 Applies stencil settings with overrides for rendering. More...
 
void setDefaultOrthoProjection () const
 Sets default orthogonal projection and viewport for renderer. More...
 
bool applyColorMaterial (const Node *node, Material &material, ColorRGBA color)
 Applies the given material with the given emissive color. More...
 
void drawCamera (const Camera *cameraNode, Material &material, Matrix4x4 worldTransformation)
 Draws a wire frame camera symbol. More...
 
void drawTrajectory (Trajectory *trajectory, Material &material, Matrix4x4 worldTransformation, Matrix4x4 arrangeTransform, Vector3 scaling)
 Draws a trajectory with wire frame lines. More...
 
void drawBoxSolidNormal (Vector3 backBottomLeft, Vector3 frontTopRight, Material &material, ColorRGBA color, Matrix4x4 worldTransform)
 Draws a solid box given by two opposite corner points. More...
 

Static Public Member Functions

static Vector3 calculateNormal (Vector3 rightPoint, Vector3 middlePoint, Vector3 upPoint)
 Calculates normal for plane defined by three points. More...
 
static void addVertexToFloatArray (Vector3 vertex, float *&destinationArray)
 Adds a vertex to the destination array from the given vertex pointer. More...
 
static void addVertexAndNormalToFloatArrays (Vector3 vertex, Vector3 normal, float *&vertexArray, float *&normalArray)
 Adds a vertex and a normal to their destination arrays. More...
 

Detailed Description

Renderer is the core component for assigning lights, meshes, cameras, skin animations etc. to lower level rendering.

Member Typedef Documentation

Function object type for applying specific type of nodes for rendering.

typedef MaterialSharedPtr(* kanzi::Renderer3D::OverrideMaterialCallback) (const KzuTransformedObjectNode *transformedObjectNode, MaterialSharedPtr material, unsigned int cluster, void *userData)

Callback function for override materials.

typedef void(* kanzi::Renderer3D::FramebufferCallback) (unsigned int framebufferHandle)

Callback prototype for setActiveFramebuffer.

Constructor & Destructor Documentation

kanzi::Renderer3D::Renderer3D ( const KzcMemoryManager memoryManager,
ResourceManager resourceManager,
Renderer renderer 
)
explicit
kanzi::Renderer3D::~Renderer3D ( )

Member Function Documentation

void kanzi::Renderer3D::setLogging ( bool  logging)

Enables or disables debug log writing.

void kanzi::Renderer3D::reset ( )

Resets renderer, that is, puts it to initial state.

void kanzi::Renderer3D::resetFrame ( )

Resets user renderer for frame, that is, clear property stack and core renderer per-frame variables.

void kanzi::Renderer3D::endFrame ( )

Ends a frame.

unsigned int kanzi::Renderer3D::getFrameCount ( ) const

Gets number of frames rendered by renderer.

void kanzi::Renderer3D::resetPass ( )

Resets pass for renderer, that is, per-render pass specific properties, such as lighting.

void kanzi::Renderer3D::printInfo ( ) const

Ends frame for renderer.

void kanzi::Renderer3D::applyLight ( Light lightNode,
Matrix4x4  worldTransformation 
)

Adds light property to rendering pipeline. Lights should be reset each pass by calling Renderer3DResetPass.

void kanzi::Renderer3D::applyRenderable ( RenderPass renderPass,
KzuTransformedObjectNode transformedNode 
)

Applies renderable object for rendering.

Called from LegacyRenderPass. This function is no longer needed by new render passes.

Parameters
renderPassCalling render pass.
transformedObjectNodeNode to render.
void kanzi::Renderer3D::setTransformedObjectList ( KzcDynamicArray transformedObjectList)

Sets transformed object list for renderer, used for fetching bones for mesh.

KzcDynamicArray* kanzi::Renderer3D::getTransformedObjectList ( ) const

Gets transformed object list from renderer.

void kanzi::Renderer3D::drawBuffers ( Mesh mesh,
Node baseNode,
unsigned int  cluster,
const Material material 
)

Applies transformation and draws vertex and index buffers with current settings.

void kanzi::Renderer3D::drawBuffers ( Morph morph,
Node baseNode,
unsigned int  cluster,
const Material material 
)
ResourceManager* kanzi::Renderer3D::getResourceManager ( ) const

Gets renderer resource manager.

void kanzi::Renderer3D::applyFixedUniforms ( ShaderProgram shader)

Apply fixed uniforms.

Called by applyMaterial(). Should be called by user if applying a material manually.

Parameters
shaderShader to apply fixed uniforms for.
bool kanzi::Renderer3D::applyMaterial ( const Node node,
const Material material 
)

Applies material to renderer, attaches the shader and uniforms.

bool kanzi::Renderer3D::applyMaterialStrict ( const Node node,
const Material material 
)

Applies material to renderer, attaches the shader and uniforms. Does not allow material which shader has samplers without corresponding texture properties.

void kanzi::Renderer3D::applyCameraMatrix ( Matrix4x4  cameraProjectionMatrix,
Matrix4x4  cameraTransformationMatrix,
float  near,
float  far 
) const

Applies camera matrices to renderer so that they can be applied as uniforms to shaders.

void kanzi::Renderer3D::setClearColorOverride ( ColorRGBA  colorRGBA)

Sets clear color override for rendering.

void kanzi::Renderer3D::removeClearColorOverride ( )

Removes clear color override.

optional<ColorRGBA> kanzi::Renderer3D::getClearColorOverride ( ) const

Gets clear color override from renderer. Returns true if override enabled.

void kanzi::Renderer3D::setCullFaceOverride ( bool  enabled,
GraphicsCullMode  overriddenCullMode 
)

Sets cull mode override.

bool kanzi::Renderer3D::getCullFaceOverride ( GraphicsCullMode out_overriddenCullMode) const

Returns cull face override.

void kanzi::Renderer3D::setClearColorBufferOverride ( bool  enabled)

Sets clear color buffer override for renderer.

bool kanzi::Renderer3D::getClearColorBufferOverride ( ) const

Returns if clear color buffer override is set.

void kanzi::Renderer3D::setDisableColorWrite ( bool  setDisabled)

Sets color write disabled, overrides render pass settings.

bool kanzi::Renderer3D::isColorWriteDisabled ( ) const

Returns if color write is disabled.

void kanzi::Renderer3D::setRenderPassInputObjectSourceOverride ( FilterObjectSourceSharedPtr  overrideObjectSource)

Sets render pass input object source override. 0 to not override.

FilterObjectSourceSharedPtr kanzi::Renderer3D::getRenderPassInputObjectSourceOverride ( ) const

Gets render pass input object source override.

void kanzi::Renderer3D::setForcedMaterial ( Material material)

Sets forced material for rendering, none of the properties are inherited from the object node.

void kanzi::Renderer3D::setOverrideMaterial ( MaterialSharedPtr  material)

Sets current override material, which is used instead of all default materials. Setting material to 0 disables overrides.

MaterialSharedPtr kanzi::Renderer3D::getOverrideClusterMaterial ( const KzuTransformedObjectNode transformedObjectNode,
MaterialSharedPtr  clusterMaterial,
unsigned int  clusterIndex 
) const

Gets overriding material for given transformed object node and cluster material.

Parameters
transformedObjectNodeTransformed object node to get overriding material for.
clusterMaterialCluster material that would be used.
clusterIndexCluster index.
Returns
Overriding material. May be empty if not overridden.
void kanzi::Renderer3D::setActiveGraphicsOutput ( const GraphicsOutput graphicsOutput)

Sets active graphics output for renderer.

const GraphicsOutput* kanzi::Renderer3D::getActiveGraphicsOutput ( ) const

Gets active graphics output from renderer.

void kanzi::Renderer3D::setSubRectangleProjection ( float  x,
float  y,
float  width,
float  height 
)

Turn on sub-rectangle of what would be the normal projection with given relative parameters.

void kanzi::Renderer3D::disableSubRectangleProjection ( )

Disable sub-rectangle of projection.

float kanzi::Renderer3D::getInheritedAspectRatioMultiplier ( ) const

Get the multiplier to inherited aspect ratio.

Renderer* kanzi::Renderer3D::getCoreRenderer ( ) const

Returns core renderer from user renderer.

void kanzi::Renderer3D::setBoundingBoxVisualizationEnabled ( bool  enabled)

Sets bounding box visualization enabled / disabled.

bool kanzi::Renderer3D::isBoundingBoxVisualizationEnabled ( ) const

Returns if bounding box visualization is enabled.

void kanzi::Renderer3D::setSkeletonVisualizationEnabled ( bool  enabled)

Sets skeleton visualization enabled / disabled.

bool kanzi::Renderer3D::isSkeletonVisualizationEnabled ( ) const

Returns if skeleton visualization is enabled.

float* kanzi::Renderer3D::getFloatBuffer ( ) const

Returns float buffer from renderer.

Float buffer contains maximum of KZU_RENDERER_FLOAT_BUFFER_LENGTH elements, and it's used for dynamic vertex arrays.

void kanzi::Renderer3D::setOverrideMaterialCallback ( OverrideMaterialCallback  callbackFunction,
void *  userData 
)

Set override material callback. Pass 0 to disable.

OverrideMaterialCallback kanzi::Renderer3D::getOverrideMaterialCallback ( ) const

Gets override material callback from renderer, 0 if not enabled.

void* kanzi::Renderer3D::getOverrideMaterialCallbackUserData ( ) const

Gets override material callback user data from renderer.

void kanzi::Renderer3D::setFramebufferCallback ( FramebufferCallback  callbackFunction)

Sets callback function for setActiveFrameBuffer. Called each time engine changes framebuffer.

CompositionStack& kanzi::Renderer3D::getCompositionStack ( )

Returns the render context stack.

Parameters
rendererRenderer to access.
Returns
Render context stack from renderer.
void kanzi::Renderer3D::drawLayerOutlineQuad ( float  width,
float  height,
Material material,
float  textureHeight,
float  textureOffset,
ColorRGBA  color,
Matrix4x4  worldTransformation 
)
void kanzi::Renderer3D::drawBoundingVolumeRaw ( const KzuBoundingVolume boundingVolume,
KzcMatrix4x4 worldTransformation 
)

Draw bounding volume. Material has already been defined.

void kanzi::Renderer3D::drawTransformedBoundingVolumeSolidNormal ( const KzuTransformedBoundingVolume volume)

Draws a transformed solid bounding volume with the current rendering settings.

Draws with vertex positions and normals.

void kanzi::Renderer3D::drawSelectionIndicator ( const KzuBoundingVolume boundingVolume,
Matrix4x4  worldTransformation,
Material material,
ColorRGBA  color 
)

Draws a selection indicator, resembles a bounding volume.

void kanzi::Renderer3D::drawPrimitives ( const float *  vertexList,
unsigned int  vertexCount,
GraphicsPrimitiveType  type,
Matrix4x4  worldTransformation 
) const

Draws primitives of the given type.

Takes vertex position data as a parameter.

void kanzi::Renderer3D::drawPrimitivesNormal ( const float *  vertexList,
const float *  normalList,
unsigned int  vertexCount,
GraphicsPrimitiveType  type,
Matrix4x4  worldTransformation 
)

Draws primitives of the given type.

Takes vertex position and normal data as parameters.

void kanzi::Renderer3D::drawLineList ( const float *  lineList,
unsigned int  lineCount,
Matrix4x4  worldTransformation 
) const

Draws a line list with current settings. Handles only position data.

void kanzi::Renderer3D::drawPrimitiveBufferUntextured ( const float *  coordinateBuffer,
Matrix4x4  worldTransform,
GraphicsPrimitiveType  type,
unsigned int  count 
) const

Draw primitive buffer.

Parameters
rendererRenderer to use.
coordinateBufferCoordinate buffer to bind.
worldTransformWorld transformation.
typePrimitive type to render.
countNumber of vertices to send.
void kanzi::Renderer3D::drawPrimitiveBufferTextured ( const float *  coordinateBuffer,
const float *  texCoordBuffer,
Matrix4x4  worldTransform,
GraphicsPrimitiveType  type,
unsigned int  count 
) const

Draw primitive buffer.

Parameters
rendererRenderer to use.
coordinateBufferCoordinate buffer to bind.
texCoordBufferTexture coordinate buffer to bind.
worldTransformWorld transformation.
typePrimitive type to render.
countNumber of vertices to send.
void kanzi::Renderer3D::drawQuad ( Vector3  p1,
Vector3  p2,
Vector3  p3,
Vector3  p4,
Vector2  textureSpan,
Material material,
optional< ColorRGBA color,
Matrix4x4  worldTransformation 
)

Draws a quad.

void kanzi::Renderer3D::drawLayerQuad ( Vector2  renderOffset,
Vector2  renderSize,
Vector2  contentOffset,
Vector2  contentSize,
float  depth,
Matrix3x3  renderTransform 
)

Render a layer quad.

Material used for rendering the quad must be applied prior to this call, one way or another.

Parameters
rendererRenderer to use.
renderOffsetQuad start offset.
renderSizeQuad start size.
contentOffsetTexture coordinate start offset.
contentSizeTexture coordinate size.
depthRender depth.
renderTransformRender transformation.
Returns
Error code.
void kanzi::Renderer3D::drawLayerQuadWithMaterial ( const Material material,
Vector2  renderOffset,
Vector2  renderSize,
Vector2  contentOffset,
Vector2  contentSize,
float  depth,
Matrix3x3  renderTransform 
)

Render a layer quad.

Parameters
rendererRenderer to use.
materialMaterial to be applied before rendering the quad.
renderOffsetQuad start offset.
renderSizeQuad start size.
contentOffsetTexture coordinate start offset.
contentSizeTexture corodinate size.
depthRender depth.
renderTransformRender transformation.
Returns
Error code.
void kanzi::Renderer3D::drawUntexturedLayerQuad ( Vector2  renderOffset,
Vector2  renderSize,
const Material material,
Matrix4x4  worldTransformation 
)

As rendering a layer quad, but omit everything concerning texture coordinates.

void kanzi::Renderer3D::drawViewportQuadWithTextureSpan ( Vector2  offset,
Vector2  limits,
Material material,
TextureSharedPtr  texture 
)

Draws viewport quad, fills with given pattern.

Whole texture is used.

Parameters
offsetPosition of quad.
limitsSize of quad.
materialMaterial to use.
textureTexture to use.
void kanzi::Renderer3D::drawViewportQuadWithTextureSpan ( Vector2  offset,
Vector2  limits,
Material material,
TextureSharedPtr  texture,
ColorRGBA  color 
)

Draws viewport quad, fills with given pattern.

Whole texture is used, specified color is passed to material.

Parameters
offsetPosition of quad.
limitsSize of quad.
materialMaterial to use.
textureTexture to use.
colorColor that is passed to the material.
void kanzi::Renderer3D::drawViewportQuadWithTextureSpan ( Vector2  offset,
Vector2  limits,
Material material,
Vector2  textureSpan,
ColorRGBA  color 
)

Draws viewport quad, fills with given pattern.

Provided texture coordinates are used, specified color is passed to material.

Parameters
offsetPosition of quad.
limitsSize of quad.
materialMaterial to use.
textureTexture to use.
textureSpanArea of texture to use.
colorColor that is passed to the material.
void kanzi::Renderer3D::applyStencilSettings ( bool  stencilTestEnabled,
unsigned int  stencilRef,
unsigned int  stencilMask,
GraphicsCompareFunction  stencilFunction,
GraphicsStencilOperation  stencilOperationStencilFail,
GraphicsStencilOperation  stencilOperationStencilPassDepthFail,
GraphicsStencilOperation  stencilOperationStencilPassDepthPass 
) const

Applies stencil settings with overrides for rendering.

void kanzi::Renderer3D::setDefaultOrthoProjection ( ) const

Sets default orthogonal projection and viewport for renderer.

bool kanzi::Renderer3D::applyColorMaterial ( const Node node,
Material material,
ColorRGBA  color 
)

Applies the given material with the given emissive color.

void kanzi::Renderer3D::drawCamera ( const Camera cameraNode,
Material material,
Matrix4x4  worldTransformation 
)

Draws a wire frame camera symbol.

void kanzi::Renderer3D::drawTrajectory ( Trajectory trajectory,
Material material,
Matrix4x4  worldTransformation,
Matrix4x4  arrangeTransform,
Vector3  scaling 
)

Draws a trajectory with wire frame lines.

void kanzi::Renderer3D::drawBoxSolidNormal ( Vector3  backBottomLeft,
Vector3  frontTopRight,
Material material,
ColorRGBA  color,
Matrix4x4  worldTransform 
)

Draws a solid box given by two opposite corner points.

The corner points are assumed axis-aligned and are transformed with the given transform before drawing. Uses the current rendering settings.

static Vector3 kanzi::Renderer3D::calculateNormal ( Vector3  rightPoint,
Vector3  middlePoint,
Vector3  upPoint 
)
inlinestatic

Calculates normal for plane defined by three points.

static void kanzi::Renderer3D::addVertexToFloatArray ( Vector3  vertex,
float *&  destinationArray 
)
inlinestatic

Adds a vertex to the destination array from the given vertex pointer.

static void kanzi::Renderer3D::addVertexAndNormalToFloatArrays ( Vector3  vertex,
Vector3  normal,
float *&  vertexArray,
float *&  normalArray 
)
inlinestatic

Adds a vertex and a normal to their destination arrays.


The documentation for this class was generated from the following file: