vtScene Class Reference
[Scene Graph]

Inheritance diagram for vtScene:

Inheritance graph
[legend]
List of all members.

Detailed Description

A Scene is the all-encompassing container for all 3D objects that are to be managed and drawn by the scene graph / graphics pipeline functionality of vtlib.

A Scene currently encapsulates:


Public Member Functions

void SetRoot (vtGroup *pRoot)
 Set the root node, the top node of the scene graph.
void SetGlobalWireframe (bool bWire)
 Set global wireframe, which will force all objects to be drawn wireframe.
bool GetGlobalWireframe ()
 Get the global wireframe state.
bool Init (bool bStereo=false, int iStereoMode=0)
 Call this method once before calling any other vtlib methods.
void Shutdown ()
 Call this method after all other vtlib methods, to free memory.
float GetFrameRate ()
 Return the instantaneous framerate in frames per seconds estimated.
float GetTime ()
 Time in seconds since the scene began.
float GetFrameTime ()
 Time in seconds between the start of the previous frame and the current frame.
bool CameraRay (const IPoint2 &win, FPoint3 &pos, FPoint3 &dir, vtWindow *pWindow=NULL)
void WorldToScreen (const FPoint3 &point, IPoint2 &result)
void ComputeViewMatrix (FMatrix4 &mat)


Member Function Documentation

bool vtScene::CameraRay const IPoint2 win,
FPoint3 pos,
FPoint3 dir,
vtWindow pWindow = NULL
 

Convert window coordinates (in pixels) to a ray from the camera in world coordinates. Pixel coordinates are measured from the top left corner of the window: X right, Y down.

void vtScene::ComputeViewMatrix FMatrix4 mat  ) 
 

Compute the full current view transform as a matrix, which includes the projection of the camera and the transform to window coordinates.

This transform is the one used to convert XYZ points in world coodinates into XY window coordinates.

By inverting this matrix, you can "un-project" window coordinates back into the world.

Parameters:
mat This matrix will receive the current view transform.

bool vtScene::Init bool  bStereo = false,
int  iStereoMode = 0
 

Initialize the vtlib library, including the display and scene graph. You should call this function only once, before any other vtlib calls.

Parameters:
bStereo True for a stereo display output.
iStereoMode Currently for vtosg, supported values are 0 for Anaglyphic (red-blue) and 1 for Quad-buffer (shutter glasses).

void vtScene::WorldToScreen const FPoint3 point,
IPoint2 result
 

Convert a point in world coordinates to a window pixel coordinate, measured from the top left corner of the window: X right, Y down.


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