PowerVR Software Development Kit |
00001 /*!*************************************************************************** 00002 @File PVRTTrans.h 00003 00004 @Brief Header file of PVRTTrans.cpp Contains structure definitions 00005 and prototypes of all functions in PVRTTrans.cpp 00006 00007 @Author PowerVR 00008 00009 @Date July 1998 00010 00011 @Copyright Copyright 2003-2004 by Imagination Technologies Limited. 00012 All rights reserved. No part of this software, either 00013 material or conceptual may be copied or distributed, 00014 transmitted, transcribed, stored in a retrieval system 00015 or translated into any human or computer language in any 00016 form by any means, electronic, mechanical, manual or 00017 other-wise, or disclosed to third parties without the 00018 express written permission of Imagination Technologies 00019 Limited, Unit 8, HomePark Industrial Estate, 00020 King's Langley, Hertfordshire, WD4 8LZ, U.K. 00021 00022 @Platform ANSI compatible 00023 00024 @Description Header file of PVRTTrans.cpp Contains structure definitions 00025 and prototypes of all functions in PVRTTrans.cpp 00026 00027 $Revision: 1.9 $ 00028 *****************************************************************************/ 00029 #ifndef _PVRTTRANS_H_ 00030 #define _PVRTTRANS_H_ 00031 00032 00033 /**************************************************************************** 00034 ** Typedefs 00035 ****************************************************************************/ 00036 typedef struct PVRTBOUNDINGBOX_TAG 00037 { 00038 PVRTVECTOR3 Point[8]; 00039 } PVRTBOUNDINGBOX, *LPPVRTBOUNDINGBOX; 00040 00041 /**************************************************************************** 00042 ** Functions 00043 ****************************************************************************/ 00044 00045 /*!*************************************************************************** 00046 @Function PVRTTransComputeBoundingBox 00047 @Output pBoundingBox 00048 @Input pV 00049 @Input nNumberOfVertices 00050 @Description Calculate the eight vertices that surround an object. 00051 This "bounding box" is used later to determine whether 00052 the object is visible or not. 00053 This function should only be called once to determine the 00054 object's bounding box. 00055 *****************************************************************************/ 00056 void PVRTTransComputeBoundingBox( 00057 PVRTBOUNDINGBOX * const pBoundingBox, 00058 const PVRTVECTOR3 * const pV, 00059 const int nNumberOfVertices); 00060 00061 /*!****************************************************************************** 00062 @Function PVRTTransIsBoundingBoxVisible 00063 @Output pNeedsZClipping 00064 @Input pBoundingBox 00065 @Input pMatrix 00066 @Return TRUE if the object is visible, FALSE if not. 00067 @Description Determine if a bounding box is "visible" or not along the 00068 Z axis. 00069 If the function returns TRUE, the object is visible and should 00070 be displayed (check bNeedsZClipping to know if Z Clipping needs 00071 to be done). 00072 If the function returns FALSE, the object is not visible and thus 00073 does not require to be displayed. 00074 bNeedsZClipping indicates whether the object needs Z Clipping 00075 (i.e. the object is partially visible). 00076 - *pBoundingBox is a pointer to the bounding box structure. 00077 - *pMatrix is the World, View & Projection matrices combined. 00078 - *bNeedsZClipping is TRUE if Z clipping is required. 00079 *****************************************************************************/ 00080 bool PVRTTransIsBoundingBoxVisible( 00081 const PVRTBOUNDINGBOX * const pBoundingBox, 00082 const PVRTMATRIX * const pMatrix, 00083 bool * const pNeedsZClipping); 00084 00085 /*!*************************************************************************** 00086 @Function Name PVRTTransVec3TransformArray 00087 @Output pOut Destination for transformed vectors 00088 @Input nOutStride Stride between vectors in pOut array 00089 @Input pV Input vector array 00090 @Input nInStride Stride between vectors in pV array 00091 @Input pMatrix Matrix to transform the vectors 00092 @Input nNumberOfVertices Number of vectors to transform 00093 @Description Transform all vertices [X Y Z 1] in pV by pMatrix and 00094 store them in pOut. 00095 *****************************************************************************/ 00096 void PVRTTransVec3TransformArray( 00097 PVRTVECTOR4 * const pOut, 00098 const int nOutStride, 00099 const PVRTVECTOR3 * const pV, 00100 const int nInStride, 00101 const PVRTMATRIX * const pMatrix, 00102 const int nNumberOfVertices); 00103 00104 /*!*************************************************************************** 00105 @Function PVRTTransTransformArray 00106 @Output pTransformedVertex 00107 @Input pV 00108 @Input nNumberOfVertices 00109 @Input pMatrix 00110 @Description Transform all vertices in pVertex by pMatrix and store them in 00111 pTransformedVertex 00112 - pTransformedVertex is the pointer that will receive transformed vertices. 00113 - pVertex is the pointer to untransformed object vertices. 00114 - nNumberOfVertices is the number of vertices of the object. 00115 - pMatrix is the matrix used to transform the object. 00116 *****************************************************************************/ 00117 void PVRTTransTransformArray( 00118 PVRTVECTOR3 * const pTransformedVertex, 00119 const PVRTVECTOR3 * const pV, 00120 const int nNumberOfVertices, 00121 const PVRTMATRIX * const pMatrix); 00122 00123 /*!*************************************************************************** 00124 @Function PVRTTransTransformArrayBack 00125 @Output pTransformedVertex 00126 @Input pVertex 00127 @Input nNumberOfVertices 00128 @Input pMatrix 00129 @Description Transform all vertices in pVertex by the inverse of pMatrix 00130 and store them in pTransformedVertex. 00131 - pTransformedVertex is the pointer that will receive transformed vertices. 00132 - pVertex is the pointer to untransformed object vertices. 00133 - nNumberOfVertices is the number of vertices of the object. 00134 - pMatrix is the matrix used to transform the object. 00135 *****************************************************************************/ 00136 void PVRTTransTransformArrayBack( 00137 PVRTVECTOR3 * const pTransformedVertex, 00138 const PVRTVECTOR3 * const pVertex, 00139 const int nNumberOfVertices, 00140 const PVRTMATRIX * const pMatrix); 00141 00142 /*!*************************************************************************** 00143 @Function PVRTTransTransformBack 00144 @Output pOut 00145 @Input pV 00146 @Input pM 00147 @Description Transform vertex pV by the inverse of pMatrix 00148 and store in pOut. 00149 *****************************************************************************/ 00150 void PVRTTransTransformBack( 00151 PVRTVECTOR4 * const pOut, 00152 const PVRTVECTOR4 * const pV, 00153 const PVRTMATRIX * const pM); 00154 00155 /*!*************************************************************************** 00156 @Function PVRTTransTransform 00157 @Output pOut 00158 @Input pV 00159 @Input pM 00160 @Description Transform vertex pV by pMatrix and store in pOut. 00161 *****************************************************************************/ 00162 void PVRTTransTransform( 00163 PVRTVECTOR4 * const pOut, 00164 const PVRTVECTOR4 * const pV, 00165 const PVRTMATRIX * const pM); 00166 00167 00168 #endif /* _PVRTTRANS_H_ */ 00169 00170 /***************************************************************************** 00171 End of file (PVRTTrans.h) 00172 *****************************************************************************/
Copyright © 1999-2006, PowerVR Technologies and partners. PowerVR Technologies is a division of Imagination Technologies Ltd.