Kanzi Graphics Engine
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
kzu_mesh_node.h File Reference

Mesh node representing a 3D mesh. More...

Functions

kzsError kzuMeshNodeCreate (const struct KzcMemoryManager *memoryManager, kzString name, struct KzuUIDomain *uiDomain, struct KzuMesh *mesh, struct KzuMeshNode **out_meshNode)
 Creates a new mesh node. More...
 
kzsError kzuMeshNodeRegisterToFactory (const struct KzuFactory *factory)
 Registers mesh node type to factory. More...
 
kzsError kzuMeshNodeSetMesh (struct KzuMeshNode *meshNode, struct KzuMesh *mesh)
 Sets mesh for mesh node. More...
 
struct KzuMeshkzuMeshNodeGetMesh (const struct KzuMeshNode *meshNode)
 Gets a mesh from mesh node. More...
 
struct KzuMeshNodekzuMeshNodeFromObjectNode (const struct KzuObjectNode *objectNode)
 Returns mesh node from object node. More...
 
struct KzuObjectNodekzuMeshNodeToObjectNode (const struct KzuMeshNode *meshNode)
 Returns an object node from mesh node. More...
 

Variables

const KzuObjectType KZU_OBJECT_TYPE_MESH
 Object type identifier for mesh objects. More...
 

Detailed Description

Mesh node representing a 3D mesh.

Inherited from KzuObjectNode.

Mesh Node Messages

KzuMeshNode does not send or receive any messages.

Mesh Node Properties

KZU_PROPERTY_TYPE_MESH resource ID property specifies the KzuMesh belonging to this node. This mesh is only used if KZ_NULL was passed to kzuMeshNodeCreate as the mesh and the mesh was not set with kzuMeshNodeSetMesh.

KZU_PROPERTY_TYPE_DRAWN_AS_BOUNDING_BOX Boolean property specifies whether or not the mesh should be drawn as a bounding box. The default value is KZ_FALSE.

Mesh Node Example Code

The following code creates a simple 3D box KzuMeshNode.

kzsError result;
struct KzuRenderer* renderer = kzuEngineGetRenderer(engine);
struct KzuMaterial* material = kzuRendererGetSolidColorMaterial(renderer);
struct KzuMesh* boxMesh;
struct KzuMeshNode* boxNode;
result = kzuMeshCreateBox(resourceManager, "box mesh", 1.0f, 1.0f, 1.0f, material, &boxMesh);
result = kzuMeshNodeCreate(memoryManager, "box node", uiDomain, boxMesh, &boxNode);
// Mesh node has taken a reference to the mesh, release ours.
// Add the mesh node into the 3D scene.
// Do something else.
// Free memory.

Copyright 2008-2019 by Rightware. All rights reserved.

Function Documentation

kzsError kzuMeshNodeCreate ( const struct KzcMemoryManager memoryManager,
kzString  name,
struct KzuUIDomain uiDomain,
struct KzuMesh mesh,
struct KzuMeshNode **  out_meshNode 
)

Creates a new mesh node.

kzsError kzuMeshNodeRegisterToFactory ( const struct KzuFactory factory)

Registers mesh node type to factory.

kzsError kzuMeshNodeSetMesh ( struct KzuMeshNode meshNode,
struct KzuMesh mesh 
)

Sets mesh for mesh node.

struct KzuMesh* kzuMeshNodeGetMesh ( const struct KzuMeshNode meshNode)

Gets a mesh from mesh node.

struct KzuMeshNode* kzuMeshNodeFromObjectNode ( const struct KzuObjectNode objectNode)

Returns mesh node from object node.

struct KzuObjectNode* kzuMeshNodeToObjectNode ( const struct KzuMeshNode meshNode)

Returns an object node from mesh node.

Variable Documentation

const KzuObjectType KZU_OBJECT_TYPE_MESH

Object type identifier for mesh objects.