diff options
Diffstat (limited to '')
-rw-r--r-- | docs/doxygen/nel/a04630.html | 554 |
1 files changed, 554 insertions, 0 deletions
diff --git a/docs/doxygen/nel/a04630.html b/docs/doxygen/nel/a04630.html new file mode 100644 index 00000000..488e5161 --- /dev/null +++ b/docs/doxygen/nel/a04630.html @@ -0,0 +1,554 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>NeL: move_primitive.cpp File Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3.6 --> +<div class="qindex"> <form class="search" action="search.php" method="get"> +<a class="qindex" href="main.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">Data Structures</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">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a> | <span class="search"><u>S</u>earch for <input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div> +<h1>move_primitive.cpp File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2> +Description of movables primitives<p> +<dl compact><dt><b>Id</b></dt><dd><a class="el" href="a04630.html">move_primitive.cpp</a>,v 1.19 2003/10/10 10:08:48 corvazier Exp </dd></dl> + +<p> +Definition in file <a class="el" href="a06053.html">move_primitive.cpp</a>. +<p> +<code>#include "<a class="el" href="a06452.html">stdpacs.h</a>"</code><br> +<code>#include "<a class="el" href="a06054.html">pacs/move_primitive.h</a>"</code><br> +<code>#include "<a class="el" href="a05578.html">pacs/collision_desc.h</a>"</code><br> +<code>#include "<a class="el" href="a06051.html">pacs/move_element.h</a>"</code><br> +<code>#include "<a class="el" href="a05788.html">nel/misc/hierarchical_timer.h</a>"</code><br> + +<p> +<a href="a06053.html">Go to the source code of this file.</a><table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +<tr><td colspan=2><br><h2>Defines</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="a04630.html#a0">NLPACS_HAUTO_GET_GLOBAL_POSITION</a> H_AUTO_USE ( NLPACS_Get_Global_Position )</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="a04630.html#a3">NLPACS_HAUTO_MOVE</a> H_AUTO_USE ( NLPACS_Move )</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="a04630.html#a1">NLPACS_HAUTO_SET_GLOBAL_POSITION</a> H_AUTO_USE ( NLPACS_Set_Global_Position )</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="a04630.html#a2">NLPACS_HAUTO_SET_UGLOBAL_POSITION</a> H_AUTO_USE ( NLPACS_Set_UGlobal_Position )</td></tr> + +<tr><td colspan=2><br><h2>Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a04630.html#a4">H_AUTO_DECL</a> (NLPACS_Get_Global_Position) H_AUTO_DECL(NLPACS_Set_Global_Position) H_AUTO_DECL(NLPACS_Set_UGlobal_Position) H_AUTO_DECL(NLPACS_Move) namespace <a class="el" href="a06969.html">NLPACS</a></td></tr> + +</table> +<hr><h2>Define Documentation</h2> +<a class="anchor" name="a0" doxytag="move_primitive.cpp::NLPACS_HAUTO_GET_GLOBAL_POSITION" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> #define NLPACS_HAUTO_GET_GLOBAL_POSITION H_AUTO_USE ( NLPACS_Get_Global_Position ) + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Referenced by <a class="el" href="a06053.html#l00035">H_AUTO_DECL()</a>. </td> + </tr> +</table> +<a class="anchor" name="a3" doxytag="move_primitive.cpp::NLPACS_HAUTO_MOVE" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> #define NLPACS_HAUTO_MOVE H_AUTO_USE ( NLPACS_Move ) + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Referenced by <a class="el" href="a06053.html#l00035">H_AUTO_DECL()</a>. </td> + </tr> +</table> +<a class="anchor" name="a1" doxytag="move_primitive.cpp::NLPACS_HAUTO_SET_GLOBAL_POSITION" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> #define NLPACS_HAUTO_SET_GLOBAL_POSITION H_AUTO_USE ( NLPACS_Set_Global_Position ) + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Referenced by <a class="el" href="a06053.html#l00035">H_AUTO_DECL()</a>. </td> + </tr> +</table> +<a class="anchor" name="a2" doxytag="move_primitive.cpp::NLPACS_HAUTO_SET_UGLOBAL_POSITION" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> #define NLPACS_HAUTO_SET_UGLOBAL_POSITION H_AUTO_USE ( NLPACS_Set_UGlobal_Position ) + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Referenced by <a class="el" href="a06053.html#l00035">H_AUTO_DECL()</a>. </td> + </tr> +</table> +<hr><h2>Function Documentation</h2> +<a class="anchor" name="a4" doxytag="move_primitive.cpp::H_AUTO_DECL" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> H_AUTO_DECL </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">NLPACS_Get_Global_Position </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06053.html#l00035">35</a> of file <a class="el" href="a06053.html">move_primitive.cpp</a>. +<p> +References <a class="el" href="a05646.html#l01013">depth</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a04630.html#a0">NLPACS_HAUTO_GET_GLOBAL_POSITION</a>, <a class="el" href="a04630.html#a3">NLPACS_HAUTO_MOVE</a>, <a class="el" href="a04630.html#a1">NLPACS_HAUTO_SET_GLOBAL_POSITION</a>, <a class="el" href="a04630.html#a2">NLPACS_HAUTO_SET_UGLOBAL_POSITION</a>, <a class="el" href="a05646.html#l00244">type</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05981.html#l00096">uint8</a>, and <a class="el" href="a05646.html#l01013">width</a>. +<p> +<div class="fragment"><pre>00045 { +00046 +00047 <span class="comment">// ***************************************************************************</span> +00048 +00049 CMovePrimitive::CMovePrimitive (CMoveContainer* container, <a class="code" href="a04558.html#a7">uint8</a> firstWorldImage, <a class="code" href="a04558.html#a7">uint8</a> numWorldImage) +00050 { +00051 _FirstWorldImage=firstWorldImage; +00052 _NumWorldImage=numWorldImage; +00053 +00054 _CollisionMask=0xffffffff; +00055 _OcclusionMask=0xffffffff; +00056 _Attenuation=1; +00057 _Container=container; +00058 _StaticFlags=0; +00059 _RootOTInfo=NULL; +00060 _LastTestTime=0xffffffff; +00061 +00062 <span class="comment">// Ptr table alloc</span> +00063 _WorldImages=_Container->allocateWorldImagesPtrs (numWorldImage); +00064 +00065 <span class="comment">// Alloc world images</span> +00066 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> j=0; j<numWorldImage; j++) +00067 _WorldImages[j]=_Container->allocateWorldImage (); +00068 } +00069 +00070 <span class="comment">// ***************************************************************************</span> +00071 +00072 CMovePrimitive::~CMovePrimitive () +00073 { +00074 <span class="comment">// Alloc world images</span> +00075 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> j=0; j<(<a class="code" href="a04558.html#a15">uint</a>)_NumWorldImage; j++) +00076 { +00077 _WorldImages[j]->deleteIt (*_Container, (<a class="code" href="a04558.html#a7">uint8</a>)(_FirstWorldImage+j)); +00078 _Container->freeWorldImage (_WorldImages[j]); +00079 } +00080 +00081 <span class="comment">// Ptr table alloc</span> +00082 _Container->freeWorldImagesPtrs (_WorldImages); +00083 } +00084 +00085 <span class="comment">// ***************************************************************************</span> +00086 +00087 <span class="keywordtype">void</span> CMovePrimitive::removeCollisionOTInfo (CCollisionOTInfo *toRemove) +00088 { +00089 <span class="comment">// Should be ok</span> +00090 CCollisionOTInfo *previousElement=NULL; +00091 CCollisionOTInfo *element=_RootOTInfo; +00092 <a class="code" href="a04199.html#a6">nlassert</a> (element); +00093 +00094 <span class="comment">// Look for it</span> +00095 <span class="keywordflow">while</span> (element) +00096 { +00097 <span class="comment">// Good one ?</span> +00098 <span class="keywordflow">if</span> (element==toRemove) +00099 { +00100 <span class="comment">// If previous element, just link</span> +00101 <span class="keywordflow">if</span> (previousElement) +00102 previousElement->primitiveLink (<span class="keyword">this</span>, element->getNext (<span class="keyword">this</span>)); +00103 <span class="keywordflow">else</span> +00104 _RootOTInfo=element->getNext (<span class="keyword">this</span>); +00105 +00106 <span class="comment">// End</span> +00107 <span class="keywordflow">break</span>; +00108 } +00109 +00110 <span class="comment">// Look for next</span> +00111 previousElement=element; +00112 element=element->getNext (<span class="keyword">this</span>); +00113 } +00114 +00115 <span class="comment">// Should be found</span> +00116 <a class="code" href="a04199.html#a6">nlassert</a> (element); +00117 } +00118 +00119 <span class="comment">// ***************************************************************************</span> +00120 +00121 <span class="keywordtype">void</span> CMovePrimitive::removeCollisionOTInfo () +00122 { +00123 <span class="comment">// For each element in the list</span> +00124 CCollisionOTInfo *element=_RootOTInfo; +00125 <span class="keywordflow">while</span> (element) +00126 { +00127 <span class="comment">// Unlink from ot</span> +00128 element->unlink (); +00129 +00130 <span class="comment">// Remove collision ot info from other primitive</span> +00131 CMovePrimitive *other=element->getOtherPrimitive (<span class="keyword">this</span>); +00132 <span class="keywordflow">if</span> (other) +00133 { +00134 <span class="comment">// Remove it in the other element</span> +00135 other->removeCollisionOTInfo (element); +00136 } +00137 +00138 <span class="comment">// Next element</span> +00139 element=element->getNext (<span class="keyword">this</span>); +00140 } +00141 +00142 <span class="comment">// Relink element because we keep it</span> +00143 _RootOTInfo=NULL; +00144 } +00145 +00146 <span class="comment">// ***************************************************************************</span> +00147 +00148 <span class="keywordtype">void</span> CMovePrimitive::checkSortedList () +00149 { +00150 <span class="comment">// Check sorted list for ecah world image</span> +00151 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> i=0; i<(<a class="code" href="a04558.html#a15">uint</a>)_NumWorldImage; i++) +00152 _WorldImages[i]->checkSortedList (i+_FirstWorldImage); +00153 } +00154 +00155 <span class="comment">// ***************************************************************************</span> +00156 +00157 <span class="keywordtype">bool</span> CMovePrimitive::isTriggered (CMovePrimitive& second, <span class="keywordtype">bool</span> enter, <span class="keywordtype">bool</span> exit) +00158 { +00159 <span class="comment">// Generate a trigger ?</span> +00160 +00161 <span class="comment">// Is the two are not triggers ?</span> +00162 <span class="keywordflow">if</span> ( ( (_StaticFlags&TriggerMask) == NotATrigger ) && ( (second._StaticFlags&TriggerMask) == NotATrigger ) ) +00163 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00164 +00165 <span class="comment">// Is one of them is an enter trigger ?</span> +00166 <span class="keywordflow">if</span> ( enter && ( (_StaticFlags&EnterTrigger) || (second._StaticFlags&EnterTrigger) ) ) +00167 <span class="keywordflow">return</span> <span class="keyword">true</span>; +00168 +00169 <span class="comment">// Is one of them is an exit trigger ?</span> +00170 <span class="keywordflow">if</span> ( exit && ( (_StaticFlags&ExitTrigger) || (second._StaticFlags&ExitTrigger) ) ) +00171 <span class="keywordflow">return</span> <span class="keyword">true</span>; +00172 +00173 <span class="comment">// Is one of them is a trigger ?</span> +00174 <span class="keywordflow">if</span> ( (_StaticFlags&OverlapTrigger) || (second._StaticFlags&OverlapTrigger) ) +00175 <span class="keywordflow">return</span> <span class="keyword">true</span>; +00176 +00177 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00178 } +00179 +00180 <span class="comment">// ***************************************************************************</span> +00181 +00182 <span class="keywordtype">void</span> CMovePrimitive::insertInWorldImage (<a class="code" href="a04558.html#a7">uint8</a> worldImage) +00183 { +00184 <span class="comment">// Check it is a collisionable primitive</span> +00185 <a class="code" href="a04199.html#a6">nlassert</a> (!isNonCollisionable()); +00186 +00187 <span class="comment">// Check ad get the primitive world image</span> +00188 CPrimitiveWorldImage *wI=getWorldImage (worldImage); +00189 +00190 <span class="comment">// Set as inserted</span> +00191 wI->setInWorldImageFlag (<span class="keyword">true</span>); +00192 +00193 <span class="comment">// Flag to update this wI</span> +00194 _Container->changed (<span class="keyword">this</span>, worldImage); +00195 } +00196 +00197 <span class="comment">// ***************************************************************************</span> +00198 +00199 <span class="keywordtype">void</span> CMovePrimitive::removeFromWorldImage (<a class="code" href="a04558.html#a7">uint8</a> worldImage) +00200 { +00201 <span class="comment">// Check it is a collisionable primitive</span> +00202 <a class="code" href="a04199.html#a6">nlassert</a> (!isNonCollisionable()); +00203 +00204 <span class="comment">// Check ad get the primitive world image</span> +00205 CPrimitiveWorldImage *wI=getWorldImage (worldImage); +00206 +00207 <span class="comment">// Remove from cells</span> +00208 wI->deleteIt (*_Container, worldImage); +00209 +00210 <span class="comment">// Set as non inserted</span> +00211 wI->setInWorldImageFlag (<span class="keyword">false</span>); +00212 } +00213 +00214 <span class="comment">// ***************************************************************************</span> +00215 +00216 <span class="keywordtype">void</span> CMovePrimitive::setAbsorbtion (<span class="keywordtype">float</span> attenuation) +00217 { +00218 _Attenuation=attenuation; +00219 } +00220 +00221 <span class="comment">// ***************************************************************************</span> +00222 +00223 <span class="keywordtype">void</span> CMovePrimitive::setOrientation (<span class="keywordtype">double</span> rot, <a class="code" href="a04558.html#a7">uint8</a> worldImage) +00224 { +00225 <span class="keywordflow">if</span> (isNonCollisionable()) +00226 getWorldImage (0)->setOrientation (rot, _Container, <span class="keyword">this</span>, worldImage); +00227 <span class="keywordflow">else</span> +00228 getWorldImage (worldImage)->setOrientation (rot, _Container, <span class="keyword">this</span>, worldImage); +00229 } +00230 +00231 <span class="comment">// ***************************************************************************</span> +00232 +00233 <span class="keywordtype">void</span> CMovePrimitive::setGlobalPosition (<span class="keyword">const</span> UGlobalPosition& pos, <a class="code" href="a04558.html#a7">uint8</a> worldImage) +00234 { +00235 <a class="code" href="a04630.html#a1">NLPACS_HAUTO_SET_GLOBAL_POSITION</a> +00236 +00237 <span class="keywordflow">if</span> (isNonCollisionable()) +00238 getWorldImage (0)->setGlobalPosition (pos, *_Container, *<span class="keyword">this</span>, worldImage); +00239 <span class="keywordflow">else</span> +00240 getWorldImage (worldImage)->setGlobalPosition (pos, *_Container, *<span class="keyword">this</span>, worldImage); +00241 } +00242 +00243 <span class="comment">// ***************************************************************************</span> +00244 +00245 <span class="keywordtype">void</span> CMovePrimitive::setGlobalPosition (<span class="keyword">const</span> <a class="code" href="a03664.html">NLMISC::CVectorD</a>& pos, <a class="code" href="a04558.html#a7">uint8</a> worldImage, UGlobalPosition::TType <a class="code" href="a04223.html#a581">type</a>) +00246 { +00247 <a class="code" href="a04630.html#a2">NLPACS_HAUTO_SET_UGLOBAL_POSITION</a> +00248 +00249 <span class="keywordflow">if</span> (isNonCollisionable()) +00250 getWorldImage (0)->setGlobalPosition (pos, *_Container, *<span class="keyword">this</span>, worldImage, (_StaticFlags & DontSnapToGroundFlag) != 0); +00251 <span class="keywordflow">else</span> +00252 getWorldImage (worldImage)->setGlobalPosition (pos, *_Container, *<span class="keyword">this</span>, worldImage, (_StaticFlags & DontSnapToGroundFlag) != 0); +00253 } +00254 +00255 <span class="comment">// ***************************************************************************</span> +00256 +00257 <span class="keywordtype">void</span> CMovePrimitive::move (<span class="keyword">const</span> <a class="code" href="a03664.html">NLMISC::CVectorD</a>& speed, <a class="code" href="a04558.html#a7">uint8</a> worldImage) +00258 { +00259 <a class="code" href="a04630.html#a3">NLPACS_HAUTO_MOVE</a> +00260 +00261 <span class="keywordflow">if</span> (isNonCollisionable()) +00262 getWorldImage (0)->move (speed, *_Container, *<span class="keyword">this</span>, worldImage); +00263 <span class="keywordflow">else</span> +00264 getWorldImage (worldImage)->move (speed, *_Container, *<span class="keyword">this</span>, worldImage); +00265 } +00266 +00267 <span class="comment">// ***************************************************************************</span> +00268 +00269 <a class="code" href="a03664.html">NLMISC::CVectorD</a> CMovePrimitive::getFinalPosition (<a class="code" href="a04558.html#a7">uint8</a> worldImage) <span class="keyword">const</span> +00270 { +00271 <span class="keywordflow">if</span> (isNonCollisionable()) +00272 <span class="keywordflow">return</span> getWorldImage (0)->getFinalPosition (); +00273 <span class="keywordflow">else</span> +00274 <span class="keywordflow">return</span> getWorldImage (worldImage)->getFinalPosition (); +00275 } +00276 +00277 <span class="comment">// ***************************************************************************</span> +00278 +00279 <span class="keyword">const</span> <a class="code" href="a03664.html">NLMISC::CVectorD</a>& CMovePrimitive::getSpeed (<a class="code" href="a04558.html#a7">uint8</a> worldImage)<span class="keyword"> const</span> +00280 <span class="keyword"></span>{ +00281 <span class="keywordflow">if</span> (isNonCollisionable()) +00282 <span class="keywordflow">return</span> getWorldImage (0)->getSpeed (); +00283 <span class="keywordflow">else</span> +00284 <span class="keywordflow">return</span> getWorldImage (worldImage)->getSpeed (); +00285 } +00286 +00287 <span class="comment">// ***************************************************************************</span> +00288 +00289 CMovePrimitive::TType CMovePrimitive::getPrimitiveType ()<span class="keyword"> const</span> +00290 <span class="keyword"></span>{ +00291 <span class="keywordflow">return</span> getPrimitiveTypeInternal (); +00292 } +00293 +00294 <span class="comment">// ***************************************************************************</span> +00295 +00296 CMovePrimitive::TReaction CMovePrimitive::getReactionType ()<span class="keyword"> const</span> +00297 <span class="keyword"></span>{ +00298 <span class="keywordflow">return</span> getReactionTypeInternal (); +00299 } +00300 +00301 <span class="comment">// ***************************************************************************</span> +00302 +00303 CMovePrimitive::TTrigger CMovePrimitive::getTriggerType ()<span class="keyword"> const</span> +00304 <span class="keyword"></span>{ +00305 <span class="keywordflow">return</span> getTriggerTypeInternal (); +00306 } +00307 +00308 <span class="comment">// ***************************************************************************</span> +00309 +00310 CMovePrimitive::TCollisionMask CMovePrimitive::getCollisionMask ()<span class="keyword"> const</span> +00311 <span class="keyword"></span>{ +00312 <span class="keywordflow">return</span> getCollisionMaskInternal (); +00313 } +00314 +00315 <span class="comment">// ***************************************************************************</span> +00316 +00317 CMovePrimitive::TCollisionMask CMovePrimitive::getOcclusionMask ()<span class="keyword"> const</span> +00318 <span class="keyword"></span>{ +00319 <span class="keywordflow">return</span> getOcclusionMaskInternal (); +00320 } +00321 +00322 <span class="comment">// ***************************************************************************</span> +00323 +00324 <span class="keywordtype">bool</span> CMovePrimitive::getObstacle ()<span class="keyword"> const</span> +00325 <span class="keyword"></span>{ +00326 <span class="keywordflow">return</span> isObstacle (); +00327 } +00328 +00329 <span class="comment">// ***************************************************************************</span> +00330 +00331 <span class="keywordtype">float</span> CMovePrimitive::getAbsorbtion ()<span class="keyword"> const</span> +00332 <span class="keyword"></span>{ +00333 <span class="keywordflow">return</span> _Attenuation; +00334 } +00335 +00336 <span class="comment">// ***************************************************************************</span> +00337 +00338 <span class="keywordtype">void</span> CMovePrimitive::getSize (<span class="keywordtype">float</span>& <a class="code" href="a04223.html#a632">width</a>, <span class="keywordtype">float</span>& <a class="code" href="a04223.html#a634">depth</a>)<span class="keyword"> const</span> +00339 <span class="keyword"></span>{ +00340 <a class="code" href="a04223.html#a632">width</a>=getLength(0); +00341 <a class="code" href="a04223.html#a634">depth</a>=getLength(1); +00342 } +00343 +00344 <span class="comment">// ***************************************************************************</span> +00345 +00346 <span class="keywordtype">float</span> CMovePrimitive::getHeight ()<span class="keyword"> const</span> +00347 <span class="keyword"></span>{ +00348 <span class="keywordflow">return</span> getHeightInternal (); +00349 } +00350 +00351 <span class="comment">// ***************************************************************************</span> +00352 +00353 <span class="keywordtype">float</span> CMovePrimitive::getRadius ()<span class="keyword"> const</span> +00354 <span class="keyword"></span>{ +00355 <span class="keywordflow">return</span> getRadiusInternal (); +00356 } +00357 +00358 <span class="comment">// ***************************************************************************</span> +00359 +00360 <span class="keywordtype">double</span> CMovePrimitive::getOrientation (<a class="code" href="a04558.html#a7">uint8</a> worldImage)<span class="keyword"> const</span> +00361 <span class="keyword"></span>{ +00362 <span class="keywordflow">if</span> (isNonCollisionable()) +00363 <span class="keywordflow">return</span> getWorldImage (0)->getOrientation (); +00364 <span class="keywordflow">else</span> +00365 <span class="keywordflow">return</span> getWorldImage (worldImage)->getOrientation (); +00366 } +00367 +00368 <span class="comment">// ***************************************************************************</span> +00369 +00370 <span class="keywordtype">void</span> CMovePrimitive::getGlobalPosition (UGlobalPosition& pos, <a class="code" href="a04558.html#a7">uint8</a> worldImage)<span class="keyword"> const</span> +00371 <span class="keyword"></span>{ +00372 <a class="code" href="a04630.html#a0">NLPACS_HAUTO_GET_GLOBAL_POSITION</a> +00373 +00374 <span class="keywordflow">if</span> (isNonCollisionable()) +00375 pos=getWorldImage (0)->getGlobalPosition(); +00376 <span class="keywordflow">else</span> +00377 pos=getWorldImage (worldImage)->getGlobalPosition(); +00378 } +00379 +00380 <span class="comment">// ***************************************************************************</span> +00381 +00382 <a class="code" href="a04558.html#a7">uint8</a> CMovePrimitive::getFirstWorldImageV ()<span class="keyword"> const</span> +00383 <span class="keyword"></span>{ +00384 <span class="keywordflow">return</span> getFirstWorldImage (); +00385 } +00386 +00387 <span class="comment">// ***************************************************************************</span> +00388 +00389 <a class="code" href="a04558.html#a7">uint8</a> CMovePrimitive::getNumWorldImageV ()<span class="keyword"> const</span> +00390 <span class="keyword"></span>{ +00391 <span class="keywordflow">return</span> getNumWorldImageV (); +00392 } +00393 +00394 <span class="comment">// ***************************************************************************</span> +00395 +00396 <span class="keywordtype">bool</span> CMovePrimitive::isInCollision (CMovePrimitive *primitive) +00397 { +00398 <span class="comment">// Should be ok</span> +00399 CCollisionOTInfo *element=_RootOTInfo; +00400 +00401 <span class="comment">// Look for it</span> +00402 <span class="keywordflow">while</span> (element) +00403 { +00404 <span class="comment">// Dynamic collision ?</span> +00405 <span class="keywordflow">if</span> (!element->isCollisionAgainstStatic()) +00406 { +00407 <span class="comment">// Cast</span> +00408 <span class="keyword">const</span> CCollisionOTDynamicInfo *dynInfo=static_cast<const CCollisionOTDynamicInfo*> (element); +00409 +00410 <span class="comment">// Check if the primitive is used</span> +00411 <span class="keywordflow">if</span> ((dynInfo->getFirstPrimitive()== primitive)||(dynInfo->getSecondPrimitive()== primitive)) +00412 <span class="keywordflow">return</span> <span class="keyword">true</span>; +00413 } +00414 +00415 <span class="comment">// Look for next</span> +00416 element=element->getNext (<span class="keyword">this</span>); +00417 } +00418 +00419 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00420 } +00421 +00422 } <span class="comment">// NLPACS</span> +</pre></div> </td> + </tr> +</table> +<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 06:43:09 2004 for NeL by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 > +</a>1.3.6 </small></address> +</body> +</html> |