newspeoplefor developersdocumentationdownloads

nShapeNode Class Reference
[Scene Nodes]

#include <nshapenode.h>

Inheritance diagram for nShapeNode:

nMaterialNode nAbstractShaderNode nTransformNode nSceneNode nRoot nObject nNode nReferenced nSignalEmitter nMultiLayeredNode nParticleShapeNode nParticleShapeNode2 nSkinShapeNode nSubdivShapeNode nSwingShapeNode nTextShapeNode List of all members.

Detailed Description

A shape node is the simplest actually visible object in the scene node class hierarchy.

It is derived from nMaterialNode, and thus inherits transform and shader information. It adds a simple mesh which it can render.

See also nShapeNode Script Interface

(C) 2002 RadonLabs GmbH

Definition at line 23 of file nshapenode.h.


Public Member Functions

 nShapeNode ()
 constructor
virtual ~nShapeNode ()
 destructor
virtual bool SaveCmds (nPersistServer *ps)
 object persistency
virtual bool LoadResources ()
 load resources
virtual void UnloadResources ()
 unload resources
virtual bool HasGeometry () const
 indicate to scene server that we offer geometry for rendering
virtual bool ApplyGeometry (nSceneServer *sceneServer)
 perform pre-instancing rendering of geometry
virtual bool RenderGeometry (nSceneServer *sceneServer, nRenderContext *renderContext)
 perform per-instance-rendering of geometry
virtual void RenderDebug (nSceneServer *sceneServer, nRenderContext *renderContext, const matrix44 &modelMatrix)
 render debug information
void SetMeshUsage (int usage)
 set the mesh usage flags required by this shape node
int GetMeshUsage () const
 get the mesh usage flags required by this shape node
void SetNeedsVertexShader (bool b)
 explicitly set the "needs vertex shader" mesh usage flag
bool GetNeedsVertexShader () const
 explicitly get the "needs vertex shader" mesh usage flag
void SetMesh (const nString &name)
 set the mesh resource name
const nStringGetMesh () const
 get the mesh resource name
nMesh2GetMeshObject ()
 get mesh2 object
void SetGroupIndex (int i)
 set the mesh group index
int GetGroupIndex () const
 get the mesh group index
void SetMeshResourceLoader (const char *resourceLoaderPath)
 set the NOH path to the mesh's resource loader
const char * GetMeshResourceLoader ()
 get the mesh's resource loader

Protected Member Functions

bool LoadMesh ()
 load mesh resource
void UnloadMesh ()
 unload mesh resource

Protected Attributes

int meshUsage
nRef< nMesh2refMesh
nString meshName
int groupIndex
nDynAutoRef< nResourceLoaderrefMeshResourceLoader

Constructor & Destructor Documentation

nShapeNode::nShapeNode  ) 
 

constructor

Definition at line 14 of file nshapenode_main.cc.

nShapeNode::~nShapeNode  )  [virtual]
 

destructor

Definition at line 24 of file nshapenode_main.cc.


Member Function Documentation

virtual bool nShapeNode::SaveCmds nPersistServer ps  )  [virtual]
 

object persistency

Reimplemented from nMaterialNode.

Reimplemented in nSwingShapeNode, nMultiLayeredNode, nParticleShapeNode, nParticleShapeNode2, nSkinShapeNode, and nSubdivShapeNode.

bool nShapeNode::LoadResources  )  [virtual]
 

load resources

Load the resources needed by this object.

Reimplemented from nMaterialNode.

Reimplemented in nSwingShapeNode, and nTextShapeNode.

Definition at line 102 of file nshapenode_main.cc.

void nShapeNode::UnloadResources  )  [virtual]
 

unload resources

Unload the resources if refcount has reached zero.

Reimplemented from nMaterialNode.

Reimplemented in nSwingShapeNode, and nTextShapeNode.

Definition at line 117 of file nshapenode_main.cc.

bool nShapeNode::HasGeometry  )  const [inline, virtual]
 

indicate to scene server that we offer geometry for rendering

Indicate to scene server that we provide geometry

Reimplemented from nSceneNode.

Definition at line 90 of file nshapenode.h.

bool nShapeNode::ApplyGeometry nSceneServer sceneServer  )  [virtual]
 

perform pre-instancing rendering of geometry

Perform pre-instancing actions needed for rendering geometry. This is called once before multiple instances of this shape node are actually rendered.

Reimplemented from nSceneNode.

Reimplemented in nParticleShapeNode, nParticleShapeNode2, nSkinShapeNode, nSubdivShapeNode, and nTextShapeNode.

Definition at line 130 of file nshapenode_main.cc.

bool nShapeNode::RenderGeometry nSceneServer sceneServer,
nRenderContext renderContext
[virtual]
 

perform per-instance-rendering of geometry

Update geometry, set as current mesh in the gfx server and call nGfxServer2::DrawIndexedNS().

Reimplemented from nSceneNode.

Reimplemented in nMultiLayeredNode, nParticleShapeNode, nParticleShapeNode2, nSkinShapeNode, nSubdivShapeNode, and nTextShapeNode.

Definition at line 151 of file nshapenode_main.cc.

void nShapeNode::RenderDebug nSceneServer sceneServer,
nRenderContext renderContext,
const matrix44 modelMatrix
[virtual]
 

render debug information

Render debugging information for this mesh (normals, tangents, binormals).

Reimplemented from nSceneNode.

Reimplemented in nSkinShapeNode.

Definition at line 211 of file nshapenode_main.cc.

void nShapeNode::SetMeshUsage int  usage  )  [inline]
 

set the mesh usage flags required by this shape node

Definition at line 120 of file nshapenode.h.

int nShapeNode::GetMeshUsage  )  const [inline]
 

get the mesh usage flags required by this shape node

Reimplemented in nSwingShapeNode, nParticleShapeNode, nParticleShapeNode2, nSkinShapeNode, and nSubdivShapeNode.

Definition at line 130 of file nshapenode.h.

void nShapeNode::SetNeedsVertexShader bool  b  )  [inline]
 

explicitly set the "needs vertex shader" mesh usage flag

Definition at line 140 of file nshapenode.h.

bool nShapeNode::GetNeedsVertexShader  )  const [inline]
 

explicitly get the "needs vertex shader" mesh usage flag

Definition at line 157 of file nshapenode.h.

void nShapeNode::SetMesh const nString name  ) 
 

set the mesh resource name

Set the resource name. The mesh resource name consists of the filename of the mesh.

Definition at line 163 of file nshapenode_main.cc.

const nString & nShapeNode::GetMesh  )  const
 

get the mesh resource name

Definition at line 174 of file nshapenode_main.cc.

nMesh2 * nShapeNode::GetMeshObject  ) 
 

get mesh2 object

Returns mesh2 object. If not loaded yet, it will be loaded.

Definition at line 34 of file nshapenode_main.cc.

void nShapeNode::SetGroupIndex int  i  )  [inline]
 

set the mesh group index

Definition at line 100 of file nshapenode.h.

int nShapeNode::GetGroupIndex  )  const [inline]
 

get the mesh group index

Definition at line 110 of file nshapenode.h.

void nShapeNode::SetMeshResourceLoader const char *  resourceLoaderPath  ) 
 

set the NOH path to the mesh's resource loader

Set the resource loader used to load the mesh data. If this is NULL, then the mesh is loaded through the default mesh loading code.

Definition at line 185 of file nshapenode_main.cc.

const char * nShapeNode::GetMeshResourceLoader  ) 
 

get the mesh's resource loader

Get the mesh resource loader.

Returns:
resource loader name or null when there is no resource loader

Definition at line 197 of file nshapenode_main.cc.

bool nShapeNode::LoadMesh  )  [protected]
 

load mesh resource

Load new mesh, release old one if valid. Also initializes the groupIndex member.

Definition at line 63 of file nshapenode_main.cc.

void nShapeNode::UnloadMesh  )  [protected]
 

unload mesh resource

Unload mesh resource if valid.

Definition at line 48 of file nshapenode_main.cc.


Member Data Documentation

int nShapeNode::meshUsage [protected]
 

Definition at line 76 of file nshapenode.h.

nRef<nMesh2> nShapeNode::refMesh [protected]
 

Definition at line 77 of file nshapenode.h.

nString nShapeNode::meshName [protected]
 

Definition at line 78 of file nshapenode.h.

int nShapeNode::groupIndex [protected]
 

Definition at line 79 of file nshapenode.h.

nDynAutoRef<nResourceLoader> nShapeNode::refMeshResourceLoader [protected]
 

Definition at line 80 of file nshapenode.h.


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

Copyright © 1999-2005 by the contributing authors. Ideas, requests, problems: Send feedback.