vtNode Class Reference
[Scene Graph]

Inheritance diagram for vtNode:

Inheritance graph
[legend]
List of all members.

Detailed Description

Represents a node in the vtlib scenegraph. The scenegraph is simply a tree of nodes, with a root node at the top.


Public Member Functions

virtual void Release ()
void SetEnabled (bool bOn)
bool GetEnabled () const
void SetName2 (const char *str)
const char * GetName2 () const
void GetBoundBox (FBox3 &box)
 Get the Bounding Box of the node, in world coordinates.
void GetBoundSphere (FSphere &sphere, bool bGlobal=false)
void GetPrimCounts (vtPrimInfo &info)
 Get information about the number of display primitives.
void LocalToWorld (FPoint3 &point)
 Transform a point from a node's local coordinates to world coordinates.
vtGroupGetParent (int iParent=0)
void SetFog (bool bOn, float start=0, float end=10000, const RGBf &color=s_white, enum FogType Type=FM_LINEAR)
void ApplyVertexRotation (const FPoint3 &axis, float angle)
void ApplyVertexTransform (const FMatrix4 &mat)

Static Public Member Functions

static vtNodeLoadModel (const char *filename, bool bAllowCache=true, bool bDisableMipmaps=false)
 Load a 3D model file.


Member Function Documentation

void vtNode::ApplyVertexRotation const FPoint3 axis,
float  angle
 

Given a node with geometry under it, rotate the vertices of that geometry by a given axis/angle.

void vtNode::ApplyVertexTransform const FMatrix4 mat  ) 
 

Given any node with geometry under it, transform the vertices of that geometry.

void vtNode::GetBoundBox FBox3 box  )  [virtual]
 

Calculates the bounding box of the geometry contained in and under this node in the scene graph. Note that unlike bounding sphere which is cached, this value is calculated every time.

Parameters:
box Will receive the bounding box.

Implements vtNodeBase.

void vtNode::GetBoundSphere FSphere sphere,
bool  bGlobal = false
[virtual]
 

Get the Bounding Sphere of the node

Implements vtNodeBase.

bool vtNode::GetEnabled  )  const [virtual]
 

Return the enabled state of a node.

Implements vtNodeBase.

const char * vtNode::GetName2  )  const [virtual]
 

Get the name of the node.

Implements vtNodeBase.

vtGroup * vtNode::GetParent int  iParent = 0  )  [virtual]
 

Return the parent of this node in the scene graph. If the node is not in the scene graph, NULL is returned.

Parameters:
iParent If the node has multiple parents, you can specify which one you want.

Implements vtNodeBase.

void vtNode::GetPrimCounts vtPrimInfo info  ) 
 

This method walks through a node (and all its children), collecting information about all the geometric primitives. The result is placed in an object of type vtPrimInfo. This includes information such as number of vertices, number of triangles, and so forth. Note that this can be a time-consuming operation if your geometry is large or complex. The results are not cached, so this method should be called only when needed.

Parameters:
info A vtPrimInfo object which will receive all the information about this node and its children.

vtNode * vtNode::LoadModel const char *  filename,
bool  bAllowCache = true,
bool  bDisableMipmaps = false
[static]
 

Load a 3D model from a file.

The underlying scenegraph (e.g. OSG) is used to load the model, which is returned as a vtNode. You can then use this node normally, for example add it to your scenegraph with vtGroup::AddChild(), or to your terrain's subgraph with vtTerrain::AddNode().

Parameters:
filename The filename to load from.
bAllowCache Default is true, to allow vtosg to cache models. This means that if you load from the same filename more than once, you will get the same model again instantly. If you don't want this, for example if the model has changed on disk and you want to force loading, pass false.
bDisableMipmaps Pass true to turn off mipmapping in the texture maps in the loaded model. Default is false (enable mipmapping).
Returns:
A node pointer if successful, or NULL if the load failed.

void vtNode::LocalToWorld FPoint3 point  ) 
 

Transform a 3D point from a node's local frame of reference to world coordinates. This is done by walking the scene graph upwards, applying all transforms that are encountered.

Parameters:
point A reference to the input point is modified in-place with world coordinate result.

void vtNode::Release  )  [virtual]
 

Releases a node. Use this method instead of C++'s delete operator when you are done with a node. Internally, the node is reference counted so it is not deleted until all references to it are removed.

Implements vtNodeBase.

Reimplemented in vtLodGrid, vtSimpleLodGrid, vtPagedStructureLOD, vtPagedStructureLodGrid, vtGroup, vtTransform, vtLight, vtGeom, vtLOD, and vtHUD.

void vtNode::SetEnabled bool  bOn  )  [virtual]
 

Set the enabled state of this node. When the node is not enabled, it is not rendered. If it is a group node, all of the nodes children are also not rendered.

Implements vtNodeBase.

Reimplemented in vtLight.

void vtNode::SetFog bool  bOn,
float  start = 0,
float  end = 10000,
const RGBf color = s_white,
enum FogType  Type = FM_LINEAR
 

Set the Fog state for a node.

You can turn fog on or off. When you turn fog on, it affects this node and all others below it in the scene graph.

Parameters:
bOn True to turn fog on, false to turn it off.
start The distance from the camera at which fog starts, in meters.
end The distance from the camera at which fog end, in meters. This is the point at which it becomes totally opaque.
color The color of the fog. All geometry will be faded toward this color.
Type Can be GL_LINEAR, GL_EXP or GL_EXP2 for linear or exponential increase of the fog density.

void vtNode::SetName2 const char *  str  )  [virtual]
 

Set the name of the node.

Implements vtNodeBase.


Generated on Tue Apr 22 10:11:07 2008 for vtlib library by  doxygen 1.4.5