aboutsummaryrefslogtreecommitdiff
path: root/docs/doxygen/nel/a04630.html
blob: 488e5161a1b41d6c0ef16cbf584493a910ef7b99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
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&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a>  | <span class="search"><u>S</u>earch&nbsp;for&nbsp;<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&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a04630.html#a0">NLPACS_HAUTO_GET_GLOBAL_POSITION</a>&nbsp;&nbsp;&nbsp;H_AUTO_USE ( NLPACS_Get_Global_Position )</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a04630.html#a3">NLPACS_HAUTO_MOVE</a>&nbsp;&nbsp;&nbsp;H_AUTO_USE ( NLPACS_Move )</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a04630.html#a1">NLPACS_HAUTO_SET_GLOBAL_POSITION</a>&nbsp;&nbsp;&nbsp;H_AUTO_USE ( NLPACS_Set_Global_Position )</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a04630.html#a2">NLPACS_HAUTO_SET_UGLOBAL_POSITION</a>&nbsp;&nbsp;&nbsp;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>&nbsp;</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&nbsp;&nbsp;&nbsp;H_AUTO_USE ( NLPACS_Get_Global_Position )
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </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&nbsp;&nbsp;&nbsp;H_AUTO_USE ( NLPACS_Move )
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </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&nbsp;&nbsp;&nbsp;H_AUTO_USE ( NLPACS_Set_Global_Position )
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </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&nbsp;&nbsp;&nbsp;H_AUTO_USE ( NLPACS_Set_UGlobal_Position )
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </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">(&nbsp;</td>
          <td class="md" nowrap valign="top">NLPACS_Get_Global_Position&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </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-&gt;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&lt;numWorldImage; j++)
00067                 _WorldImages[j]=_Container-&gt;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&lt;(<a class="code" href="a04558.html#a15">uint</a>)_NumWorldImage; j++)
00076         {
00077                 _WorldImages[j]-&gt;deleteIt (*_Container, (<a class="code" href="a04558.html#a7">uint8</a>)(_FirstWorldImage+j));
00078                 _Container-&gt;freeWorldImage (_WorldImages[j]);
00079         }
00080 
00081         <span class="comment">// Ptr table alloc</span>
00082         _Container-&gt;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-&gt;primitiveLink (<span class="keyword">this</span>, element-&gt;getNext (<span class="keyword">this</span>));
00103                         <span class="keywordflow">else</span>
00104                                 _RootOTInfo=element-&gt;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-&gt;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-&gt;unlink ();
00129 
00130                 <span class="comment">// Remove collision ot info from other primitive</span>
00131                 CMovePrimitive *other=element-&gt;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-&gt;removeCollisionOTInfo (element);
00136                 }
00137 
00138                 <span class="comment">// Next element</span>
00139                 element=element-&gt;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&lt;(<a class="code" href="a04558.html#a15">uint</a>)_NumWorldImage; i++)
00152                 _WorldImages[i]-&gt;checkSortedList (i+_FirstWorldImage);
00153 }
00154 
00155 <span class="comment">// ***************************************************************************</span>
00156 
00157 <span class="keywordtype">bool</span> CMovePrimitive::isTriggered (CMovePrimitive&amp; 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&amp;TriggerMask) == NotATrigger ) &amp;&amp; ( (second._StaticFlags&amp;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 &amp;&amp; ( (_StaticFlags&amp;EnterTrigger) || (second._StaticFlags&amp;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 &amp;&amp; ( (_StaticFlags&amp;ExitTrigger) || (second._StaticFlags&amp;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&amp;OverlapTrigger) || (second._StaticFlags&amp;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-&gt;setInWorldImageFlag (<span class="keyword">true</span>);
00192 
00193         <span class="comment">// Flag to update this wI</span>
00194         _Container-&gt;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-&gt;deleteIt (*_Container, worldImage);
00209 
00210         <span class="comment">// Set as non inserted</span>
00211         wI-&gt;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)-&gt;setOrientation (rot, _Container, <span class="keyword">this</span>, worldImage);
00227         <span class="keywordflow">else</span>
00228                 getWorldImage (worldImage)-&gt;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&amp; 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)-&gt;setGlobalPosition (pos, *_Container, *<span class="keyword">this</span>, worldImage);
00239         <span class="keywordflow">else</span>
00240                 getWorldImage (worldImage)-&gt;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>&amp; 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)-&gt;setGlobalPosition (pos, *_Container, *<span class="keyword">this</span>, worldImage, (_StaticFlags &amp; DontSnapToGroundFlag) != 0);
00251         <span class="keywordflow">else</span>
00252                 getWorldImage (worldImage)-&gt;setGlobalPosition (pos, *_Container, *<span class="keyword">this</span>, worldImage, (_StaticFlags &amp; 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>&amp; 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)-&gt;move (speed, *_Container, *<span class="keyword">this</span>, worldImage);
00263         <span class="keywordflow">else</span>
00264                 getWorldImage (worldImage)-&gt;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)-&gt;getFinalPosition ();
00273         <span class="keywordflow">else</span>
00274                 <span class="keywordflow">return</span> getWorldImage (worldImage)-&gt;getFinalPosition ();
00275 }
00276 
00277 <span class="comment">// ***************************************************************************</span>
00278 
00279 <span class="keyword">const</span> <a class="code" href="a03664.html">NLMISC::CVectorD</a>&amp; 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)-&gt;getSpeed ();
00283         <span class="keywordflow">else</span>
00284                 <span class="keywordflow">return</span> getWorldImage (worldImage)-&gt;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>&amp; <a class="code" href="a04223.html#a632">width</a>, <span class="keywordtype">float</span>&amp; <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)-&gt;getOrientation ();
00364         <span class="keywordflow">else</span>
00365                 <span class="keywordflow">return</span> getWorldImage (worldImage)-&gt;getOrientation ();
00366 }
00367 
00368 <span class="comment">// ***************************************************************************</span>
00369 
00370 <span class="keywordtype">void</span> CMovePrimitive::getGlobalPosition (UGlobalPosition&amp; 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)-&gt;getGlobalPosition();
00376         <span class="keywordflow">else</span>
00377                 pos=getWorldImage (worldImage)-&gt;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-&gt;isCollisionAgainstStatic())
00406                 {
00407                         <span class="comment">// Cast</span>
00408                         <span class="keyword">const</span> CCollisionOTDynamicInfo *dynInfo=static_cast&lt;const CCollisionOTDynamicInfo*&gt; (element);
00409                         
00410                         <span class="comment">// Check if the primitive is used</span>
00411                         <span class="keywordflow">if</span> ((dynInfo-&gt;getFirstPrimitive()== primitive)||(dynInfo-&gt;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-&gt;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>