diff options
author | neodarz <neodarz@neodarz.net> | 2018-08-11 20:21:34 +0200 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2018-08-11 20:21:34 +0200 |
commit | 0ea5fc66924303d1bf73ba283a383e2aadee02f2 (patch) | |
tree | 2568e71a7ccc44ec23b8bb3f0ff97fb6bf2ed709 /docs/doxygen/nel/ps__attrib__maker__helper_8h-source.html | |
download | nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.tar.xz nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.zip |
Initial commit
Diffstat (limited to 'docs/doxygen/nel/ps__attrib__maker__helper_8h-source.html')
-rw-r--r-- | docs/doxygen/nel/ps__attrib__maker__helper_8h-source.html | 1602 |
1 files changed, 1602 insertions, 0 deletions
diff --git a/docs/doxygen/nel/ps__attrib__maker__helper_8h-source.html b/docs/doxygen/nel/ps__attrib__maker__helper_8h-source.html new file mode 100644 index 00000000..a5749c7f --- /dev/null +++ b/docs/doxygen/nel/ps__attrib__maker__helper_8h-source.html @@ -0,0 +1,1602 @@ +<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> +<HTML> +<HEAD> + <TITLE>nevrax.org : docs</TITLE> + <LINK REL=stylesheet TYPE="text/css" HREF="http://www.nevrax.org/inc/css/nevrax.css"> + <link href="doxygen.css" rel="stylesheet" type="text/css"> +</HEAD> +<BODY MARGINHEIGHT="0" MARGINWIDTH="0"> + +<!-- uplinks --> +<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0> + <TR> + <TD WIDTH=16><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD> + <TD WIDTH=140 BGCOLOR=#dddddd><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="16" BORDER=0 ALT=""></TD> + <TD WIDTH=16><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD> + <TD><IMG width=6 height=14 SRC="http://www.nevrax.org/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle> <A CLASS=uplinks HREF=http://www.nevrax.org><b>Home</B></FONT></A> </TD> + <TD><IMG width=6 height=14 SRC="http://www.nevrax.org/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle> <A CLASS=uplinks HREF=http://www.nevrax.com><b>nevrax.com</B></FONT></A> </TD> + </TR> +</TABLE> + +<!-- banner Nevrax --> +<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%> + <TR><TD BGCOLOR="#000000" BACKGROUND="http://www.nevrax.org/inc/img/black_banner.jpg"><A HREF="http://www.nevrax.org"><IMG SRC="http://www.nevrax.org/inc/img/nevrax.gif" WIDTH="170" HEIGHT="45" BORDER=0 ALT="Nevrax" ></A></TD></TR> +</TABLE> + +<!-- main table --> +<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 height=100%> + <TR> + <TD WIDTH=16><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="10" BORDER=0 ALT=""></TD> + <TD WIDTH=140 BGCOLOR=#dddddd VALIGN=TOP ALIGN=middle><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT=""> + + <!------ Begin Box ------> + <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 BGCOLOR=black><TR><TD><TABLE border=0 cellspacing=2 cellpadding=0 width=120><tr><TD ALIGN=middle bgcolor=black> + <FONT COLOR=white FACE="sans-serif"><B>Nevrax.org</B></FONT></TD></TR><tr><td colspan=2 bgcolor=#FFFFFF> + <TABLE cellspacing=0 cellpadding=1 border=0> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/news/" TITLE="Rubrique news"><img width=13 height=15 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-news.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/news/" TITLE="News">News</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/mail/" TITLE="Rubrique mail"><img width=15 height=11 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-mail.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/mail/" TITLE="Mailing list archive">Mailing-list</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/docs/" TITLE="Rubrique docs"><img width=14 height=16 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-docs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/docs/" TITLE="Documentation">Documentation</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/cvs/" TITLE="Rubrique cvs"><img width=13 height=17 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-cvs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/cvs/" TITLE="CVS Web">CVS</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/bugs/" TITLE="Rubrique bugs"><img width=20 height=16 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-bugs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/bugs/" TITLE="Bugtracking">Bugs</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/GPL.php3" TITLE="Rubrique license"><img width=18 height=12 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-gpl.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/GPL.php3" TITLE="License">License</a></td></tr> + </TABLE> + </TD></TR></TABLE></TD></TR></TABLE> + <!------ End Box ------> + + </TD> + <TD WIDTH=15><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD> + <TD ALIGN=left valign=top><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT=""> + +<!-- title --> +<TABLE background="http://www.nevrax.org/inc/img/redline.gif" CELLSPACING=0 CELLPADDING=0 BORDER=0 width=100%><tr><td> +<A HREF="http://www.nevrax.org/docs/"><img src="http://www.nevrax.org/inc/img/t_docs.gif" ALT="Docs" HEIGHT=20 BORDER=0></A> +</td><td><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="1" HEIGHT="1" BORDER=0 ALT=""> +</td></tr></table> + + +<!-- block --> +<TABLE bgcolor="#dddddd" CELLSPACING=0 CELLPADDING=0 BORDER=0 width=100%><tr><td width=1% valign=middle><img width=6 height=14 hspace=2 vspace=2 src="http://www.nevrax.org/inc/img/reddots.gif"></TD> + <TD><B>Documentation</B></TD> + <TD ALIGN=RIGHT> </td> +</tr></table> +<!-- Generated by Doxygen 1.2.14 --> +<center> +<a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="namespacemembers.html">Namespace Members</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> <a class="qindex" href="pages.html">Related Pages</a> <a class="qindexRef" doxygen="_cgi:http://www.nevrax.org/cgi-bin/nel-search.cgi" href="http://www.nevrax.org/cgi-bin/nel-search.cgi">Search</a> </center> +<hr><h1>ps_attrib_maker_helper.h</h1><a href="ps__attrib__maker__helper_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 +00007 <font class="comment">/* Copyright, 2001 Nevrax Ltd.</font> +00008 <font class="comment"> *</font> +00009 <font class="comment"> * This file is part of NEVRAX NEL.</font> +00010 <font class="comment"> * NEVRAX NEL is free software; you can redistribute it and/or modify</font> +00011 <font class="comment"> * it under the terms of the GNU General Public License as published by</font> +00012 <font class="comment"> * the Free Software Foundation; either version 2, or (at your option)</font> +00013 <font class="comment"> * any later version.</font> +00014 <font class="comment"></font> +00015 <font class="comment"> * NEVRAX NEL is distributed in the hope that it will be useful, but</font> +00016 <font class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of</font> +00017 <font class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</font> +00018 <font class="comment"> * General Public License for more details.</font> +00019 <font class="comment"></font> +00020 <font class="comment"> * You should have received a copy of the GNU General Public License</font> +00021 <font class="comment"> * along with NEVRAX NEL; see the file COPYING. If not, write to the</font> +00022 <font class="comment"> * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,</font> +00023 <font class="comment"> * MA 02111-1307, USA.</font> +00024 <font class="comment"> */</font> +00025 +00026 <font class="preprocessor">#ifndef NL_PS_ATTRIB_MAKER_HELPER_H</font> +00027 <font class="preprocessor"></font><font class="preprocessor">#define NL_PS_ATTRIB_MAKER_HELPER_H</font> +00028 <font class="preprocessor"></font> +00029 <font class="preprocessor">#include "<a class="code" href="ps__attrib__maker_8h.html">3d/ps_attrib_maker.h</a>"</font> +00030 +00031 <font class="preprocessor">#include "<a class="code" href="fast__floor_8h.html">fast_floor.h</a>"</font> <font class="comment">// inline assembly for fast float<->int conversions</font> +00032 <font class="preprocessor">#include "<a class="code" href="ps__attrib__maker__iterators_8h.html">ps_attrib_maker_iterators.h</a>"</font> <font class="comment">// some iterators we use </font> +00033 +00034 <font class="keyword">namespace </font>NL3D +00035 { +00036 +00037 +00038 +00039 +00040 +00041 +<a name="l00051"></a><a class="code" href="classNL3D_1_1CPSAttribMakerT.html">00051</a> <font class="keyword">template</font> <<font class="keyword">typename</font> T, <font class="keyword">class</font> F> <font class="keyword">class </font>CPSAttribMakerT : <font class="keyword">public</font> CPSAttribMaker<T> +00052 { +00053 <font class="keyword">public</font>: +<a name="l00055"></a><a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">00055</a> F <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>; +00056 +00058 <font class="keyword">virtual</font> T <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#a0">get</a>(CPSLocated *loc, uint32 <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>); +00059 +<a name="l00060"></a><a class="code" href="classNL3D_1_1CPSAttribMakerT.html#a1">00060</a> <font class="keyword">virtual</font> T <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#a0">get</a>(<font class="keywordtype">float</font> input) +00061 { +00062 <a class="code" href="namespaceNL3D.html#a360">OptFastFloorBegin</a>(); +00063 <a class="code" href="debug_8h.html#a6">nlassert</a>(input >= 0.f && input <= 1.f); +00064 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(input); +00065 <a class="code" href="namespaceNL3D.html#a361">OptFastFloorEnd</a>(); +00066 } +00067 +00071 <font class="comment">/* virtual void *make(CPSLocated *loc,</font> +00072 <font class="comment"> uint32 startIndex,</font> +00073 <font class="comment"> void *tab, uint32 stride,</font> +00074 <font class="comment"> uint32 numAttrib,</font> +00075 <font class="comment"> bool allowNoCopy = false,</font> +00076 <font class="comment"> uint32 srcStep = (1 << 16)</font> +00077 <font class="comment"> ) const;*/</font> +00078 +00082 <font class="comment">/* virtual void make4(CPSLocated *loc,</font> +00083 <font class="comment"> uint32 startIndex,</font> +00084 <font class="comment"> void *tab,</font> +00085 <font class="comment"> uint32 stride,</font> +00086 <font class="comment"> uint32 numAttrib,</font> +00087 <font class="comment"> uint32 srcStep = (1 << 16)</font> +00088 <font class="comment"> ) const;*/</font> +00089 +00093 <font class="comment">/* virtual void makeN(CPSLocated *loc,</font> +00094 <font class="comment"> uint32 startIndex,</font> +00095 <font class="comment"> void *tab,</font> +00096 <font class="comment"> uint32 stride,</font> +00097 <font class="comment"> uint32 numAttrib,</font> +00098 <font class="comment"> uint32 nbReplicate,</font> +00099 <font class="comment"> uint32 srcStep = (1 << 16)</font> +00100 <font class="comment"> ) const;*/</font> +00101 +00102 +<a name="l00104"></a><a class="code" href="classNL3D_1_1CPSAttribMakerT.html#a2">00104</a> <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#a2">serial</a>(<a class="code" href="classNLMISC_1_1IStream.html">NLMISC::IStream</a> &f) <font class="keywordflow">throw</font>(NLMISC::EStream) +00105 { +00106 sint ver = f.serialVersion(2); +00107 CPSAttribMaker<T>::serial(f); +00108 f.serial(<a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>); +00109 <font class="keywordflow">switch</font> (ver) +00110 { +00111 <font class="keywordflow">case</font> 1: +00112 { +00113 CPSInputType it; +00114 f.serialEnum(it.InputType); +00115 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#o0">_InputType</a> = it; +00116 } +00117 <font class="keywordflow">break</font>; +00118 <font class="keywordflow">case</font> 2: +00119 f.serial(<a class="code" href="classNL3D_1_1CPSAttribMakerT.html#o0">_InputType</a>); +00120 <font class="keywordflow">break</font>; +00121 } +00122 f.serial(<a class="code" href="classNL3D_1_1CPSAttribMakerT.html#o1">_Clamp</a>); +00123 } +00124 +<a name="l00128"></a><a class="code" href="classNL3D_1_1CPSAttribMakerT.html#a3">00128</a> <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#a3">CPSAttribMakerT</a>(<font class="keywordtype">float</font> nbCycles) : <a class="code" href="classNL3D_1_1CPSAttribMaker.html#z706_0">CPSAttribMaker</a><T>(nbCycles) +00129 , <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#o1">_Clamp</a>(false) +00130 {} +00131 +<a name="l00133"></a><a class="code" href="classNL3D_1_1CPSAttribMakerT.html#a4">00133</a> <font class="keyword">virtual</font> <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#a4">~CPSAttribMakerT</a>() {} +00134 +00135 +<a name="l00139"></a><a class="code" href="classNL3D_1_1CPSAttribMakerT.html#a5">00139</a> <font class="keyword">virtual</font> <font class="keywordtype">bool</font> <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#a5">hasCustomInput</a>(<font class="keywordtype">void</font>) { <font class="keywordflow">return</font> <font class="keyword">true</font>; } +00140 +00141 +<a name="l00144"></a><a class="code" href="classNL3D_1_1CPSAttribMakerT.html#a6">00144</a> <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#a6">setInput</a>(<font class="keyword">const</font> CPSInputType &input) { <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#o0">_InputType</a> = input; } +00145 +00146 +<a name="l00150"></a><a class="code" href="classNL3D_1_1CPSAttribMakerT.html#a7">00150</a> <font class="keyword">virtual</font> CPSInputType <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#a7">getInput</a>(<font class="keywordtype">void</font>)<font class="keyword"> const </font>{ <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#o0">_InputType</a>; } +00151 +00152 +<a name="l00155"></a><a class="code" href="classNL3D_1_1CPSAttribMakerT.html#a8">00155</a> <font class="keywordtype">bool</font> <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#a8">isClampingSupported</a>(<font class="keywordtype">void</font>)<font class="keyword"> const </font>{ <font class="keywordflow">return</font> <font class="keyword">true</font>; } +00156 +00157 +<a name="l00161"></a><a class="code" href="classNL3D_1_1CPSAttribMakerT.html#a9">00161</a> <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#a9">setClamping</a>(<font class="keywordtype">bool</font> enable = <font class="keyword">true</font>) { <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#o1">_Clamp</a> = enable; }; +00162 +00163 +<a name="l00167"></a><a class="code" href="classNL3D_1_1CPSAttribMakerT.html#a10">00167</a> <font class="keyword">virtual</font> <font class="keywordtype">bool</font> <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#a10">getClamping</a>(<font class="keywordtype">void</font>)<font class="keyword"> const </font>{ <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#o1">_Clamp</a>; }; +00168 +00169 +<a name="l00171"></a><a class="code" href="classNL3D_1_1CPSAttribMakerT.html#s0">00171</a> <font class="keyword">typedef</font> T <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#s0">value_type</a>; +00172 +<a name="l00174"></a><a class="code" href="classNL3D_1_1CPSAttribMakerT.html#s1">00174</a> <font class="keyword">typedef</font> F <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#s1">functor_type</a>; +00175 +00176 <font class="keyword">private</font>: +00177 +00178 <font class="comment">// type of the input</font> +<a name="l00179"></a><a class="code" href="classNL3D_1_1CPSAttribMakerT.html#o0">00179</a> CPSInputType <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#o0">_InputType</a>; +00180 +00181 <font class="comment">// clamping on/ off</font> +<a name="l00182"></a><a class="code" href="classNL3D_1_1CPSAttribMakerT.html#o1">00182</a> <font class="keywordtype">bool</font> <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#o1">_Clamp</a>; +00183 +00184 +00185 +<a name="l00191"></a><a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c0">00191</a> <font class="keyword">template</font> <<font class="keyword">typename</font> It> <font class="keywordtype">void</font> <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c0">makeByIterator</a>(It it, +00192 <font class="keywordtype">void</font> *tab, +00193 uint32 <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, +00194 uint32 numAttrib, +00195 <font class="keywordtype">bool</font> canOverlapOne +00196 )<font class="keyword"> const</font> +00197 <font class="keyword"> </font>{ +00198 uint8 *pt = (uint8 *) tab; +00199 +00200 +00201 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CPSAttribMaker.html#n0">_NbCycles</a> > 1 || canOverlapOne) +00202 { +00203 <font class="comment">// the value could cycle, so we need to clamp it to 0.0f 1.0f</font> +00204 +00205 <font class="keywordflow">if</font> (!<a class="code" href="classNL3D_1_1CPSAttribMakerT.html#o1">_Clamp</a>) +00206 { +00207 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CPSAttribMaker.html#n0">_NbCycles</a> == 1) +00208 { +00209 <font class="keywordflow">while</font> (numAttrib --) +00210 { +00211 *(T *)pt = <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(<a class="code" href="namespaceNL3D.html#a363">OptFastFractionnalPart</a>(it.get())); +00212 pt += <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +00213 it.advance(); +00214 } +00215 } +00216 <font class="keywordflow">else</font> +00217 { +00218 <font class="keywordflow">while</font> (numAttrib --) +00219 { +00220 <font class="keyword">const</font> <font class="keywordtype">float</font> time = <a class="code" href="classNL3D_1_1CPSAttribMaker.html#n0">_NbCycles</a> * (it.get()); +00221 *(T *)pt = <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(<a class="code" href="namespaceNL3D.html#a363">OptFastFractionnalPart</a>(time)); +00222 pt += <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +00223 it.advance(); +00224 } +00225 } +00226 } +00227 <font class="keywordflow">else</font> +00228 { +00229 <font class="comment">// clamping is on</font> +00230 +00231 <font class="keywordtype">float</font> <a class="code" href="driver__opengl__extension__def_8h.html#a415">value</a>; +00232 +00233 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CPSAttribMaker.html#n0">_NbCycles</a> == 1) +00234 { +00235 <font class="keywordflow">while</font> (numAttrib --) +00236 { +00237 <a class="code" href="driver__opengl__extension__def_8h.html#a415">value</a> = (it.get()); +00238 <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a415">value</a> > <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a>) +00239 { +00240 <a class="code" href="driver__opengl__extension__def_8h.html#a415">value</a> = <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a>; +00241 } +00242 *(T *)pt = <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a415">value</a>); +00243 pt += <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +00244 it.advance(); +00245 } +00246 } +00247 <font class="keywordflow">else</font> +00248 { +00249 <font class="keywordflow">while</font> (numAttrib --) +00250 { +00251 <font class="keywordtype">float</font> <a class="code" href="driver__opengl__extension__def_8h.html#a415">value</a> = <a class="code" href="classNL3D_1_1CPSAttribMaker.html#n0">_NbCycles</a> * (it.get()); +00252 <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a415">value</a> > <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a>) +00253 { +00254 <a class="code" href="driver__opengl__extension__def_8h.html#a415">value</a> = <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a>; +00255 } +00256 *(T *)pt = <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a415">value</a>); +00257 pt += <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +00258 it.advance(); +00259 } +00260 } +00261 } +00262 } +00263 <font class="keywordflow">else</font> +00264 { +00265 <font class="comment">// the fastest case : it match the particle's life perfeclty</font> +00266 +00267 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CPSAttribMaker.html#n0">_NbCycles</a> == 1) +00268 { +00269 <font class="keywordflow">while</font> (numAttrib --) +00270 { +00271 *(T *)pt = <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(it.get()); +00272 pt += <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +00273 it.advance(); +00274 } +00275 } +00276 <font class="keywordflow">else</font> +00277 { +00278 <font class="comment">// the particle won't cover the whole pattern durin his life</font> +00279 <font class="keywordflow">while</font> (numAttrib --) +00280 { +00281 *(T *)pt = <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(<a class="code" href="classNL3D_1_1CPSAttribMaker.html#n0">_NbCycles</a> * (it.get())); +00282 pt += <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +00283 it.advance(); +00284 } +00285 } +00286 } +00287 } +00288 +<a name="l00293"></a><a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c1">00293</a> <font class="keyword">template</font> <<font class="keyword">typename</font> It> <font class="keywordtype">void</font> <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c1">make4ByIterator</a>(It it, +00294 <font class="keywordtype">void</font> *tab, +00295 uint32 <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, +00296 uint32 numAttrib, +00297 <font class="keywordtype">bool</font> canOverlapOne)<font class="keyword"> const</font> +00298 <font class="keyword"> </font>{ +00299 +00300 +00301 uint8 *pt = (uint8 *) tab; +00302 +00303 +00304 <font class="comment">// first precompute the various strides (stride * 2, 3 and 4)</font> +00305 <font class="comment">// const uint32 stride2 = stride << 1, stride3 = stride + stride2, stride4 = stride2 << 1;</font> +00306 +00307 <font class="keyword">const</font> uint32 stride2 = <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a> << 1; +00308 +00309 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CPSAttribMaker.html#n0">_NbCycles</a> > 1 || canOverlapOne) +00310 { +00311 +00312 <font class="keywordflow">if</font> (!<a class="code" href="classNL3D_1_1CPSAttribMakerT.html#o1">_Clamp</a>) +00313 { +00314 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CPSAttribMaker.html#n0">_NbCycles</a> == 1) +00315 { +00316 <font class="keywordflow">while</font> (numAttrib --) +00317 { +00318 <font class="comment">// fill 4 attrib with the same value at once </font> +00319 <font class="comment">//*(T *)pt = *(T *)(pt + stride) = *(T *)(pt + stride2) = *(T *)(pt + stride3) = _F(OptFastFractionnalPart(it.get())); </font> +00320 *(T *) pt = <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(<a class="code" href="namespaceNL3D.html#a363">OptFastFractionnalPart</a>(it.get())); +00321 *(T *) (pt + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>) = *(T *) pt; +00322 pt += <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +00323 *(T *) (pt + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>) = *(T *) pt; +00324 pt += <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +00325 *(T *) (pt + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>) = *(T *) pt; +00326 pt += stride2; +00327 it.advance(); +00328 } +00329 } +00330 <font class="keywordflow">else</font> +00331 { +00332 <font class="keywordflow">while</font> (numAttrib --) +00333 { +00334 <font class="keyword">const</font> <font class="keywordtype">float</font> time = <a class="code" href="classNL3D_1_1CPSAttribMaker.html#n0">_NbCycles</a> * (it.get()); +00335 <font class="comment">// fill 4 attrib with the same value at once </font> +00336 <font class="comment">//*(T *)pt = *(T *)(pt + stride) = *(T *)(pt + stride2) = *(T *)(pt + stride3) = _F(OptFastFractionnalPart(time)); </font> +00337 *(T *) pt = <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(<a class="code" href="namespaceNL3D.html#a363">OptFastFractionnalPart</a>(time)); +00338 *(T *) (pt + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>) = *(T *) pt; +00339 pt += <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +00340 *(T *) (pt + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>) = *(T *) pt; +00341 pt += <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +00342 *(T *) (pt + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>) = *(T *) pt; +00343 pt += stride2; +00344 +00345 it.advance(); +00346 } +00347 } +00348 } +00349 <font class="keywordflow">else</font> +00350 { +00351 <font class="keywordtype">float</font> <a class="code" href="driver__opengl__extension__def_8h.html#a415">value</a>; +00352 +00353 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CPSAttribMaker.html#n0">_NbCycles</a> == 1) +00354 { +00355 <font class="keywordflow">while</font> (numAttrib --) +00356 { +00357 <a class="code" href="driver__opengl__extension__def_8h.html#a415">value</a> = it.get(); +00358 <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a415">value</a> > <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a>) +00359 { +00360 <a class="code" href="driver__opengl__extension__def_8h.html#a415">value</a> = <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a>; +00361 } +00362 <font class="comment">// fill 4 attrib with the same value at once </font> +00363 <font class="comment">//*(T *)pt = *(T *)(pt + stride) = *(T *)(pt + stride2) = *(T *)(pt + stride3) = _F(value); </font> +00364 *(T *) pt = <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a415">value</a>); +00365 *(T *) (pt + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>) = *(T *) pt; +00366 pt += <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +00367 *(T *) (pt + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>) = *(T *) pt; +00368 pt += <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +00369 *(T *) (pt + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>) = *(T *) pt; +00370 pt += stride2; +00371 +00372 it.advance(); +00373 } +00374 } +00375 <font class="keywordflow">else</font> +00376 { +00377 <font class="keywordflow">while</font> (numAttrib --) +00378 { +00379 <a class="code" href="driver__opengl__extension__def_8h.html#a415">value</a> = <a class="code" href="classNL3D_1_1CPSAttribMaker.html#n0">_NbCycles</a> * (it.get()); +00380 <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a415">value</a> > <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a>) +00381 { +00382 <a class="code" href="driver__opengl__extension__def_8h.html#a415">value</a> = <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a>; +00383 } +00384 <font class="comment">// fill 4 attrib with the same value at once </font> +00385 <font class="comment">//*(T *)pt = *(T *)(pt + stride) = *(T *)(pt + stride2) = *(T *)(pt + stride3) = _F(value); </font> +00386 *(T *) pt = <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a415">value</a>); +00387 *(T *) (pt + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>) = *(T *) pt; +00388 pt += <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +00389 *(T *) (pt + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>) = *(T *) pt; +00390 pt += <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +00391 *(T *) (pt + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>) = *(T *) pt; +00392 pt += stride2; +00393 <font class="comment">//pt += stride4; // advance of 4 </font> +00394 it.advance(); +00395 } +00396 } +00397 } +00398 } +00399 <font class="keywordflow">else</font> +00400 { +00401 <font class="comment">// the fastest case : it match the particle's life perfeclty</font> +00402 +00403 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CPSAttribMaker.html#n0">_NbCycles</a> == 1) +00404 { +00405 <font class="keywordflow">while</font> (numAttrib --) +00406 { +00407 <font class="comment">// fill 4 attrib with the same value at once </font> +00408 <font class="comment">//*(T *)pt = *(T *)(pt + stride) = *(T *)(pt + stride2) = *(T *)(pt + stride3) = _F(it.get()); </font> +00409 *(T *) pt = <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(it.get()); +00410 *(T *) (pt + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>) = *(T *) pt; +00411 pt += <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +00412 *(T *) (pt + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>) = *(T *) pt; +00413 pt += <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +00414 *(T *) (pt + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>) = *(T *) pt; +00415 pt += stride2; +00416 +00417 <font class="comment">//pt += stride4; // advance of 4 </font> +00418 it.advance(); +00419 } +00420 } +00421 <font class="keywordflow">else</font> +00422 { +00423 <font class="comment">// the particle won't cover the whole pattern durin his life</font> +00424 +00425 <font class="keywordflow">while</font> (numAttrib --) +00426 { +00427 <font class="comment">// fill 4 attrib with the same value at once </font> +00428 *(T *) pt = <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(<a class="code" href="classNL3D_1_1CPSAttribMaker.html#n0">_NbCycles</a> * it.get()); +00429 *(T *) (pt + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>) = *(T *) pt; +00430 pt += <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +00431 *(T *) (pt + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>) = *(T *) pt; +00432 pt += <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +00433 *(T *) (pt + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>) = *(T *) pt; +00434 pt += stride2; +00435 <font class="comment">//*(T *)pt = *(T *)(pt + stride) = *(T *)(pt + stride2) = *(T *)(pt + stride3) = _F(_NbCycles * it.get()); </font> +00436 <font class="comment">//pt += stride4; // advance of 4 </font> +00437 it.advance(); +00438 } +00439 } +00440 } +00441 } +00442 +00443 +<a name="l00448"></a><a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c2">00448</a> <font class="keyword">template</font> <<font class="keyword">typename</font> It> <font class="keywordtype">void</font> <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c2">makeNByIterator</a>(It it, <font class="keywordtype">void</font> *tab, uint32 <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, uint32 numAttrib +00449 , uint32 nbReplicate, <font class="keywordtype">bool</font> canOverlapOne)<font class="keyword"> const</font> +00450 <font class="keyword"> </font>{ +00451 +00452 <a class="code" href="debug_8h.html#a6">nlassert</a>(nbReplicate > 1); +00453 +00454 uint8 *pt = (uint8 *) tab; +00455 +00456 <font class="comment">// loop counter</font> +00457 uint k; +00458 +00459 +00460 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CPSAttribMaker.html#n0">_NbCycles</a> > 1 || canOverlapOne) +00461 { +00462 +00463 <font class="keywordflow">if</font> (!<a class="code" href="classNL3D_1_1CPSAttribMakerT.html#o1">_Clamp</a>) +00464 { +00465 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CPSAttribMaker.html#n0">_NbCycles</a> == 1) +00466 { +00467 <font class="keywordflow">while</font> (numAttrib --) +00468 { +00469 <font class="comment">// fill 4 attrib with the same value at once </font> +00470 *(T *)pt = <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(<a class="code" href="namespaceNL3D.html#a363">OptFastFractionnalPart</a>(it.get())); +00471 k = nbReplicate - 1; +00472 <font class="keywordflow">do</font> +00473 { +00474 *(T *) (pt + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>) = *(T *) pt; +00475 pt += <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +00476 } +00477 <font class="keywordflow">while</font> (--k); +00478 pt += <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +00479 it.advance(); +00480 } +00481 } +00482 <font class="keywordflow">else</font> +00483 { +00484 <font class="keywordflow">while</font> (numAttrib --) +00485 { +00486 <font class="keyword">const</font> <font class="keywordtype">float</font> time = <a class="code" href="classNL3D_1_1CPSAttribMaker.html#n0">_NbCycles</a> * (it.get()); +00487 <font class="comment">// fill 4 attrib with the same value at once </font> +00488 *(T *)pt = <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(<a class="code" href="namespaceNL3D.html#a363">OptFastFractionnalPart</a>(time)); +00489 k = nbReplicate - 1; +00490 <font class="keywordflow">do</font> +00491 { +00492 *(T *) (pt + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>) = *(T *) pt; +00493 pt += <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +00494 } +00495 <font class="keywordflow">while</font> (--k); +00496 pt += <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +00497 it.advance(); +00498 } +00499 } +00500 } +00501 <font class="keywordflow">else</font> +00502 { +00503 <font class="keywordtype">float</font> <a class="code" href="driver__opengl__extension__def_8h.html#a415">value</a>; +00504 <font class="comment">// clamping is on</font> +00505 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CPSAttribMaker.html#n0">_NbCycles</a> == 1) +00506 { +00507 <font class="keywordflow">while</font> (numAttrib --) +00508 { +00509 <font class="comment">// fill 4 attrib with the same value at once </font> +00510 <a class="code" href="driver__opengl__extension__def_8h.html#a415">value</a> = it.get(); +00511 <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a415">value</a> > <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a>) +00512 { +00513 <a class="code" href="driver__opengl__extension__def_8h.html#a415">value</a> = <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a>; +00514 } +00515 *(T *)pt = <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a415">value</a>); +00516 k = nbReplicate - 1; +00517 <font class="keywordflow">do</font> +00518 { +00519 *(T *) (pt + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>) = *(T *) pt; +00520 pt += <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +00521 } +00522 <font class="keywordflow">while</font> (--k); +00523 pt += <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +00524 it.advance(); +00525 } +00526 } +00527 <font class="keywordflow">else</font> +00528 { +00529 <font class="keywordflow">while</font> (numAttrib --) +00530 { +00531 <a class="code" href="driver__opengl__extension__def_8h.html#a415">value</a> = <a class="code" href="classNL3D_1_1CPSAttribMaker.html#n0">_NbCycles</a> * (it.get()); +00532 <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a415">value</a> > <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a>) +00533 { +00534 <a class="code" href="driver__opengl__extension__def_8h.html#a415">value</a> = <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a>; +00535 } +00536 <font class="comment">// fill 4 attrib with the same value at once </font> +00537 *(T *)pt = <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a415">value</a>); +00538 k = nbReplicate - 1; +00539 <font class="keywordflow">do</font> +00540 { +00541 *(T *) (pt + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>) = *(T *) pt; +00542 pt += <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +00543 } +00544 <font class="keywordflow">while</font> (--k); +00545 pt += <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +00546 it.advance(); +00547 } +00548 } +00549 } +00550 } +00551 <font class="keywordflow">else</font> +00552 { +00553 <font class="comment">// the fastest case : it match the particle's life perfeclty</font> +00554 +00555 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CPSAttribMaker.html#n0">_NbCycles</a> == 1) +00556 { +00557 <font class="keywordflow">while</font> (numAttrib --) +00558 { +00559 <font class="comment">// fill 4 attrib with the same value at once </font> +00560 *(T *)pt = <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(it.get()); +00561 k = nbReplicate - 1; +00562 <font class="keywordflow">do</font> +00563 { +00564 *(T *) (pt + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>) = *(T *) pt; +00565 pt += <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +00566 } +00567 <font class="keywordflow">while</font> (--k); +00568 pt += <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +00569 it.advance(); +00570 } +00571 } +00572 <font class="keywordflow">else</font> +00573 { +00574 <font class="comment">// the particle won't cover the whole pattern durin his life</font> +00575 +00576 <font class="keywordflow">while</font> (numAttrib --) +00577 { +00578 <font class="comment">// fill 4 attrib with the same value at once </font> +00579 *(T *)pt = <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(<a class="code" href="classNL3D_1_1CPSAttribMaker.html#n0">_NbCycles</a> * it.get()); +00580 k = nbReplicate - 1; +00581 <font class="keywordflow">do</font> +00582 { +00583 *(T *) (pt + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>) = *(T *) pt; +00584 pt += <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +00585 } +00586 <font class="keywordflow">while</font> (--k); +00587 pt += <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +00588 it.advance(); +00589 } +00590 } +00591 } +00592 } +00593 +00594 +00595 <font class="comment">/* template <typename T, class F> */</font> +<a name="l00596"></a><a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c3">00596</a> <font class="keywordtype">void</font> <font class="comment">/*CPSAttribMakerT<T, F>::*/</font> *<a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c3">make</a>(CPSLocated *loc, +00597 uint32 startIndex, +00598 <font class="keywordtype">void</font> *tab, +00599 uint32 <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, +00600 uint32 numAttrib, +00601 <font class="keywordtype">bool</font> allowNoCopy <font class="comment">/* = false */</font>, +00602 uint32 srcStep <font class="comment">/*= (1 << 16)*/</font> +00603 )<font class="keyword"> const</font> +00604 <font class="keyword"> </font>{ +00605 +00606 <a class="code" href="namespaceNL3D.html#a360">OptFastFloorBegin</a>(); +00607 <a class="code" href="debug_8h.html#a6">nlassert</a>(loc); +00608 +00609 <font class="keywordflow">if</font> (srcStep == (1 << 16)) +00610 { +00611 <font class="keywordflow">switch</font> (<a class="code" href="classNL3D_1_1CPSAttribMakerT.html#o0">_InputType</a>.InputType) +00612 { +00613 <font class="keywordflow">case</font> CPSInputType::attrDate: +00614 { +00615 CPSBaseIterator<TIteratorFloatStep1> +00616 it(<a class="code" href="namespaceNL3D.html#a195">TIteratorFloatStep1</a>(loc->getTime().begin(), startIndex)); +00617 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c0">makeByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, loc->getLastForever()); +00618 } +00619 <font class="keywordflow">break</font>; +00620 <font class="keywordflow">case</font> CPSInputType::attrInverseMass: +00621 { +00622 CPSBaseIterator<TIteratorFloatStep1> +00623 it(<a class="code" href="namespaceNL3D.html#a195">TIteratorFloatStep1</a>(loc->getInvMass().begin() , startIndex)); +00624 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c0">makeByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">true</font>); +00625 } +00626 <font class="keywordflow">break</font>; +00627 <font class="keywordflow">case</font> CPSInputType::attrSpeed: +00628 { +00629 CVectNormIterator<TIteratorVectStep1> +00630 it(<a class="code" href="namespaceNL3D.html#a196">TIteratorVectStep1</a>(loc->getSpeed().begin(), startIndex)); +00631 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c0">makeByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">true</font>); +00632 } +00633 <font class="keywordflow">break</font>; +00634 +00635 <font class="keywordflow">case</font> CPSInputType::attrPosition: +00636 { +00637 CVectNormIterator<TIteratorVectStep1> +00638 it( <a class="code" href="namespaceNL3D.html#a196">TIteratorVectStep1</a>(loc->getPos().begin(), startIndex) ); +00639 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c0">makeByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">true</font>); +00640 } +00641 <font class="keywordflow">break</font>; +00642 <font class="keywordflow">case</font> CPSInputType::attrUniformRandom: +00643 { +00644 CRandomIterator it; +00645 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c0">makeByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">true</font>); +00646 } +00647 <font class="keywordflow">break</font>; +00648 <font class="keywordflow">case</font> CPSInputType::attrUserParam: +00649 { +00650 CDecalIterator it; +00651 it.Value = loc->getUserParam(<a class="code" href="classNL3D_1_1CPSAttribMakerT.html#o0">_InputType</a>.UserParamNum); +00652 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c0">makeByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">false</font>); +00653 } +00654 <font class="keywordflow">break</font>; +00655 <font class="keywordflow">case</font> CPSInputType::attrLOD: +00656 { +00657 +00658 CFDot3AddIterator<TIteratorVectStep1> +00659 it(<a class="code" href="namespaceNL3D.html#a196">TIteratorVectStep1</a>(loc->getPos().begin(), startIndex)); +00660 loc->getLODVect(it.V, it.Offset, loc->isInSystemBasis()); +00661 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c0">makeByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">false</font>); +00662 } +00663 <font class="keywordflow">break</font>; +00664 <font class="keywordflow">case</font> CPSInputType::attrSquareLOD: +00665 { +00666 +00667 CFSquareDot3AddIterator<TIteratorVectStep1> +00668 it(<a class="code" href="namespaceNL3D.html#a196">TIteratorVectStep1</a>(loc->getPos().begin(), startIndex)); +00669 loc->getLODVect(it.V, it.Offset, loc->isInSystemBasis()); +00670 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c0">makeByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">false</font>); +00671 } +00672 <font class="keywordflow">break</font>; +00673 <font class="keywordflow">case</font> CPSInputType::attrClampedLOD: +00674 { +00675 +00676 CFClampDot3AddIterator<TIteratorVectStep1> +00677 it(<a class="code" href="namespaceNL3D.html#a196">TIteratorVectStep1</a>(loc->getPos().begin(), startIndex)); +00678 loc->getLODVect(it.V, it.Offset, loc->isInSystemBasis()); +00679 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c0">makeByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">false</font>); +00680 } +00681 <font class="keywordflow">break</font>; +00682 <font class="keywordflow">case</font> CPSInputType::attrClampedSquareLOD: +00683 { +00684 +00685 CFClampSquareDot3AddIterator<TIteratorVectStep1> +00686 it(<a class="code" href="namespaceNL3D.html#a196">TIteratorVectStep1</a>(loc->getPos().begin(), startIndex)); +00687 loc->getLODVect(it.V, it.Offset, loc->isInSystemBasis()); +00688 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c0">makeByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">false</font>); +00689 } +00690 <font class="keywordflow">break</font>; +00691 } +00692 +00693 <a class="code" href="namespaceNL3D.html#a361">OptFastFloorEnd</a>(); +00694 <font class="comment">// we must alway copy the data there ...</font> +00695 <font class="keywordflow">return</font> tab; +00696 } +00697 <font class="keywordflow">else</font> <font class="comment">// fixed point steps</font> +00698 { +00699 <font class="keywordflow">switch</font> (<a class="code" href="classNL3D_1_1CPSAttribMakerT.html#o0">_InputType</a>.InputType) +00700 { +00701 <font class="keywordflow">case</font> CPSInputType::attrDate: +00702 { +00703 CPSBaseIterator<TIteratorFloatStep1616> +00704 it(<a class="code" href="namespaceNL3D.html#a197">TIteratorFloatStep1616</a>(loc->getTime().begin(), startIndex, srcStep)); +00705 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c0">makeByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, loc->getLastForever()); +00706 } +00707 <font class="keywordflow">break</font>; +00708 <font class="keywordflow">case</font> CPSInputType::attrInverseMass: +00709 { +00710 CPSBaseIterator<TIteratorFloatStep1616> +00711 it( <a class="code" href="namespaceNL3D.html#a197">TIteratorFloatStep1616</a>(loc->getInvMass().begin(), startIndex, srcStep)); +00712 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c0">makeByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">true</font>); +00713 } +00714 <font class="keywordflow">break</font>; +00715 <font class="keywordflow">case</font> CPSInputType::attrSpeed: +00716 { +00717 CVectNormIterator<TIteratorVectStep1616> +00718 it( <a class="code" href="namespaceNL3D.html#a199">TIteratorVectStep1616</a>(loc->getSpeed().begin(), startIndex, srcStep) ); +00719 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c0">makeByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">true</font>); +00720 } +00721 <font class="keywordflow">break</font>; +00722 +00723 <font class="keywordflow">case</font> CPSInputType::attrPosition: +00724 { +00725 CVectNormIterator<TIteratorVectStep1616> +00726 it( <a class="code" href="namespaceNL3D.html#a199">TIteratorVectStep1616</a>(loc->getPos().begin(), startIndex, srcStep) ); +00727 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c0">makeByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">true</font>); +00728 } +00729 <font class="keywordflow">break</font>; +00730 <font class="keywordflow">case</font> CPSInputType::attrUniformRandom: +00731 { +00732 CRandomIterator it; +00733 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c0">makeByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">true</font>); +00734 } +00735 <font class="keywordflow">break</font>; +00736 <font class="keywordflow">case</font> CPSInputType::attrUserParam: +00737 { +00738 CDecalIterator it; +00739 it.Value = loc->getUserParam(<a class="code" href="classNL3D_1_1CPSAttribMakerT.html#o0">_InputType</a>.UserParamNum); +00740 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c0">makeByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">false</font>); +00741 } +00742 <font class="keywordflow">break</font>; +00743 <font class="keywordflow">case</font> CPSInputType::attrLOD: +00744 { +00745 +00746 CFDot3AddIterator<TIteratorVectStep1616> +00747 it( <a class="code" href="namespaceNL3D.html#a199">TIteratorVectStep1616</a>(loc->getPos().begin(), startIndex, srcStep) ); +00748 loc->getLODVect(it.V, it.Offset, loc->isInSystemBasis()); +00749 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c0">makeByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">false</font>); +00750 } +00751 <font class="keywordflow">break</font>; +00752 <font class="keywordflow">case</font> CPSInputType::attrSquareLOD: +00753 { +00754 +00755 CFSquareDot3AddIterator<TIteratorVectStep1616> +00756 it( <a class="code" href="namespaceNL3D.html#a199">TIteratorVectStep1616</a>(loc->getPos().begin(), startIndex, srcStep) ); +00757 loc->getLODVect(it.V, it.Offset, loc->isInSystemBasis()); +00758 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c0">makeByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">false</font>); +00759 } +00760 <font class="keywordflow">break</font>; +00761 <font class="keywordflow">case</font> CPSInputType::attrClampedLOD: +00762 { +00763 +00764 CFClampDot3AddIterator<TIteratorVectStep1616> +00765 it( <a class="code" href="namespaceNL3D.html#a199">TIteratorVectStep1616</a>(loc->getPos().begin(), startIndex, srcStep) ); +00766 loc->getLODVect(it.V, it.Offset, loc->isInSystemBasis()); +00767 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c0">makeByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">false</font>); +00768 } +00769 <font class="keywordflow">break</font>; +00770 <font class="keywordflow">case</font> CPSInputType::attrClampedSquareLOD: +00771 { +00772 +00773 CFClampSquareDot3AddIterator<TIteratorVectStep1616> +00774 it( <a class="code" href="namespaceNL3D.html#a199">TIteratorVectStep1616</a>(loc->getPos().begin(), startIndex, srcStep) ); +00775 loc->getLODVect(it.V, it.Offset, loc->isInSystemBasis()); +00776 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c0">makeByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">false</font>); +00777 } +00778 <font class="keywordflow">break</font>; +00779 } +00780 +00781 <a class="code" href="namespaceNL3D.html#a361">OptFastFloorEnd</a>(); +00782 <font class="comment">// we must alway copy the data there ...</font> +00783 <font class="keywordflow">return</font> tab; +00784 } +00785 } +00786 +00787 +00788 +00789 <font class="comment">/* template <typename T, class F> */</font> +<a name="l00790"></a><a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c4">00790</a> <font class="keywordtype">void</font> <font class="comment">/*CPSAttribMakerT<T, F>::*/</font><a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c4">make4</a>(CPSLocated *loc, +00791 uint32 startIndex, +00792 <font class="keywordtype">void</font> *tab, +00793 uint32 <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, +00794 uint32 numAttrib, +00795 uint32 srcStep <font class="comment">/*= (1 << 16)*/</font> +00796 )<font class="keyword"> const</font> +00797 <font class="keyword"> </font>{ +00798 <a class="code" href="namespaceNL3D.html#a360">OptFastFloorBegin</a>(); +00799 <a class="code" href="debug_8h.html#a6">nlassert</a>(loc); +00800 +00801 <font class="keywordflow">if</font> (srcStep == (1 << 16)) +00802 { +00803 <font class="keywordflow">switch</font> (<a class="code" href="classNL3D_1_1CPSAttribMakerT.html#o0">_InputType</a>.InputType) +00804 { +00805 <font class="keywordflow">case</font> CPSInputType::attrDate: +00806 { +00807 CPSBaseIterator<TIteratorFloatStep1> +00808 it(<a class="code" href="namespaceNL3D.html#a195">TIteratorFloatStep1</a>( loc->getTime().begin(), startIndex) ); +00809 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c1">make4ByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, loc->getLastForever()); +00810 } +00811 <font class="keywordflow">break</font>; +00812 <font class="keywordflow">case</font> CPSInputType::attrInverseMass: +00813 { +00814 CPSBaseIterator<TIteratorFloatStep1> +00815 it( <a class="code" href="namespaceNL3D.html#a195">TIteratorFloatStep1</a>(loc->getInvMass().begin(), startIndex) ); +00816 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c1">make4ByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">true</font>); +00817 } +00818 <font class="keywordflow">break</font>; +00819 <font class="keywordflow">case</font> CPSInputType::attrSpeed: +00820 { +00821 CVectNormIterator<TIteratorVectStep1> +00822 it( <a class="code" href="namespaceNL3D.html#a196">TIteratorVectStep1</a>(loc->getSpeed().begin(), startIndex) ); +00823 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c1">make4ByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">true</font>); +00824 } +00825 <font class="keywordflow">break</font>; +00826 +00827 <font class="keywordflow">case</font> CPSInputType::attrPosition: +00828 { +00829 CVectNormIterator<TIteratorVectStep1> +00830 it( <a class="code" href="namespaceNL3D.html#a196">TIteratorVectStep1</a>(loc->getPos().begin() , startIndex) ); +00831 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c1">make4ByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">true</font>); +00832 } +00833 <font class="keywordflow">break</font>; +00834 <font class="keywordflow">case</font> CPSInputType::attrUniformRandom: +00835 { +00836 CRandomIterator it; +00837 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c1">make4ByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">true</font>); +00838 } +00839 <font class="keywordflow">break</font>; +00840 <font class="keywordflow">case</font> CPSInputType::attrUserParam: +00841 { +00842 CDecalIterator it; +00843 it.Value = loc->getUserParam(<a class="code" href="classNL3D_1_1CPSAttribMakerT.html#o0">_InputType</a>.UserParamNum); +00844 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c1">make4ByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">false</font>); +00845 } +00846 <font class="keywordflow">break</font>; +00847 <font class="keywordflow">case</font> CPSInputType::attrLOD: +00848 { +00849 +00850 CFDot3AddIterator<TIteratorVectStep1> +00851 it(<a class="code" href="namespaceNL3D.html#a196">TIteratorVectStep1</a>(loc->getPos().begin(), startIndex) ); +00852 loc->getLODVect(it.V, it.Offset, loc->isInSystemBasis()); +00853 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c1">make4ByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">false</font>); +00854 } +00855 <font class="keywordflow">break</font>; +00856 <font class="keywordflow">case</font> CPSInputType::attrSquareLOD: +00857 { +00858 +00859 CFSquareDot3AddIterator<TIteratorVectStep1> +00860 it(<a class="code" href="namespaceNL3D.html#a196">TIteratorVectStep1</a>(loc->getPos().begin(), startIndex)); +00861 loc->getLODVect(it.V, it.Offset, loc->isInSystemBasis()); +00862 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c1">make4ByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">false</font>); +00863 } +00864 <font class="keywordflow">break</font>; +00865 <font class="keywordflow">case</font> CPSInputType::attrClampedLOD: +00866 { +00867 +00868 CFClampDot3AddIterator<TIteratorVectStep1> +00869 it(<a class="code" href="namespaceNL3D.html#a196">TIteratorVectStep1</a>(loc->getPos().begin(), startIndex)); +00870 loc->getLODVect(it.V, it.Offset, loc->isInSystemBasis()); +00871 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c1">make4ByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">false</font>); +00872 } +00873 <font class="keywordflow">break</font>; +00874 <font class="keywordflow">case</font> CPSInputType::attrClampedSquareLOD: +00875 { +00876 +00877 CFClampSquareDot3AddIterator<TIteratorVectStep1> +00878 it(<a class="code" href="namespaceNL3D.html#a196">TIteratorVectStep1</a>(loc->getPos().begin(), startIndex)); +00879 loc->getLODVect(it.V, it.Offset, loc->isInSystemBasis()); +00880 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c1">make4ByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">false</font>); +00881 } +00882 <font class="keywordflow">break</font>; +00883 } +00884 +00885 <a class="code" href="namespaceNL3D.html#a361">OptFastFloorEnd</a>(); +00886 } +00887 <font class="keywordflow">else</font> <font class="comment">// fixed point steps</font> +00888 { +00889 <font class="keywordflow">switch</font> (<a class="code" href="classNL3D_1_1CPSAttribMakerT.html#o0">_InputType</a>.InputType) +00890 { +00891 <font class="keywordflow">case</font> CPSInputType::attrDate: +00892 { +00893 CPSBaseIterator<TIteratorFloatStep1616> +00894 it(<a class="code" href="namespaceNL3D.html#a197">TIteratorFloatStep1616</a>(loc->getTime().begin(), startIndex, srcStep)); +00895 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c1">make4ByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, loc->getLastForever()); +00896 } +00897 <font class="keywordflow">break</font>; +00898 <font class="keywordflow">case</font> CPSInputType::attrInverseMass: +00899 { +00900 CPSBaseIterator<TIteratorFloatStep1616> +00901 it( <a class="code" href="namespaceNL3D.html#a197">TIteratorFloatStep1616</a>(loc->getInvMass().begin() , startIndex, srcStep)); +00902 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c1">make4ByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">true</font>); +00903 } +00904 <font class="keywordflow">break</font>; +00905 <font class="keywordflow">case</font> CPSInputType::attrSpeed: +00906 { +00907 CVectNormIterator<TIteratorVectStep1616> +00908 it( <a class="code" href="namespaceNL3D.html#a199">TIteratorVectStep1616</a>(loc->getSpeed().begin(), startIndex, srcStep) ); +00909 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c1">make4ByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">true</font>); +00910 } +00911 <font class="keywordflow">break</font>; +00912 +00913 <font class="keywordflow">case</font> CPSInputType::attrPosition: +00914 { +00915 CVectNormIterator<TIteratorVectStep1616> +00916 it( <a class="code" href="namespaceNL3D.html#a199">TIteratorVectStep1616</a>(loc->getPos().begin() , startIndex, srcStep) ); +00917 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c1">make4ByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">true</font>); +00918 } +00919 <font class="keywordflow">break</font>; +00920 <font class="keywordflow">case</font> CPSInputType::attrUniformRandom: +00921 { +00922 CRandomIterator it; +00923 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c1">make4ByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">true</font>); +00924 } +00925 <font class="keywordflow">break</font>; +00926 <font class="keywordflow">case</font> CPSInputType::attrUserParam: +00927 { +00928 CDecalIterator it; +00929 it.Value = loc->getUserParam(<a class="code" href="classNL3D_1_1CPSAttribMakerT.html#o0">_InputType</a>.UserParamNum); +00930 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c1">make4ByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">false</font>); +00931 } +00932 <font class="keywordflow">break</font>; +00933 <font class="keywordflow">case</font> CPSInputType::attrLOD: +00934 { +00935 +00936 CFDot3AddIterator<TIteratorVectStep1616> +00937 it( <a class="code" href="namespaceNL3D.html#a199">TIteratorVectStep1616</a>(loc->getPos().begin(), startIndex, srcStep) ); +00938 loc->getLODVect(it.V, it.Offset, loc->isInSystemBasis()); +00939 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c1">make4ByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">false</font>); +00940 } +00941 <font class="keywordflow">break</font>; +00942 <font class="keywordflow">case</font> CPSInputType::attrSquareLOD: +00943 { +00944 +00945 CFSquareDot3AddIterator<TIteratorVectStep1616> +00946 it( <a class="code" href="namespaceNL3D.html#a199">TIteratorVectStep1616</a>(loc->getPos().begin(), startIndex, srcStep) ); +00947 loc->getLODVect(it.V, it.Offset, loc->isInSystemBasis()); +00948 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c1">make4ByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">false</font>); +00949 } +00950 <font class="keywordflow">break</font>; +00951 <font class="keywordflow">case</font> CPSInputType::attrClampedLOD: +00952 { +00953 +00954 CFClampDot3AddIterator<TIteratorVectStep1616> +00955 it( <a class="code" href="namespaceNL3D.html#a199">TIteratorVectStep1616</a>(loc->getPos().begin(), startIndex, srcStep) ); +00956 loc->getLODVect(it.V, it.Offset, loc->isInSystemBasis()); +00957 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c1">make4ByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">false</font>); +00958 } +00959 <font class="keywordflow">break</font>; +00960 <font class="keywordflow">case</font> CPSInputType::attrClampedSquareLOD: +00961 { +00962 +00963 CFClampSquareDot3AddIterator<TIteratorVectStep1616> +00964 it( <a class="code" href="namespaceNL3D.html#a199">TIteratorVectStep1616</a>(loc->getPos().begin(), startIndex, srcStep) ); +00965 loc->getLODVect(it.V, it.Offset, loc->isInSystemBasis()); +00966 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c1">make4ByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, <font class="keyword">false</font>); +00967 } +00968 <font class="keywordflow">break</font>; +00969 } +00970 +00971 <a class="code" href="namespaceNL3D.html#a361">OptFastFloorEnd</a>(); +00972 +00973 } +00974 } +00975 +00976 +00977 <font class="comment">/* template <typename T, class F> */</font> +<a name="l00978"></a><a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c5">00978</a> <font class="keyword">virtual</font> <font class="keywordtype">void</font> <font class="comment">/*CPSAttribMakerT<T, F>::*/</font><a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c5">makeN</a>(CPSLocated *loc, +00979 uint32 startIndex, +00980 <font class="keywordtype">void</font> *tab, +00981 uint32 <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, +00982 uint32 numAttrib, +00983 uint32 nbReplicate, +00984 uint32 srcStep <font class="comment">/* = (1 << 16)*/</font> +00985 )<font class="keyword"> const</font> +00986 <font class="keyword"> </font>{ +00987 <a class="code" href="namespaceNL3D.html#a360">OptFastFloorBegin</a>(); +00988 <a class="code" href="debug_8h.html#a6">nlassert</a>(loc); +00989 <font class="keywordflow">if</font> (srcStep == (1 << 16)) +00990 { +00991 <font class="keywordflow">switch</font> (<a class="code" href="classNL3D_1_1CPSAttribMakerT.html#o0">_InputType</a>.InputType) +00992 { +00993 <font class="keywordflow">case</font> CPSInputType::attrDate: +00994 { +00995 CPSBaseIterator<TIteratorFloatStep1> +00996 it(<a class="code" href="namespaceNL3D.html#a195">TIteratorFloatStep1</a>(loc->getTime().begin(), startIndex) ); +00997 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c2">makeNByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, nbReplicate, loc->getLastForever()); +00998 } +00999 <font class="keywordflow">break</font>; +01000 <font class="keywordflow">case</font> CPSInputType::attrInverseMass: +01001 { +01002 CPSBaseIterator<TIteratorFloatStep1> +01003 it( <a class="code" href="namespaceNL3D.html#a195">TIteratorFloatStep1</a>(loc->getInvMass().begin() , startIndex) ); +01004 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c2">makeNByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, nbReplicate, <font class="keyword">true</font>); +01005 } +01006 <font class="keywordflow">break</font>; +01007 <font class="keywordflow">case</font> CPSInputType::attrSpeed: +01008 { +01009 CVectNormIterator<TIteratorVectStep1> +01010 it( <a class="code" href="namespaceNL3D.html#a196">TIteratorVectStep1</a>(loc->getSpeed().begin(), startIndex) ); +01011 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c2">makeNByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, nbReplicate, <font class="keyword">true</font>); +01012 } +01013 <font class="keywordflow">break</font>; +01014 +01015 <font class="keywordflow">case</font> CPSInputType::attrPosition: +01016 { +01017 CVectNormIterator<TIteratorVectStep1> +01018 it( <a class="code" href="namespaceNL3D.html#a196">TIteratorVectStep1</a>( loc->getPos().begin() , startIndex ) ); +01019 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c2">makeNByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, nbReplicate, <font class="keyword">true</font>); +01020 } +01021 <font class="keywordflow">break</font>; +01022 <font class="keywordflow">case</font> CPSInputType::attrUniformRandom: +01023 { +01024 CRandomIterator it; +01025 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c2">makeNByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, nbReplicate, <font class="keyword">true</font>); +01026 } +01027 <font class="keywordflow">break</font>; +01028 <font class="keywordflow">case</font> CPSInputType::attrUserParam: +01029 { +01030 CDecalIterator it; +01031 it.Value = loc->getUserParam(<a class="code" href="classNL3D_1_1CPSAttribMakerT.html#o0">_InputType</a>.UserParamNum); +01032 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c2">makeNByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, nbReplicate, <font class="keyword">false</font>); +01033 } +01034 <font class="keywordflow">break</font>; +01035 <font class="keywordflow">case</font> CPSInputType::attrLOD: +01036 { +01037 +01038 CFDot3AddIterator<TIteratorVectStep1> +01039 it( <a class="code" href="namespaceNL3D.html#a196">TIteratorVectStep1</a>(loc->getPos().begin(), startIndex) ); +01040 loc->getLODVect(it.V, it.Offset, loc->isInSystemBasis()); +01041 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c2">makeNByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, nbReplicate, <font class="keyword">false</font>); +01042 } +01043 <font class="keywordflow">break</font>; +01044 <font class="keywordflow">case</font> CPSInputType::attrSquareLOD: +01045 { +01046 +01047 CFSquareDot3AddIterator<TIteratorVectStep1> +01048 it(<a class="code" href="namespaceNL3D.html#a196">TIteratorVectStep1</a>(loc->getPos().begin(), startIndex)); +01049 loc->getLODVect(it.V, it.Offset, loc->isInSystemBasis()); +01050 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c2">makeNByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, nbReplicate, <font class="keyword">false</font>); +01051 } +01052 <font class="keywordflow">break</font>; +01053 <font class="keywordflow">case</font> CPSInputType::attrClampedLOD: +01054 { +01055 +01056 CFClampDot3AddIterator<TIteratorVectStep1> +01057 it(<a class="code" href="namespaceNL3D.html#a196">TIteratorVectStep1</a>(loc->getPos().begin(), startIndex)); +01058 loc->getLODVect(it.V, it.Offset, loc->isInSystemBasis()); +01059 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c2">makeNByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, nbReplicate, <font class="keyword">false</font>); +01060 } +01061 <font class="keywordflow">break</font>; +01062 <font class="keywordflow">case</font> CPSInputType::attrClampedSquareLOD: +01063 { +01064 +01065 CFClampSquareDot3AddIterator<TIteratorVectStep1> +01066 it(<a class="code" href="namespaceNL3D.html#a196">TIteratorVectStep1</a>(loc->getPos().begin(), startIndex)); +01067 loc->getLODVect(it.V, it.Offset, loc->isInSystemBasis()); +01068 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c2">makeNByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, nbReplicate, <font class="keyword">false</font>); +01069 } +01070 <font class="keywordflow">break</font>; +01071 } +01072 +01073 <a class="code" href="namespaceNL3D.html#a361">OptFastFloorEnd</a>(); +01074 } +01075 <font class="keywordflow">else</font> <font class="comment">// fixed point steps</font> +01076 { +01077 <font class="keywordflow">switch</font> (<a class="code" href="classNL3D_1_1CPSAttribMakerT.html#o0">_InputType</a>.InputType) +01078 { +01079 <font class="keywordflow">case</font> CPSInputType::attrDate: +01080 { +01081 CPSBaseIterator<TIteratorFloatStep1616> +01082 it(<a class="code" href="namespaceNL3D.html#a197">TIteratorFloatStep1616</a>(loc->getTime().begin(), startIndex, srcStep)); +01083 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c2">makeNByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, nbReplicate, loc->getLastForever()); +01084 } +01085 <font class="keywordflow">break</font>; +01086 <font class="keywordflow">case</font> CPSInputType::attrInverseMass: +01087 { +01088 CPSBaseIterator<TIteratorFloatStep1616> +01089 it( <a class="code" href="namespaceNL3D.html#a197">TIteratorFloatStep1616</a>(loc->getInvMass().begin() , startIndex, srcStep) ); +01090 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c2">makeNByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, nbReplicate, <font class="keyword">true</font>); +01091 } +01092 <font class="keywordflow">break</font>; +01093 <font class="keywordflow">case</font> CPSInputType::attrSpeed: +01094 { +01095 CVectNormIterator<TIteratorVectStep1616> +01096 it( <a class="code" href="namespaceNL3D.html#a199">TIteratorVectStep1616</a>(loc->getSpeed().begin(), startIndex, srcStep) ); +01097 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c2">makeNByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, nbReplicate, <font class="keyword">true</font>); +01098 } +01099 <font class="keywordflow">break</font>; +01100 +01101 <font class="keywordflow">case</font> CPSInputType::attrPosition: +01102 { +01103 CVectNormIterator<TIteratorVectStep1616> +01104 it( <a class="code" href="namespaceNL3D.html#a199">TIteratorVectStep1616</a>(loc->getPos().begin(), startIndex, srcStep) ); +01105 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c2">makeNByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, nbReplicate, <font class="keyword">true</font>); +01106 } +01107 <font class="keywordflow">break</font>; +01108 <font class="keywordflow">case</font> CPSInputType::attrUniformRandom: +01109 { +01110 CRandomIterator it; +01111 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c2">makeNByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, nbReplicate, <font class="keyword">true</font>); +01112 } +01113 <font class="keywordflow">break</font>; +01114 <font class="keywordflow">case</font> CPSInputType::attrUserParam: +01115 { +01116 CDecalIterator it; +01117 it.Value = loc->getUserParam(<a class="code" href="classNL3D_1_1CPSAttribMakerT.html#o0">_InputType</a>.UserParamNum); +01118 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c2">makeNByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, nbReplicate, <font class="keyword">false</font>); +01119 } +01120 <font class="keywordflow">break</font>; +01121 <font class="keywordflow">case</font> CPSInputType::attrLOD: +01122 { +01123 +01124 CFDot3AddIterator<TIteratorVectStep1616> +01125 it( <a class="code" href="namespaceNL3D.html#a199">TIteratorVectStep1616</a>(loc->getPos().begin(), startIndex, srcStep) ); +01126 loc->getLODVect(it.V, it.Offset, loc->isInSystemBasis()); +01127 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c2">makeNByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, nbReplicate, <font class="keyword">false</font>); +01128 } +01129 <font class="keywordflow">break</font>; +01130 <font class="keywordflow">case</font> CPSInputType::attrSquareLOD: +01131 { +01132 +01133 CFSquareDot3AddIterator<TIteratorVectStep1616> +01134 it( <a class="code" href="namespaceNL3D.html#a199">TIteratorVectStep1616</a>(loc->getPos().begin(), startIndex, srcStep) ); +01135 loc->getLODVect(it.V, it.Offset, loc->isInSystemBasis()); +01136 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c2">makeNByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, nbReplicate, <font class="keyword">false</font>); +01137 } +01138 <font class="keywordflow">break</font>; +01139 <font class="keywordflow">case</font> CPSInputType::attrClampedLOD: +01140 { +01141 +01142 CFClampDot3AddIterator<TIteratorVectStep1616> +01143 it( <a class="code" href="namespaceNL3D.html#a199">TIteratorVectStep1616</a>( loc->getPos().begin(), startIndex, srcStep) ); +01144 loc->getLODVect(it.V, it.Offset, loc->isInSystemBasis()); +01145 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c2">makeNByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, nbReplicate, <font class="keyword">false</font>); +01146 } +01147 <font class="keywordflow">break</font>; +01148 <font class="keywordflow">case</font> CPSInputType::attrClampedSquareLOD: +01149 { +01150 +01151 CFClampSquareDot3AddIterator<TIteratorVectStep1616> +01152 it( <a class="code" href="namespaceNL3D.html#a199">TIteratorVectStep1616</a>( loc->getPos().begin(), startIndex, srcStep) ); +01153 loc->getLODVect(it.V, it.Offset, loc->isInSystemBasis()); +01154 <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#c2">makeNByIterator</a>(it, tab, <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, numAttrib, nbReplicate, <font class="keyword">false</font>); +01155 } +01156 <font class="keywordflow">break</font>; +01157 } +01158 +01159 <a class="code" href="namespaceNL3D.html#a361">OptFastFloorEnd</a>(); +01160 } +01161 } +01162 +01163 +01164 }; +01165 +01167 <font class="comment">// implementation of CPSAttribMakerT methods //</font> +01169 <font class="comment"></font> +01170 +01171 <font class="keyword">template</font> <<font class="keyword">typename</font> T, <font class="keyword">class</font> F> +<a name="l01172"></a><a class="code" href="classNL3D_1_1CPSAttribMakerT.html#a0">01172</a> T CPSAttribMakerT<T, F>::get(CPSLocated *loc, uint32 <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>) +01173 { +01174 <a class="code" href="namespaceNL3D.html#a360">OptFastFloorBegin</a>(); +01175 T result; +01176 <a class="code" href="debug_8h.html#a6">nlassert</a>(loc); +01177 <font class="keywordflow">switch</font> (<a class="code" href="classNL3D_1_1CPSAttribMakerT.html#o0">_InputType</a>.InputType) +01178 { +01179 <font class="keywordflow">case</font> CPSInputType::attrDate: +01180 { +01181 <font class="keywordtype">float</font> <a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a> = <a class="code" href="classNL3D_1_1CPSAttribMaker.html#n0">_NbCycles</a> * loc->getTime()[<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>]; +01182 <font class="keywordflow">if</font> (_Clamp) +01183 { +01184 <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a> > <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a>) <a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a> = <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a>; +01185 } +01186 +01187 result = <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(<a class="code" href="namespaceNL3D.html#a363">OptFastFractionnalPart</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a>)); +01188 } +01189 <font class="keywordflow">break</font>; +01190 <font class="keywordflow">case</font> CPSInputType::attrInverseMass: +01191 { +01192 <font class="keywordtype">float</font> <a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a> = <a class="code" href="classNL3D_1_1CPSAttribMaker.html#n0">_NbCycles</a> * loc->getInvMass()[<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>]; +01193 <font class="keywordflow">if</font> (_Clamp) +01194 { +01195 <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a> > <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a>) <a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a> = <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a>; +01196 } +01197 result = <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(<a class="code" href="namespaceNL3D.html#a363">OptFastFractionnalPart</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a>)); +01198 } +01199 <font class="keywordflow">break</font>; +01200 <font class="keywordflow">case</font> CPSInputType::attrSpeed: +01201 { +01202 <font class="keywordtype">float</font> <a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a> = <a class="code" href="classNL3D_1_1CPSAttribMaker.html#n0">_NbCycles</a> * loc->getSpeed()[<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>].norm(); +01203 <font class="keywordflow">if</font> (_Clamp) +01204 { +01205 <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a> > <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a>) <a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a> = <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a>; +01206 } +01207 result = <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(<a class="code" href="namespaceNL3D.html#a363">OptFastFractionnalPart</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a>)); +01208 } +01209 <font class="keywordflow">break</font>; +01210 +01211 <font class="keywordflow">case</font> CPSInputType::attrPosition: +01212 { +01213 <font class="keywordtype">float</font> <a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a> = <a class="code" href="classNL3D_1_1CPSAttribMaker.html#n0">_NbCycles</a> * loc->getPos()[<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>].norm(); +01214 <font class="keywordflow">if</font> (_Clamp) +01215 { +01216 <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a> > <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a>) <a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a> = <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a>; +01217 } +01218 result = <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(<a class="code" href="namespaceNL3D.html#a363">OptFastFractionnalPart</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a>)); +01219 } +01220 <font class="keywordflow">break</font>; +01221 <font class="keywordflow">case</font> CPSInputType::attrUniformRandom: +01222 { +01223 result = <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(<font class="keywordtype">float</font>(rand() * (1 / <font class="keywordtype">double</font>(RAND_MAX)))); +01224 } +01225 <font class="keywordflow">break</font>; +01226 <font class="keywordflow">case</font> CPSInputType::attrUserParam: +01227 { +01228 <font class="keywordtype">float</font> <a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a> = <a class="code" href="classNL3D_1_1CPSAttribMaker.html#n0">_NbCycles</a> * loc->getUserParam(<a class="code" href="classNL3D_1_1CPSAttribMakerT.html#o0">_InputType</a>.UserParamNum); +01229 <font class="keywordflow">if</font> (_Clamp) +01230 { +01231 <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a> > <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a>) <a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a> = <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a>; +01232 } +01233 result = <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a>); +01234 } +01235 <font class="keywordflow">break</font>; +01236 <font class="keywordflow">case</font> CPSInputType::attrLOD: +01237 { +01238 <font class="keyword">static</font> <a class="code" href="classNLMISC_1_1CVector.html">NLMISC::CVector</a> lodVect; +01239 <font class="keywordtype">float</font> lodOffset; +01240 loc->getLODVect(lodVect, lodOffset, loc->isInSystemBasis()); +01241 <font class="keywordtype">float</font> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> = fabsf(loc->getPos()[<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>] * lodVect + lodOffset); +01242 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> = <a class="code" href="classNL3D_1_1CPSAttribMaker.html#n0">_NbCycles</a> * <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> > <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a> ? <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a> : <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>; +01243 <font class="keywordflow">if</font> (_Clamp) +01244 { +01245 result = <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> > <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a> ? <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a> : <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>); +01246 } +01247 <font class="keywordflow">else</font> result = <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> - <a class="code" href="memory__common_8h.html#a11">uint32</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>)); +01248 } +01249 <font class="keywordflow">break</font>; +01250 <font class="keywordflow">case</font> CPSInputType::attrSquareLOD: +01251 { +01252 <font class="keyword">static</font> <a class="code" href="classNLMISC_1_1CVector.html">NLMISC::CVector</a> lodVect; +01253 <font class="keywordtype">float</font> lodOffset; +01254 loc->getLODVect(lodVect, lodOffset, loc->isInSystemBasis()); +01255 <font class="keywordtype">float</font> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> = loc->getPos()[<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>] * lodVect + lodOffset; +01256 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> = <a class="code" href="classNL3D_1_1CPSAttribMaker.html#n0">_NbCycles</a> * (<a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> > <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a> ? <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a> : <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> * <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>); +01257 +01258 <font class="keywordflow">if</font> (_Clamp) +01259 { +01260 result = <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> > <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a> ? <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a> : <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>); +01261 } +01262 <font class="keywordflow">else</font> result = <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> - <a class="code" href="memory__common_8h.html#a11">uint32</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>)); +01263 } +01264 <font class="keywordflow">break</font>; +01265 <font class="keywordflow">case</font> CPSInputType::attrClampedLOD: +01266 { +01267 <font class="keyword">static</font> <a class="code" href="classNLMISC_1_1CVector.html">NLMISC::CVector</a> lodVect; +01268 <font class="keywordtype">float</font> lodOffset; +01269 loc->getLODVect(lodVect, lodOffset, loc->isInSystemBasis()); +01270 +01271 <font class="keywordtype">float</font> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> = loc->getPos()[<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>] * lodVect + lodOffset; +01272 <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> < 0) +01273 { +01274 result = <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(<a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a>); +01275 <font class="keywordflow">break</font>; +01276 } +01277 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> = <a class="code" href="classNL3D_1_1CPSAttribMaker.html#n0">_NbCycles</a> * (<a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> > <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a> ? <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a> : <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>); +01278 <font class="keywordflow">if</font> (_Clamp) +01279 { +01280 result = <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> > <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a> ? <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a> : <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>); +01281 } +01282 <font class="keywordflow">else</font> result = <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> - <a class="code" href="memory__common_8h.html#a11">uint32</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>)); +01283 } +01284 <font class="keywordflow">break</font>; +01285 <font class="keywordflow">case</font> CPSInputType::attrClampedSquareLOD: +01286 { +01287 <font class="keyword">static</font> <a class="code" href="classNLMISC_1_1CVector.html">NLMISC::CVector</a> lodVect; +01288 <font class="keywordtype">float</font> lodOffset; +01289 loc->getLODVect(lodVect, lodOffset, loc->isInSystemBasis()); +01290 +01291 <font class="keywordtype">float</font> <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> = loc->getPos()[<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>] * lodVect + lodOffset; +01292 <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> < 0) +01293 { +01294 result = <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(<a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a>); +01295 <font class="keywordflow">break</font>; +01296 } +01297 <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> = <a class="code" href="classNL3D_1_1CPSAttribMaker.html#n0">_NbCycles</a> * (<a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> > <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a> ? <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a> : <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> * <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>); +01298 <font class="keywordflow">if</font> (_Clamp) +01299 { +01300 result = <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> > <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a> ? <a class="code" href="namespaceNL3D.html#a186">MaxInputValue</a> : <a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>); +01301 } +01302 <font class="keywordflow">else</font> result = <a class="code" href="classNL3D_1_1CPSAttribMakerT.html#m0">_F</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a> - <a class="code" href="memory__common_8h.html#a11">uint32</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a385">r</a>)); +01303 } +01304 <font class="keywordflow">break</font>; +01305 <font class="keywordflow">default</font>: +01306 result = T(); +01307 <font class="keywordflow">break</font>; +01308 } +01309 +01310 <a class="code" href="namespaceNL3D.html#a361">OptFastFloorEnd</a>(); +01311 <font class="keywordflow">return</font> result; +01312 +01313 } +01314 +01315 +<a name="l01324"></a><a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html">01324</a> <font class="keyword">template</font> <<font class="keyword">typename</font> T> <font class="keyword">class </font>CPSAttribMakerMemory : <font class="keyword">public</font> CPSAttribMaker<T> +01325 { +01326 <font class="keyword">public</font>: +01327 +<a name="l01330"></a><a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#a0">01330</a> <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#a0">CPSAttribMakerMemory</a>() : <a class="code" href="classNL3D_1_1CPSAttribMaker.html#z706_0">CPSAttribMaker</a><T>(1.f), <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n2">_Scheme</a>(NULL) +01331 { +01332 <a class="code" href="classNL3D_1_1CPSAttribMaker.html#n1">_HasMemory</a> = <font class="keyword">true</font>; +01333 } +01334 +<a name="l01353"></a><a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#a1">01353</a> <font class="keywordtype">void</font> <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#a1">setDefaultValue</a>(T defaultValue) { <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n1">_DefaultValue</a> = defaultValue;} +01354 +<a name="l01356"></a><a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#a2">01356</a> T <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#a2">getDefaultValue</a>(<font class="keywordtype">void</font>)<font class="keyword"> const </font>{ <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n1">_DefaultValue</a>; } +01357 +01358 +01359 +<a name="l01363"></a><a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#a3">01363</a> <font class="keywordtype">void</font> <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#a3">setScheme</a>(CPSAttribMaker<T> *scheme) +01364 { +01365 <a class="code" href="debug_8h.html#a6">nlassert</a>(scheme); +01366 <font class="keywordflow">if</font> (_Scheme) <font class="keyword">delete</font> <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n2">_Scheme</a>; +01367 <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n2">_Scheme</a> = scheme; +01368 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n2">_Scheme</a>->hasMemory()) +01369 { +01370 <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n2">_Scheme</a>->resize(<a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n0">_T</a>.getMaxSize(), <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n0">_T</a>.getSize()); +01371 } +01372 } +01373 +<a name="l01375"></a><a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#a4">01375</a> CPSAttribMaker<T> *<a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#a4">getScheme</a>(<font class="keywordtype">void</font>) { <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n2">_Scheme</a>; } +<a name="l01377"></a><a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#a5">01377</a> <font class="keyword">const</font> CPSAttribMaker<T> *<a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#a4">getScheme</a>(<font class="keywordtype">void</font>)<font class="keyword"> const </font>{ <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n2">_Scheme</a>; } +01378 +01379 +01380 <font class="comment">// copy ctor</font> +<a name="l01381"></a><a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#a6">01381</a> <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#a0">CPSAttribMakerMemory</a>(<font class="keyword">const</font> <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#a0">CPSAttribMakerMemory</a> &<a class="code" href="driver__opengl__extension__def_8h.html#a409">src</a>) : <a class="code" href="classNL3D_1_1CPSAttribMaker.html#z706_0">CPSAttribMaker</a><T>(<a class="code" href="driver__opengl__extension__def_8h.html#a409">src</a>) <font class="comment">// parent copy ctor</font> +01382 { +01383 <a class="code" href="debug_8h.html#a6">nlassert</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a409">src</a>._Scheme); +01384 std::auto_ptr<CPSAttribMaker<T> > <a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>(NLMISC::safe_cast<CPSAttribMaker<T> *>(<a class="code" href="driver__opengl__extension__def_8h.html#a409">src</a>._Scheme->clone())); +01385 this-><a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n0">_T</a> = <a class="code" href="driver__opengl__extension__def_8h.html#a409">src</a>._T; +01386 this-><a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n1">_DefaultValue</a> = <a class="code" href="driver__opengl__extension__def_8h.html#a409">src</a>._DefaultValue; +01387 this-><a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n2">_Scheme</a> = <a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>.release(); +01388 } +<a name="l01390"></a><a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#a7">01390</a> <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#a7">~CPSAttribMakerMemory</a>() +01391 { +01392 <font class="keywordflow">if</font> (_Scheme) +01393 { +01394 <font class="keyword">delete</font> <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n2">_Scheme</a>; +01395 } +01396 } +01397 +<a name="l01399"></a><a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#a8">01399</a> <font class="keyword">virtual</font> T <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#a8">get</a>(CPSLocated *loc, uint32 <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>) +01400 { +01401 <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a> < <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n0">_T</a>.getSize()) <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n0">_T</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>]; +01402 <font class="keywordflow">else</font> <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n1">_DefaultValue</a>; +01403 } +01404 +<a name="l01406"></a><a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#a9">01406</a> <font class="keyword">virtual</font> <font class="keywordtype">void</font> *<a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#a9">make</a>(CPSLocated *loc, +01407 uint32 startIndex, +01408 <font class="keywordtype">void</font> *output, +01409 uint32 <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, +01410 uint32 numAttrib, +01411 <font class="keywordtype">bool</font> allowNoCopy = <font class="keyword">false</font>, +01412 uint32 srcStep = (1 << 16) +01413 )<font class="keyword"> const</font> +01414 <font class="keyword"> </font>{ +01415 <font class="keywordflow">if</font> (!numAttrib) <font class="keywordflow">return</font> output; +01416 <font class="keywordtype">void</font> *tab = output; +01417 <font class="keywordflow">if</font> (!allowNoCopy || srcStep != (1 << 16) || <font class="keyword">sizeof</font>(T) != <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>) +01418 { +01419 <font class="comment">// we just copy what we have memorized</font> +01420 <font class="keywordflow">if</font> (srcStep == (1 << 16)) +01421 { +01422 CPSAttrib<T>::const_iterator it = <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n0">_T</a>.begin() + startIndex, endIt = <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n0">_T</a>.begin() + startIndex + numAttrib; +01423 <font class="keywordflow">do</font> +01424 { +01425 *(T *) tab = *it; +01426 ++it; +01427 tab = (uint8 *) tab + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +01428 } +01429 <font class="keywordflow">while</font> (it != endIt); +01430 } +01431 <font class="keywordflow">else</font> <font class="comment">// no constant step</font> +01432 { +01433 uint32 fpIndex = startIndex * srcStep; +01434 CPSAttrib<T>::const_iterator startIt = <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n0">_T</a>.begin(); +01435 <font class="keywordflow">while</font> (numAttrib --) +01436 { +01437 *(T *) tab = *(startIt + (fpIndex >> 16)); +01438 tab = (uint8 *) tab + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +01439 fpIndex += srcStep; +01440 } +01441 } +01442 <font class="keywordflow">return</font> output; +01443 } +01444 <font class="keywordflow">else</font> +01445 { +01446 <font class="comment">// the caller will read data directly in the vector ...</font> +01447 <font class="keywordflow">return</font> (<font class="keywordtype">void</font> *) &(*(<a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n0">_T</a>.begin() + startIndex)); +01448 } +01449 } +01450 +<a name="l01452"></a><a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#a10">01452</a> <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#a10">make4</a>(CPSLocated *loc, +01453 uint32 startIndex, +01454 <font class="keywordtype">void</font> *tab, +01455 uint32 <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, +01456 uint32 numAttrib, +01457 uint32 srcStep = (1 << 16) +01458 )<font class="keyword"> const</font> +01459 <font class="keyword"> </font>{ +01460 <font class="comment">// we just copy what we have memorized</font> +01461 <font class="keywordflow">if</font> (srcStep == (1 << 16)) +01462 { +01463 CPSAttrib<T>::const_iterator it = <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n0">_T</a>.begin() + startIndex, endIt = <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n0">_T</a>.begin() + startIndex + numAttrib; +01464 <font class="keywordflow">while</font> (it != endIt) +01465 { +01466 *(T *) tab = *it; +01467 tab = (uint8 *) tab + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +01468 *(T *) tab = *it; +01469 tab = (uint8 *) tab + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +01470 *(T *) tab = *it; +01471 tab = (uint8 *) tab + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +01472 *(T *) tab = *it; +01473 tab = (uint8 *) tab + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +01474 ++it; +01475 } +01476 } +01477 <font class="keywordflow">else</font> +01478 { +01479 uint32 fpIndex = startIndex * srcStep; +01480 CPSAttrib<T>::const_iterator startIt = <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n0">_T</a>.begin(); +01481 <font class="keywordflow">while</font> (numAttrib --) +01482 { +01483 *(T *) tab = *(startIt + (fpIndex >> 16)); +01484 *(T *) ((uint8 *) tab + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>) = *(T *) tab; +01485 tab = (uint8 *) tab + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +01486 *(T *) ((uint8 *) tab + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>) = *(T *) tab; +01487 tab = (uint8 *) tab + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +01488 *(T *) ((uint8 *) tab + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>) = *(T *) tab; +01489 +01490 tab = (uint8 *) tab + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a> + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +01491 fpIndex += srcStep; +01492 } +01493 } +01494 } +01495 +<a name="l01497"></a><a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#a11">01497</a> <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#a11">makeN</a>(CPSLocated *loc, +01498 uint32 startIndex, +01499 <font class="keywordtype">void</font> *tab, +01500 uint32 <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, +01501 uint32 numAttrib, +01502 uint32 nbReplicate, +01503 uint32 srcStep = (1 << 16) +01504 )<font class="keyword"> const</font> +01505 <font class="keyword"> </font>{ +01506 <font class="comment">// we just copy what we have memorized</font> +01507 uint k; +01508 CPSAttrib<T>::const_iterator it = <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n0">_T</a>.begin() + startIndex, endIt = <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n0">_T</a>.begin() + startIndex + numAttrib; +01509 <font class="keywordflow">if</font> (srcStep == (1 << 16)) +01510 { +01511 <font class="keywordflow">while</font> (it != endIt) +01512 { +01513 +01514 <font class="keywordflow">for</font> (k = 0; k < nbReplicate; ++k) +01515 { +01516 *(T *) tab = *it; +01517 tab = (uint8 *) tab + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +01518 } +01519 ++it; +01520 } +01521 } +01522 <font class="keywordflow">else</font> +01523 { +01524 uint32 fpIndex = startIndex * srcStep; +01525 CPSAttrib<T>::const_iterator startIt = <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n0">_T</a>.begin(); +01526 +01527 <font class="keywordflow">while</font> (numAttrib --) +01528 { +01529 *(T *) tab = *(startIt + (fpIndex >> 16)); +01530 <font class="keywordflow">for</font> (k = 1; k < nbReplicate; ++k) +01531 { +01532 *(T *) ((uint8 *) tab + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>) = *(T *) tab; +01533 tab = (uint8 *) tab + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +01534 } +01535 tab = (uint8 *) tab + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>; +01536 fpIndex += srcStep; +01537 } +01538 +01539 } +01540 } +01541 +<a name="l01543"></a><a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#a12">01543</a> <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#a12">serial</a>(<a class="code" href="classNLMISC_1_1IStream.html">NLMISC::IStream</a> &f) <font class="keywordflow">throw</font>(NLMISC::EStream) +01544 { +01545 +01546 f.serialVersion(1); +01547 CPSAttribMaker<T>::serial(f); +01548 <font class="keywordflow">if</font> (f.isReading()) +01549 { +01550 <font class="keywordflow">if</font> (_Scheme) <font class="keyword">delete</font> <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n2">_Scheme</a>; +01551 } +01552 f.serialPolyPtr(<a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n2">_Scheme</a>); +01553 f.serial(<a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n0">_T</a>); +01554 f.serial(<a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n1">_DefaultValue</a>); +01555 } +01556 +<a name="l01558"></a><a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#a13">01558</a> <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#a13">deleteElement</a>(uint32 <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>) +01559 { +01560 <a class="code" href="debug_8h.html#a6">nlassert</a>(<a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n2">_Scheme</a>); <font class="comment">// you should have called setScheme !</font> +01561 <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n0">_T</a>.remove(<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>); +01562 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n2">_Scheme</a>->hasMemory()) +01563 { +01564 <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n2">_Scheme</a>->deleteElement(<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>); +01565 } +01566 } +<a name="l01568"></a><a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#a14">01568</a> <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#a14">newElement</a>(CPSLocated *emitterLocated, uint32 emitterIndex) +01569 { +01570 <a class="code" href="debug_8h.html#a6">nlassert</a>(<a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n2">_Scheme</a>); <font class="comment">// you should have called setScheme !</font> +01571 +01572 <font class="comment">// we should create the contained scheme before this one if it has memory...</font> +01573 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n2">_Scheme</a>->hasMemory()) +01574 { +01575 <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n2">_Scheme</a>->newElement(emitterLocated, emitterIndex); +01576 } +01577 +01578 <font class="keywordflow">if</font> (emitterLocated) +01579 { +01580 <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n0">_T</a>.insert(<a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n2">_Scheme</a>->get(emitterLocated, emitterIndex)); +01581 } +01582 <font class="keywordflow">else</font> +01583 { +01588 <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n0">_T</a>.insert(<a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n1">_DefaultValue</a>); +01589 } +01590 } +<a name="l01591"></a><a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#a15">01591</a> <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#a15">resize</a>(uint32 capacity, uint32 nbPresentElements) +01592 { +01593 <a class="code" href="debug_8h.html#a6">nlassert</a>(capacity < (1 << 16)); +01594 <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n0">_T</a>.resize(capacity); +01595 <font class="keywordflow">if</font> (nbPresentElements > <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n0">_T</a>.getSize()) +01596 { +01597 <font class="keywordflow">while</font> (<a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n0">_T</a>.getSize() != nbPresentElements) +01598 { +01599 <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n0">_T</a>.insert(<a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n1">_DefaultValue</a>); +01600 } +01601 } +01602 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (nbPresentElements < <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n0">_T</a>.getSize()) +01603 { +01604 <font class="keywordflow">while</font> (<a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n0">_T</a>.getSize() != nbPresentElements) +01605 { +01606 <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n0">_T</a>.remove(<a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n0">_T</a>.getSize() - 1); +01607 } +01608 } +01609 +01610 +01611 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n2">_Scheme</a> && <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n2">_Scheme</a>->hasMemory()) +01612 { +01613 <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n2">_Scheme</a>->resize(capacity, nbPresentElements); +01614 } +01615 +01616 } +01617 +01618 +01619 <font class="keyword">protected</font>: +01620 <font class="comment">// the attribute we memorize</font> +<a name="l01621"></a><a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n0">01621</a> CPSAttrib<T> <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n0">_T</a>; +01622 +01623 <font class="comment">// the default value for generation (when no emitter can be used)</font> +<a name="l01624"></a><a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n1">01624</a> T <a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n1">_DefaultValue</a>; +01625 +<a name="l01630"></a><a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n2">01630</a> CPSAttribMaker<T> *<a class="code" href="classNL3D_1_1CPSAttribMakerMemory.html#n2">_Scheme</a>; +01631 +01632 }; +01633 +01634 +01635 +01636 } <font class="comment">// NL3D</font> +01637 +01638 +01639 <font class="preprocessor">#endif // NL_PS_ATTRIB_MAKER_HELPER_H</font> +01640 <font class="preprocessor"></font> +01641 <font class="comment">/* End of ps_attrib_maker_helper.h */</font> +</pre></div> + +<!-- footer --> +<BR><FONT Size=+5> </FONT> +</TD> +<TD WIDTH=15><IMG SRC=http://www.nevrax.org/inc/img/pixel.gif WIDTH=15 HEIGHT=15 BORDER=0 ALT=""></TD> +</TR> +</TABLE> +</BODY> +</HTML> |