PowerVR Software Development Kit


Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

CPVRTPODScene Class Reference

#include <PVRTModelPOD.h>

Inheritance diagram for CPVRTPODScene:

Inheritance graph
[legend]
Collaboration diagram for CPVRTPODScene:

Collaboration graph
[legend]
List of all members.

Public Member Functions

bool ReadFromFile (const char *const pszFileName, char *const pszExpOpt=NULL, const size_t count=0)
bool ReadFromMemory (const SPODScene &scene)
bool InitImpl ()
void Destroy ()
void SetFrame (const VERTTYPE fFrame)
void GetRotationMatrix (PVRTMATRIX &mOut, const SPODNode &node) const
void GetScalingMatrix (PVRTMATRIX &mOut, const SPODNode &node) const
void GetTranslation (PVRTVECTOR3 &V, const SPODNode &node) const
void GetTranslationMatrix (PVRTMATRIX &mOut, const SPODNode &node) const
void GetWorldMatrixNoCache (PVRTMATRIX &mOut, const SPODNode &node) const
void GetWorldMatrix (PVRTMATRIX &mOut, const SPODNode &node) const
void GetBoneWorldMatrix (PVRTMATRIX &mOut, const SPODNode &NodeMesh, const SPODNode &NodeBone)
VERTTYPE GetCamera (PVRTVECTOR3 &vFrom, PVRTVECTOR3 &vTo, PVRTVECTOR3 &vUp, const unsigned int nIdx) const
VERTTYPE GetCameraPos (PVRTVECTOR3 &vFrom, PVRTVECTOR3 &vTo, const unsigned int nIdx) const
void GetLight (PVRTVECTOR3 &vPos, PVRTVECTOR3 &vDir, const unsigned int nIdx) const
bool CreateSkinIdxWeight (char *const pIdx, char *const pWeight, const int nVertexBones, const int *const pnBoneIdx, const VERTTYPE *const pfBoneWeight)
bool SavePOD (const char *const pszFilename, const char *const pszExpOpt=0)
bool SaveH (const char *const pszFilename, const char *const pszExpOpt=0)

Member Function Documentation



CreateSkinIdxWeight


bool CPVRTPODScene::CreateSkinIdxWeight char *const  pIdx,
char *const  pWeight,
const int  nVertexBones,
const int *const  pnBoneIdx,
const VERTTYPE *const  pfBoneWeight
 

Outputs:
pIdx Four bytes containing matrix indices for vertex (0..255) (D3D: use UBYTE4)
pWeight Four bytes containing blend weights for vertex (0.0 .. 1.0) (D3D: use D3DCOLOR)
Inputs:
nVertexBones Number of bones this vertex uses
pnBoneIdx Pointer to 'nVertexBones' indices
pfBoneWeight Pointer to 'nVertexBones' blend weights
Description:
Creates the matrix indices and blend weights for a boned vertex. Call once per vertex of a boned mesh.



Destroy


void CPVRTPODScene::Destroy  ) 
 

Description:
Frees the memory allocated to store the scene in pScene.



GetBoneWorldMatrix


void CPVRTPODScene::GetBoneWorldMatrix PVRTMATRIX mOut,
const SPODNode NodeMesh,
const SPODNode NodeBone
 

Outputs:
mOut Bone world matrix
Inputs:
NodeMesh Mesh to take the bone matrix from
NodeBone Bone to take the matrix from
Description:
Generates the world matrix for the given bone.



GetCamera


VERTTYPE CPVRTPODScene::GetCamera PVRTVECTOR3 vFrom,
PVRTVECTOR3 vTo,
PVRTVECTOR3 vUp,
const unsigned int  nIdx
const
 

Outputs:
vFrom Position of the camera
vTo Target of the camera
vUp Up direction of the camera
Inputs:
nIdx Camera number
Returns:
Camera horizontal FOV
Description:
Calculate the From, To and Up vectors for the given camera. Uses animation data. Note that even if the camera has a target, *pvTo is not the position of that target. *pvTo is a position in the correct direction of the target, one unit away from the camera.



GetCameraPos


VERTTYPE CPVRTPODScene::GetCameraPos PVRTVECTOR3 vFrom,
PVRTVECTOR3 vTo,
const unsigned int  nIdx
const
 

Outputs:
vFrom Position of the camera
vTo Target of the camera
Inputs:
nIdx Camera number
Returns:
Camera horizontal FOV
Description:
Calculate the position of the camera and its target. Uses animation data. If the queried camera does not have a target, *pvTo is not changed.



GetLight


void CPVRTPODScene::GetLight PVRTVECTOR3 vPos,
PVRTVECTOR3 vDir,
const unsigned int  nIdx
const
 

Outputs:
vPos Position of the light
vDir Direction of the light
Inputs:
nIdx Light number
Description:
Calculate the position and direction of the given Light. Uses animation data.



GetRotationMatrix


void CPVRTPODScene::GetRotationMatrix PVRTMATRIX mOut,
const SPODNode node
const
 

Outputs:
mOut Rotation matrix
Inputs:
node Node to get the rotation matrix from
Description:
Generates the world matrix for the given Mesh Instance; applies the parent's transform too. Uses animation data.



GetScalingMatrix


void CPVRTPODScene::GetScalingMatrix PVRTMATRIX mOut,
const SPODNode node
const
 

Outputs:
mOut Scaling matrix
Inputs:
node Node to get the rotation matrix from
Description:
Generates the world matrix for the given Mesh Instance; applies the parent's transform too. Uses animation data.



GetTranslation


void CPVRTPODScene::GetTranslation PVRTVECTOR3 V,
const SPODNode node
const
 

Outputs:
V Translation vector
Inputs:
node Node to get the translation vector from
Description:
Generates the translation vector for the given Mesh Instance. Uses animation data.



GetTranslationMatrix


void CPVRTPODScene::GetTranslationMatrix PVRTMATRIX mOut,
const SPODNode node
const
 

Outputs:
mOut Translation matrix
Inputs:
node Node to get the translation matrix from
Description:
Generates the world matrix for the given Mesh Instance; applies the parent's transform too. Uses animation data.



GetWorldMatrix


void CPVRTPODScene::GetWorldMatrix PVRTMATRIX mOut,
const SPODNode node
const
 

Outputs:
mOut World matrix
Inputs:
node Node to get the world matrix from
Description:
Generates the world matrix for the given Mesh Instance; applies the parent's transform too. Uses animation data.



GetWorldMatrixNoCache


void CPVRTPODScene::GetWorldMatrixNoCache PVRTMATRIX mOut,
const SPODNode node
const
 

Outputs:
mOut World matrix
Inputs:
node Node to get the world matrix from
Description:
Generates the world matrix for the given Mesh Instance; applies the parent's transform too. Uses animation data.



InitImpl


bool CPVRTPODScene::InitImpl  ) 
 

Description:
Used by the Read*() fns to initialise implementation details. Should also be called by applications which manually build data in the POD structures for rendering; in this case call it after the data has been created. Otherwise, do not call this function.



ReadFromFile


bool CPVRTPODScene::ReadFromFile const char *const  pszFileName,
char *const  pszExpOpt = NULL,
const size_t  count = 0
 

Inputs:
pszFileName Filename to load
Outputs:
pszExpOpt String in which to place exporter options
Inputs:
count Maximum number of characters to store.
Returns:
TRUE if successful, FALSE if not
Description:
Loads the specified ".POD" file; returns the scene in pScene. This structure must later be destroyed with PVRTModelPODDestroy() to prevent memory leaks. ".POD" files are exported from 3D Studio MAX using a PowerVR plugin. If pszExpOpt is NULL, the scene is loaded; otherwise the scene is not loaded and pszExpOpt is filled in.



ReadFromMemory


bool CPVRTPODScene::ReadFromMemory const SPODScene scene  ) 
 

Inputs:
scene Scene data from the header file
Returns:
TRUE if successful, FALSE if not
Description:
Sets the scene data from the supplied data structure. Use when loading from .H files.



SaveH


bool CPVRTPODScene::SaveH const char *const  pszFilename,
const char *const  pszExpOpt = 0
 

Inputs:
pszFilename Filename to save to
pszExpOpt A string containing the options used by the exporter
Description:
Save a header file (.H).



SavePOD


bool CPVRTPODScene::SavePOD const char *const  pszFilename,
const char *const  pszExpOpt = 0
 

Inputs:
pszFilename Filename to save to
pszExpOpt A string containing the options used by the exporter
Description:
Save a binary POD file (.POD).



SetFrame


void CPVRTPODScene::SetFrame const VERTTYPE  fFrame  ) 
 

Inputs:
fFrame Frame number
Description:
Set the animation frame for which subsequent Get*() calls should return data.

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

Copyright © 1999-2006, PowerVR Technologies and partners. PowerVR Technologies is a division of Imagination Technologies Ltd.


Generated by DOXYGEN 1.3.6