123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217 |
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
- <title>PowerVR SDK</title>
- <link href="doxygen.css" rel="stylesheet" type="text/css">
- <link href="tabs.css" rel="stylesheet" type="text/css">
- <table width="100%">
- <tr>
- <td width="33%">
- <p align="left"> <a href="http://www.imgtec.com"><img border="0" src="IMGLogo.jpg" width="200" height="30"></a></p>
- </td>
- <td width="33%">
- <p align="center"><font color="#808080" face="Arial" size="2">PowerVR Software Development Kit</a></font></p>
- </td>
- <td width="34%">
- <p align="right"><a href="http://www.powervr.com"><img border="0" src="PVRlogo.jpg" width="200" height="27"></a></p>
- </td>
- </tr>
- </table>
- <hr>
- </head><body>
- <!-- Generated by Doxygen 1.3.6 -->
- <div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a></div>
- <h1>PVRTTrans.h</h1><a href="PVRTTrans_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/******************************************************************************</span>
- 00002 <span class="comment"></span>
- 00003 <span class="comment"> @File PVRTTrans.h</span>
- 00004 <span class="comment"></span>
- 00005 <span class="comment"> @Title PVRTTrans</span>
- 00006 <span class="comment"></span>
- 00007 <span class="comment"> @Version </span>
- 00008 <span class="comment"></span>
- 00009 <span class="comment"> @Copyright Copyright (C) Imagination Technologies Limited.</span>
- 00010 <span class="comment"></span>
- 00011 <span class="comment"> @Platform ANSI compatible</span>
- 00012 <span class="comment"></span>
- 00013 <span class="comment"> @Description Set of functions used for 3D transformations and projections.</span>
- 00014 <span class="comment"></span>
- 00015 <span class="comment">******************************************************************************/</span>
- 00016 <span class="preprocessor">#ifndef _PVRTTRANS_H_</span>
- 00017 <span class="preprocessor"></span><span class="preprocessor">#define _PVRTTRANS_H_</span>
- 00018 <span class="preprocessor"></span>
- 00019
- 00020 <span class="comment">/****************************************************************************</span>
- 00021 <span class="comment">** Typedefs</span>
- 00022 <span class="comment">****************************************************************************/</span>
- 00023 <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structPVRTBOUNDINGBOX__TAG.html">PVRTBOUNDINGBOX_TAG</a>
- 00024 {
- 00025 <a class="code" href="structPVRTVECTOR3f.html">PVRTVECTOR3</a> <a class="code" href="structPVRTBOUNDINGBOX__TAG.html#o0">Point</a>[8];
- 00026 } <a class="code" href="structPVRTBOUNDINGBOX__TAG.html">PVRTBOUNDINGBOX</a>, *<a class="code" href="structPVRTBOUNDINGBOX__TAG.html">LPPVRTBOUNDINGBOX</a>;
- <a name="l00027"></a><a class="code" href="structPVRTBOUNDINGBOX__TAG.html">00027</a>
- 00028 <span class="comment">/****************************************************************************</span>
- <a name="l00029"></a><a class="code" href="structPVRTBOUNDINGBOX__TAG.html#o0">00029</a> <span class="comment">** Functions</span>
- 00030 <span class="comment">****************************************************************************/</span>
- 00031
- 00032 <span class="comment">/*!***************************************************************************</span>
- 00033 <span class="comment"> @Function PVRTBoundingBoxCompute</span>
- 00034 <span class="comment"> @Output pBoundingBox</span>
- 00035 <span class="comment"> @Input pV</span>
- 00036 <span class="comment"> @Input nNumberOfVertices</span>
- 00037 <span class="comment"> @Description Calculate the eight vertices that surround an object.</span>
- 00038 <span class="comment"> This "bounding box" is used later to determine whether</span>
- 00039 <span class="comment"> the object is visible or not.</span>
- 00040 <span class="comment"> This function should only be called once to determine the</span>
- 00041 <span class="comment"> object's bounding box.</span>
- 00042 <span class="comment">*****************************************************************************/</span>
- 00043 <span class="keywordtype">void</span> <a class="code" href="PVRTTrans_8h.html#a2">PVRTBoundingBoxCompute</a>(
- 00044 <a class="code" href="structPVRTBOUNDINGBOX__TAG.html">PVRTBOUNDINGBOX</a> * <span class="keyword">const</span> pBoundingBox,
- 00045 <span class="keyword">const</span> <a class="code" href="structPVRTVECTOR3f.html">PVRTVECTOR3</a> * <span class="keyword">const</span> pV,
- 00046 <span class="keyword">const</span> <span class="keywordtype">int</span> nNumberOfVertices);
- 00047
- 00048 <span class="comment">/*!***************************************************************************</span>
- 00049 <span class="comment"> @Function PVRTBoundingBoxComputeInterleaved</span>
- 00050 <span class="comment"> @Output pBoundingBox</span>
- 00051 <span class="comment"> @Input pV</span>
- 00052 <span class="comment"> @Input nNumberOfVertices</span>
- 00053 <span class="comment"> @Input i32Offset</span>
- 00054 <span class="comment"> @Input i32Stride</span>
- 00055 <span class="comment"> @Description Calculate the eight vertices that surround an object.</span>
- 00056 <span class="comment"> This "bounding box" is used later to determine whether</span>
- 00057 <span class="comment"> the object is visible or not.</span>
- 00058 <span class="comment"> This function should only be called once to determine the</span>
- 00059 <span class="comment"> object's bounding box.</span>
- 00060 <span class="comment"> Takes interleaved data using the first vertex's offset</span>
- 00061 <span class="comment"> and the stride to the next vertex thereafter</span>
- 00062 <span class="comment">*****************************************************************************/</span>
- 00063 <span class="keywordtype">void</span> <a class="code" href="PVRTTrans_8h.html#a3">PVRTBoundingBoxComputeInterleaved</a>(
- 00064 <a class="code" href="structPVRTBOUNDINGBOX__TAG.html">PVRTBOUNDINGBOX</a> * <span class="keyword">const</span> pBoundingBox,
- 00065 <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> * <span class="keyword">const</span> pV,
- 00066 <span class="keyword">const</span> <span class="keywordtype">int</span> nNumberOfVertices,
- 00067 <span class="keyword">const</span> <span class="keywordtype">int</span> i32Offset,
- 00068 <span class="keyword">const</span> <span class="keywordtype">int</span> i32Stride);
- 00069
- 00070 <span class="comment">/*!******************************************************************************</span>
- 00071 <span class="comment"> @Function PVRTBoundingBoxIsVisible</span>
- 00072 <span class="comment"> @Output pNeedsZClipping</span>
- 00073 <span class="comment"> @Input pBoundingBox</span>
- 00074 <span class="comment"> @Input pMatrix</span>
- 00075 <span class="comment"> @Return TRUE if the object is visible, FALSE if not.</span>
- 00076 <span class="comment"> @Description Determine if a bounding box is "visible" or not along the</span>
- 00077 <span class="comment"> Z axis.</span>
- 00078 <span class="comment"> If the function returns TRUE, the object is visible and should</span>
- 00079 <span class="comment"> be displayed (check bNeedsZClipping to know if Z Clipping needs</span>
- 00080 <span class="comment"> to be done).</span>
- 00081 <span class="comment"> If the function returns FALSE, the object is not visible and thus</span>
- 00082 <span class="comment"> does not require to be displayed.</span>
- 00083 <span class="comment"> bNeedsZClipping indicates whether the object needs Z Clipping</span>
- 00084 <span class="comment"> (i.e. the object is partially visible).</span>
- 00085 <span class="comment"> - *pBoundingBox is a pointer to the bounding box structure.</span>
- 00086 <span class="comment"> - *pMatrix is the World, View & Projection matrices combined.</span>
- 00087 <span class="comment"> - *bNeedsZClipping is TRUE if Z clipping is required.</span>
- 00088 <span class="comment">*****************************************************************************/</span>
- 00089 <span class="keywordtype">bool</span> <a class="code" href="PVRTTrans_8h.html#a4">PVRTBoundingBoxIsVisible</a>(
- 00090 <span class="keyword">const</span> <a class="code" href="structPVRTBOUNDINGBOX__TAG.html">PVRTBOUNDINGBOX</a> * <span class="keyword">const</span> pBoundingBox,
- 00091 <span class="keyword">const</span> <a class="code" href="classPVRTMATRIXf.html">PVRTMATRIX</a> * <span class="keyword">const</span> pMatrix,
- 00092 <span class="keywordtype">bool</span> * <span class="keyword">const</span> pNeedsZClipping);
- 00093
- 00094 <span class="comment">/*!***************************************************************************</span>
- 00095 <span class="comment"> @Function Name PVRTTransformVec3Array</span>
- 00096 <span class="comment"> @Output pOut Destination for transformed vectors</span>
- 00097 <span class="comment"> @Input nOutStride Stride between vectors in pOut array</span>
- 00098 <span class="comment"> @Input pV Input vector array</span>
- 00099 <span class="comment"> @Input nInStride Stride between vectors in pV array</span>
- 00100 <span class="comment"> @Input pMatrix Matrix to transform the vectors</span>
- 00101 <span class="comment"> @Input nNumberOfVertices Number of vectors to transform</span>
- 00102 <span class="comment"> @Description Transform all vertices [X Y Z 1] in pV by pMatrix and</span>
- 00103 <span class="comment"> store them in pOut.</span>
- 00104 <span class="comment">*****************************************************************************/</span>
- 00105 <span class="keywordtype">void</span> <a class="code" href="PVRTTrans_8h.html#a5">PVRTTransformVec3Array</a>(
- 00106 <a class="code" href="structPVRTVECTOR4f.html">PVRTVECTOR4</a> * <span class="keyword">const</span> pOut,
- 00107 <span class="keyword">const</span> <span class="keywordtype">int</span> nOutStride,
- 00108 <span class="keyword">const</span> <a class="code" href="structPVRTVECTOR3f.html">PVRTVECTOR3</a> * <span class="keyword">const</span> pV,
- 00109 <span class="keyword">const</span> <span class="keywordtype">int</span> nInStride,
- 00110 <span class="keyword">const</span> <a class="code" href="classPVRTMATRIXf.html">PVRTMATRIX</a> * <span class="keyword">const</span> pMatrix,
- 00111 <span class="keyword">const</span> <span class="keywordtype">int</span> nNumberOfVertices);
- 00112
- 00113 <span class="comment">/*!***************************************************************************</span>
- 00114 <span class="comment"> @Function PVRTTransformArray</span>
- 00115 <span class="comment"> @Output pTransformedVertex Destination for transformed vectors</span>
- 00116 <span class="comment"> @Input pV Input vector array</span>
- 00117 <span class="comment"> @Input nNumberOfVertices Number of vectors to transform</span>
- 00118 <span class="comment"> @Input pMatrix Matrix to transform the vectors</span>
- 00119 <span class="comment"> @Input fW W coordinate of input vector (e.g. use 1 for position, 0 for normal)</span>
- 00120 <span class="comment"> @Description Transform all vertices in pVertex by pMatrix and store them in</span>
- 00121 <span class="comment"> pTransformedVertex</span>
- 00122 <span class="comment"> - pTransformedVertex is the pointer that will receive transformed vertices.</span>
- 00123 <span class="comment"> - pVertex is the pointer to untransformed object vertices.</span>
- 00124 <span class="comment"> - nNumberOfVertices is the number of vertices of the object.</span>
- 00125 <span class="comment"> - pMatrix is the matrix used to transform the object.</span>
- 00126 <span class="comment">*****************************************************************************/</span>
- 00127 <span class="keywordtype">void</span> <a class="code" href="PVRTTrans_8h.html#a6">PVRTTransformArray</a>(
- 00128 <a class="code" href="structPVRTVECTOR3f.html">PVRTVECTOR3</a> * <span class="keyword">const</span> pTransformedVertex,
- 00129 <span class="keyword">const</span> <a class="code" href="structPVRTVECTOR3f.html">PVRTVECTOR3</a> * <span class="keyword">const</span> pV,
- 00130 <span class="keyword">const</span> <span class="keywordtype">int</span> nNumberOfVertices,
- 00131 <span class="keyword">const</span> <a class="code" href="classPVRTMATRIXf.html">PVRTMATRIX</a> * <span class="keyword">const</span> pMatrix,
- 00132 <span class="keyword">const</span> VERTTYPE fW = <a class="code" href="PVRTFixedPoint_8h.html#a25">f2vt</a>(1.0f));
- 00133
- 00134 <span class="comment">/*!***************************************************************************</span>
- 00135 <span class="comment"> @Function PVRTTransformArrayBack</span>
- 00136 <span class="comment"> @Output pTransformedVertex</span>
- 00137 <span class="comment"> @Input pVertex</span>
- 00138 <span class="comment"> @Input nNumberOfVertices</span>
- 00139 <span class="comment"> @Input pMatrix</span>
- 00140 <span class="comment"> @Description Transform all vertices in pVertex by the inverse of pMatrix</span>
- 00141 <span class="comment"> and store them in pTransformedVertex.</span>
- 00142 <span class="comment"> - pTransformedVertex is the pointer that will receive transformed vertices.</span>
- 00143 <span class="comment"> - pVertex is the pointer to untransformed object vertices.</span>
- 00144 <span class="comment"> - nNumberOfVertices is the number of vertices of the object.</span>
- 00145 <span class="comment"> - pMatrix is the matrix used to transform the object.</span>
- 00146 <span class="comment">*****************************************************************************/</span>
- 00147 <span class="keywordtype">void</span> <a class="code" href="PVRTTrans_8h.html#a7">PVRTTransformArrayBack</a>(
- 00148 <a class="code" href="structPVRTVECTOR3f.html">PVRTVECTOR3</a> * <span class="keyword">const</span> pTransformedVertex,
- 00149 <span class="keyword">const</span> <a class="code" href="structPVRTVECTOR3f.html">PVRTVECTOR3</a> * <span class="keyword">const</span> pVertex,
- 00150 <span class="keyword">const</span> <span class="keywordtype">int</span> nNumberOfVertices,
- 00151 <span class="keyword">const</span> <a class="code" href="classPVRTMATRIXf.html">PVRTMATRIX</a> * <span class="keyword">const</span> pMatrix);
- 00152
- 00153 <span class="comment">/*!***************************************************************************</span>
- 00154 <span class="comment"> @Function PVRTTransformBack</span>
- 00155 <span class="comment"> @Output pOut</span>
- 00156 <span class="comment"> @Input pV</span>
- 00157 <span class="comment"> @Input pM</span>
- 00158 <span class="comment"> @Description Transform vertex pV by the inverse of pMatrix</span>
- 00159 <span class="comment"> and store in pOut.</span>
- 00160 <span class="comment">*****************************************************************************/</span>
- 00161 <span class="keywordtype">void</span> <a class="code" href="PVRTTrans_8h.html#a8">PVRTTransformBack</a>(
- 00162 <a class="code" href="structPVRTVECTOR4f.html">PVRTVECTOR4</a> * <span class="keyword">const</span> pOut,
- 00163 <span class="keyword">const</span> <a class="code" href="structPVRTVECTOR4f.html">PVRTVECTOR4</a> * <span class="keyword">const</span> pV,
- 00164 <span class="keyword">const</span> <a class="code" href="classPVRTMATRIXf.html">PVRTMATRIX</a> * <span class="keyword">const</span> pM);
- 00165
- 00166 <span class="comment">/*!***************************************************************************</span>
- 00167 <span class="comment"> @Function PVRTTransform</span>
- 00168 <span class="comment"> @Output pOut</span>
- 00169 <span class="comment"> @Input pV</span>
- 00170 <span class="comment"> @Input pM</span>
- 00171 <span class="comment"> @Description Transform vertex pV by pMatrix and store in pOut.</span>
- 00172 <span class="comment">*****************************************************************************/</span>
- 00173 <span class="keywordtype">void</span> <a class="code" href="PVRTTrans_8h.html#a9">PVRTTransform</a>(
- 00174 <a class="code" href="structPVRTVECTOR4f.html">PVRTVECTOR4</a> * <span class="keyword">const</span> pOut,
- 00175 <span class="keyword">const</span> <a class="code" href="structPVRTVECTOR4f.html">PVRTVECTOR4</a> * <span class="keyword">const</span> pV,
- 00176 <span class="keyword">const</span> <a class="code" href="classPVRTMATRIXf.html">PVRTMATRIX</a> * <span class="keyword">const</span> pM);
- 00177
- 00178
- 00179 <span class="preprocessor">#endif </span><span class="comment">/* _PVRTTRANS_H_ */</span>
- 00180
- 00181 <span class="comment">/*****************************************************************************</span>
- 00182 <span class="comment"> End of file (PVRTTrans.h)</span>
- 00183 <span class="comment">*****************************************************************************/</span>
- 00184
- </pre></div><br>
- <br>
- <P align=left><FONT size=2><STRONG><A
- href="http://www.imgtec.com/powervr/insider/legal/index.asp">Copyright</A> ©
- 1999-2008, Imagination Technologies Ltd.</STRONG></FONT></P>
- <hr>
- <address style="align: left;"><small><FONT color=f0f>
- Generated by <a href="http://www.doxygen.org/index.html">DOXYGEN</a> 1.3.6</small></address>
- </body>
- </html>
|