File: X3DTriangles.TBaseTrianglesOctree.html

package info (click to toggle)
castle-game-engine 5.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 185,428 kB
  • sloc: pascal: 260,781; cpp: 1,363; objc: 713; makefile: 537; xml: 496; sh: 480; php: 4
file content (410 lines) | stat: -rw-r--r-- 40,473 bytes parent folder | download
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title>Castle Game Engine: X3DTriangles: Class TBaseTrianglesOctree</title>
<meta name="generator" content="PasDoc 0.13.0">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="StyleSheet" type="text/css" href="pasdoc.css">
</head>
<body>
<table class="container"><tr><td class="navigation">
<h2>Castle Game Engine</h2><p><a href="introduction.html" class="navigation">Introduction</a></p><p><a href="AllUnits.html" class="navigation">Units</a></p><p><a href="ClassHierarchy.html" class="navigation">Class Hierarchy</a></p><p><a href="AllClasses.html" class="navigation">Classes, Interfaces, Objects and Records</a></p><p><a href="AllTypes.html" class="navigation">Types</a></p><p><a href="AllVariables.html" class="navigation">Variables</a></p><p><a href="AllConstants.html" class="navigation">Constants</a></p><p><a href="AllFunctions.html" class="navigation">Functions and Procedures</a></p><p><a href="AllIdentifiers.html" class="navigation">Identifiers</a></p></td><td class="content">
<a name="TBaseTrianglesOctree"></a><h1 class="cio">Class TBaseTrianglesOctree</h1>
<table class="sections wide_list">
<tr>
<td><a class="section" href="#PasDoc-Description">Description</a></td><td><a class="section" href="#PasDoc-Hierarchy">Hierarchy</a></td><td>Fields</td><td><a class="section" href="#PasDoc-Methods">Methods</a></td><td>Properties</td></tr></table>
<a name="PasDoc-Description"></a><h2 class="unit">Unit</h2>
<p class="unitlink">
<a  href="X3DTriangles.html">X3DTriangles</a></p>
<h2 class="declaration">Declaration</h2>
<p class="declaration">
<code>type TBaseTrianglesOctree = class(<a class="normal" href="CastleOctree.TOctree.html">TOctree</a>)</code></p>
<h2 class="description">Description</h2>
<p>
Abstract class for octrees that can check and return collisions with <a class="normal" href="X3DTriangles.TTriangle.html">TTriangle</a>.

<p>Octree node class used by this must be a <a class="normal" href="X3DTriangles.TBaseTrianglesOctreeNode.html">TBaseTrianglesOctreeNode</a> descendant.

<p>In a simple case, this is an ancestor of <a class="normal" href="CastleTriangleOctree.TTriangleOctree.html">TTriangleOctree</a>, that is just an octree storing <a class="normal" href="X3DTriangles.TTriangle.html">TTriangle</a>. But it's also an ancestor of <a class="normal" href="CastleShapeOctree.TShapeOctree.html">TShapeOctree</a>, since each shape has also a triangle octree. This way, <a class="normal" href="CastleShapeOctree.TShapeOctree.html">TShapeOctree</a> can calculate collisions with <a class="normal" href="X3DTriangles.TTriangle.html">TTriangle</a>, even though it doesn't directly store <a class="normal" href="X3DTriangles.TTriangle.html">TTriangle</a> items.</p>
<a name="PasDoc-Hierarchy"></a><h2 class="hierarchy">Hierarchy</h2>
<ul class="hierarchy"><li class="ancestor">TObject</li>
<li class="ancestor"><a class="normal" href="CastleOctree.TOctree.html">TOctree</a></li>
<li class="thisitem">TBaseTrianglesOctree</li></ul><h2 class="overview">Overview</h2>
<a name="PasDoc-Methods"></a><h3 class="summary">Methods</h3>
<table class="summary wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="X3DTriangles.TBaseTrianglesOctree.html#SegmentCollision">SegmentCollision</a></b>( out Intersection: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; out IntersectionDistance: Single; const pos1, pos2: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const ReturnClosestIntersection: boolean; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: <a  href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; overload;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="X3DTriangles.TBaseTrianglesOctree.html#SegmentCollision">SegmentCollision</a></b>( out Intersection: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const pos1, pos2: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const ReturnClosestIntersection: boolean; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: <a  href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; overload;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="X3DTriangles.TBaseTrianglesOctree.html#SegmentCollision">SegmentCollision</a></b>( out IntersectionDistance: Single; const pos1, pos2: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const ReturnClosestIntersection: boolean; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: <a  href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; overload;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="X3DTriangles.TBaseTrianglesOctree.html#SegmentCollision">SegmentCollision</a></b>( const pos1, pos2: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const ReturnClosestIntersection: boolean; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: <a  href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; overload;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="X3DTriangles.TBaseTrianglesOctree.html#IsSegmentCollision">IsSegmentCollision</a></b>( const pos1, pos2: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: <a  href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): boolean;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="X3DTriangles.TBaseTrianglesOctree.html#SphereCollision">SphereCollision</a></b>(const pos: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const Radius: Single; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; const TrianglesToIgnoreFunc: <a  href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): <a  href="X3DTriangles.html#PTriangle">PTriangle</a>;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="X3DTriangles.TBaseTrianglesOctree.html#IsSphereCollision">IsSphereCollision</a></b>(const pos: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const Radius: Single; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; const TrianglesToIgnoreFunc: <a  href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): boolean;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="X3DTriangles.TBaseTrianglesOctree.html#BoxCollision">BoxCollision</a></b>(const ABox: <a  href="CastleBoxes.TBox3D.html">TBox3D</a>; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; const TrianglesToIgnoreFunc: <a  href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): <a  href="X3DTriangles.html#PTriangle">PTriangle</a>;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="X3DTriangles.TBaseTrianglesOctree.html#IsBoxCollision">IsBoxCollision</a></b>(const ABox: <a  href="CastleBoxes.TBox3D.html">TBox3D</a>; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; const TrianglesToIgnoreFunc: <a  href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): boolean;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="X3DTriangles.TBaseTrianglesOctree.html#RayCollision">RayCollision</a></b>( out Intersection: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; out IntersectionDistance: Single; const RayOrigin, RayDirection: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const ReturnClosestIntersection: boolean; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: <a  href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; overload;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="X3DTriangles.TBaseTrianglesOctree.html#RayCollision">RayCollision</a></b>( out Intersection: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const RayOrigin, RayDirection: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const ReturnClosestIntersection: boolean; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: <a  href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; overload;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="X3DTriangles.TBaseTrianglesOctree.html#RayCollision">RayCollision</a></b>( out IntersectionDistance: Single; const RayOrigin, RayDirection: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const ReturnClosestIntersection: boolean; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: <a  href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; overload;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="X3DTriangles.TBaseTrianglesOctree.html#RayCollision">RayCollision</a></b>(const RayOrigin, RayDirection: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const ReturnClosestIntersection: boolean; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: <a  href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; overload;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="X3DTriangles.TBaseTrianglesOctree.html#IsRayCollision">IsRayCollision</a></b>( const RayOrigin, RayDirection: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: <a  href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): boolean;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="X3DTriangles.TBaseTrianglesOctree.html#MoveCollision">MoveCollision</a></b>( const OldPos, NewPos: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const IsRadius: boolean; const Radius: Single; const OldBox, NewBox: <a  href="CastleBoxes.TBox3D.html">TBox3D</a>; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a> = nil; const TrianglesToIgnoreFunc: <a  href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a> = nil): boolean;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="X3DTriangles.TBaseTrianglesOctree.html#MoveCollision">MoveCollision</a></b>( const OldPos, ProposedNewPos: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; out NewPos: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const IsRadius: boolean; const Radius: Single; const OldBox, NewBox: <a  href="CastleBoxes.TBox3D.html">TBox3D</a>; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a> = nil; const TrianglesToIgnoreFunc: <a  href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a> = nil): boolean;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="X3DTriangles.TBaseTrianglesOctree.html#HeightCollision">HeightCollision</a></b>( const Position, GravityUp: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; out AboveHeight: Single; out AboveGround: <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; const TrianglesToIgnoreFunc: <a  href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): boolean;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>class function <b><a  href="X3DTriangles.TBaseTrianglesOctree.html#IgnoreTransparentItem">IgnoreTransparentItem</a></b>( const Sender: TObject; const Triangle: <a  href="CastleTriangles.html#P3DTriangle">P3DTriangle</a>): boolean;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>class function <b><a  href="X3DTriangles.TBaseTrianglesOctree.html#IgnoreForShadowRays">IgnoreForShadowRays</a></b>( const Sender: TObject; const Triangle: <a  href="CastleTriangles.html#P3DTriangle">P3DTriangle</a>): boolean;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="X3DTriangles.TBaseTrianglesOctree.html#LightNotBlocked">LightNotBlocked</a></b>(const Light: <a  href="X3DNodes.TLightInstance.html">TLightInstance</a>; const LightedPoint, LightedPointPlane, RenderDir: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; const IgnoreMarginAtStart: boolean): boolean;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="X3DTriangles.TBaseTrianglesOctree.html#EnumerateTriangles">EnumerateTriangles</a></b>(EnumerateTriangleFunc: <a  href="X3DTriangles.html#TEnumerateTriangleFunc">TEnumerateTriangleFunc</a>); virtual; abstract;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="X3DTriangles.TBaseTrianglesOctree.html#TrianglesCount">TrianglesCount</a></b>: Cardinal; virtual; abstract;</code></td>
</tr>
</table>
<h2 class="description">Description</h2>
<h3 class="detail">Methods</h3>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="SegmentCollision"></a><code>function <b>SegmentCollision</b>( out Intersection: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; out IntersectionDistance: Single; const pos1, pos2: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const ReturnClosestIntersection: boolean; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: <a  href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; overload;</code></td>
</tr>
<tr><td colspan="2">
<p>
Collision checking using the octree.

<p><a class="normal" href="X3DTriangles.TBaseTrianglesOctree.html#SegmentCollision">SegmentCollision</a> checks for collision between a line segment and tree items.

<p><a class="normal" href="X3DTriangles.TBaseTrianglesOctree.html#SphereCollision">SphereCollision</a> checks for collision with a sphere.

<p><a class="normal" href="X3DTriangles.TBaseTrianglesOctree.html#BoxCollision">BoxCollision</a> checks for collision with a box (axis-aligned, <a class="normal" href="CastleBoxes.TBox3D.html">TBox3D</a> type).

<p><a class="normal" href="X3DTriangles.TBaseTrianglesOctree.html#RayCollision">RayCollision</a> checks for collision with a ray.

<p>All there methods return nil if there is no collision, or a pointer to colliding item.

<p>

<p>

<p>

<p>

<p>

<p></p>
<h6 class="description_section">Parameters</h6>
<dl class="parameters">
<dt>ReturnClosestIntersection</dt>
<dd><p>If <code>False</code>, then any collision detected is returned. For routines that don't have ReturnClosestIntersection parameter (<a class="normal" href="X3DTriangles.TBaseTrianglesOctree.html#SphereCollision">SphereCollision</a>, <a class="normal" href="X3DTriangles.TBaseTrianglesOctree.html#BoxCollision">BoxCollision</a>) always any collision is returned.

<p>If this is <code>True</code>, then the collision closest to RayOrigin (for <a class="normal" href="X3DTriangles.TBaseTrianglesOctree.html#RayCollision">RayCollision</a>) or Pos1 (for <a class="normal" href="X3DTriangles.TBaseTrianglesOctree.html#SegmentCollision">SegmentCollision</a>) is returned. This makes the collision somewhat slower (as we have to check all collisions, while for ReturnClosestIntersection = <code>False</code> we can terminate at first collision found.)

<p>The versions that return boolean value (IsXxxCollision) don't take this parameter, as they are naturally interested in existence of <i>any</i> intersection.</dd>
<dt>TriangleToIgnore</dt>
<dd><p>If this is non-nil, then Segment/<a class="normal" href="X3DTriangles.TBaseTrianglesOctree.html#RayCollision">RayCollision</a> assume that there is <i>never</i> a collision with this octree item. It's never returned as collidable item.

<p>This is useful for recursive ray-tracer, when you start tracing from some existing face (octree item). In this case, you don't want to &quot;hit&quot; the starting face. So you can pass this face as TriangleToIgnore.

<p>Note that IgnoreMarginAtStart helps with the same problem, although a little differently.</dd>
<dt>TrianglesToIgnoreFunc</dt>
<dd><p>If assigned, then items for which TrianglesToIgnoreFunc returns <code>True</code> will be ignored. This is a more general mechanism than TriangleToIgnore, as you can ignore many items, you can also make some condition to ignore &mdash; for example, you can ignore partially transparent items.</dd>
<dt>IgnoreMarginAtStart</dt>
<dd><p>If <code>True</code>, then collisions that happen very very close to RayOrigin (or Pos1 for <a class="normal" href="X3DTriangles.TBaseTrianglesOctree.html#SegmentCollision">SegmentCollision</a>) will be ignored.

<p>This is another thing helpful for recursive ray-tracers: you don't want to hit the starting face, or any coplanar faces, when tracing reflected/refracted/shadow ray.

<p>Note that if you know actual pointer of your face, it's better to use TriangleToIgnore &mdash; TriangleToIgnore is a 100% guaranteed stable solution, while IgnoreMarginAtStart necessarily has some &quot;epsilon&quot; constant that determines which items are ignored. This epsilon may be too large, or too small, in some cases.

<p>In practice, recursive ray-tracers should use both TriangleToIgnore (to avoid collisions with starting face) and IgnoreMarginAtStart = <code>True</code> (to avoid collisions with faces coplanar with starting face).</dd>
<dt>IntersectionDistance</dt>
<dd>For <a class="normal" href="X3DTriangles.TBaseTrianglesOctree.html#RayCollision">RayCollision</a>: Returned IntersectionDistance is the distance along the RayDirection: smaller IntersectionDistance, closer to RayOrigin. IntersectionDistance is always &gt;= 0. Intersection is always equal to RayOrigin + RayDirection * IntersectionDistance.

<p>For <a class="normal" href="X3DTriangles.TBaseTrianglesOctree.html#SegmentCollision">SegmentCollision</a>: analogously, IntersectionDistance is along Pos2 - Pos1. IntersectionDistance is always in 0...1. Intersectio is always equal to Pos1 + (Pos2 - Pos1) * IntersectionDistance.</dd>
</dl>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="SegmentCollision"></a><code>function <b>SegmentCollision</b>( out Intersection: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const pos1, pos2: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const ReturnClosestIntersection: boolean; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: <a  href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; overload;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="SegmentCollision"></a><code>function <b>SegmentCollision</b>( out IntersectionDistance: Single; const pos1, pos2: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const ReturnClosestIntersection: boolean; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: <a  href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; overload;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="SegmentCollision"></a><code>function <b>SegmentCollision</b>( const pos1, pos2: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const ReturnClosestIntersection: boolean; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: <a  href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; overload;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="IsSegmentCollision"></a><code>function <b>IsSegmentCollision</b>( const pos1, pos2: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: <a  href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): boolean;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="SphereCollision"></a><code>function <b>SphereCollision</b>(const pos: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const Radius: Single; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; const TrianglesToIgnoreFunc: <a  href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): <a  href="X3DTriangles.html#PTriangle">PTriangle</a>;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="IsSphereCollision"></a><code>function <b>IsSphereCollision</b>(const pos: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const Radius: Single; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; const TrianglesToIgnoreFunc: <a  href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): boolean;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="BoxCollision"></a><code>function <b>BoxCollision</b>(const ABox: <a  href="CastleBoxes.TBox3D.html">TBox3D</a>; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; const TrianglesToIgnoreFunc: <a  href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): <a  href="X3DTriangles.html#PTriangle">PTriangle</a>;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="IsBoxCollision"></a><code>function <b>IsBoxCollision</b>(const ABox: <a  href="CastleBoxes.TBox3D.html">TBox3D</a>; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; const TrianglesToIgnoreFunc: <a  href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): boolean;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="RayCollision"></a><code>function <b>RayCollision</b>( out Intersection: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; out IntersectionDistance: Single; const RayOrigin, RayDirection: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const ReturnClosestIntersection: boolean; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: <a  href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; overload;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="RayCollision"></a><code>function <b>RayCollision</b>( out Intersection: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const RayOrigin, RayDirection: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const ReturnClosestIntersection: boolean; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: <a  href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; overload;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="RayCollision"></a><code>function <b>RayCollision</b>( out IntersectionDistance: Single; const RayOrigin, RayDirection: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const ReturnClosestIntersection: boolean; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: <a  href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; overload;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="RayCollision"></a><code>function <b>RayCollision</b>(const RayOrigin, RayDirection: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const ReturnClosestIntersection: boolean; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: <a  href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; overload;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="IsRayCollision"></a><code>function <b>IsRayCollision</b>( const RayOrigin, RayDirection: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: <a  href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): boolean;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="MoveCollision"></a><code>function <b>MoveCollision</b>( const OldPos, NewPos: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const IsRadius: boolean; const Radius: Single; const OldBox, NewBox: <a  href="CastleBoxes.TBox3D.html">TBox3D</a>; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a> = nil; const TrianglesToIgnoreFunc: <a  href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a> = nil): boolean;</code></td>
</tr>
<tr><td colspan="2">
<p>
Check is move allowed. This is the perfect (precise, using triangle mesh, and fast) implementation of <a class="normal" href="Castle3D.T3D.html#MoveCollision">T3D.MoveCollision</a> interface.

<p>TriangleToIgnore and TrianglesToIgnoreFunc meaning is just like for <a class="normal" href="X3DTriangles.TBaseTrianglesOctree.html#RayCollision">RayCollision</a>. This can be used to allow camera to walk thorugh some surfaces (e.g. through water surface, or to allow player to walk through some &quot;fake wall&quot; and discover secret room in game etc.).</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="MoveCollision"></a><code>function <b>MoveCollision</b>( const OldPos, ProposedNewPos: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; out NewPos: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const IsRadius: boolean; const Radius: Single; const OldBox, NewBox: <a  href="CastleBoxes.TBox3D.html">TBox3D</a>; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a> = nil; const TrianglesToIgnoreFunc: <a  href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a> = nil): boolean;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="HeightCollision"></a><code>function <b>HeightCollision</b>( const Position, GravityUp: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; out AboveHeight: Single; out AboveGround: <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; const TrianglesToIgnoreFunc: <a  href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): boolean;</code></td>
</tr>
<tr><td colspan="2">
<p>
For given camera position and up vector, calculate camera height above the ground. This is comfortable for cooperation with <a class="normal" href="CastleCameras.TWalkCamera.html#OnHeight">TWalkCamera.OnHeight</a>.

<p>See <a class="normal" href="Castle3D.T3D.html#Height">T3D.Height</a> for specification.

<p>TriangleToIgnore and TrianglesToIgnoreFunc meaning is just like for <a class="normal" href="X3DTriangles.TBaseTrianglesOctree.html#RayCollision">RayCollision</a>.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="IgnoreTransparentItem"></a><code>class function <b>IgnoreTransparentItem</b>( const Sender: TObject; const Triangle: <a  href="CastleTriangles.html#P3DTriangle">P3DTriangle</a>): boolean;</code></td>
</tr>
<tr><td colspan="2">
<p>
Ignore (return <code>True</code>) transparent triangles (with Material.Transparency &gt; 0).

<p>This is suitable for <a class="normal" href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a> function, you can pass this to <a class="normal" href="X3DTriangles.TBaseTrianglesOctree.html#RayCollision">RayCollision</a> and such.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="IgnoreForShadowRays"></a><code>class function <b>IgnoreForShadowRays</b>( const Sender: TObject; const Triangle: <a  href="CastleTriangles.html#P3DTriangle">P3DTriangle</a>): boolean;</code></td>
</tr>
<tr><td colspan="2">
<p>
Ignore (return <code>True</code>) transparent triangles (with Material.Transparency &gt; 0) and non-shadow-casting triangles (with Appearance.shadowCaster = FALSE).

<p>This is suitable for <a class="normal" href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a> function, you can pass this to <a class="normal" href="X3DTriangles.TBaseTrianglesOctree.html#RayCollision">RayCollision</a> and such.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="LightNotBlocked"></a><code>function <b>LightNotBlocked</b>(const Light: <a  href="X3DNodes.TLightInstance.html">TLightInstance</a>; const LightedPoint, LightedPointPlane, RenderDir: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const TriangleToIgnore: <a  href="X3DTriangles.html#PTriangle">PTriangle</a>; const IgnoreMarginAtStart: boolean): boolean;</code></td>
</tr>
<tr><td colspan="2">
<p>
Checks whether VRML Light (point or directional) lights at scene point LightedPoint.

<p>&quot;Lights at scene&quot; means that the light is turned on (field &quot;on&quot; is <code>True</code>) and between light source and a LightedPoint nothing blocks the light (we check it by querying collisions using the octree, ignoring transparent and non-shadow-casting triangles), and the light source is on the same side of LightedPointPlane as RenderDir.

<p>TriangleToIgnore and IgnoreMarginAtStart work just like for <a class="normal" href="X3DTriangles.TBaseTrianglesOctree.html#SegmentCollision">SegmentCollision</a>. You should usually set TriangleToIgnore to the triangle containing your LightedPoint and IgnoreMarginAtStart to <code>True</code>, to avoid detecting point as shadowing itself.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="EnumerateTriangles"></a><code>procedure <b>EnumerateTriangles</b>(EnumerateTriangleFunc: <a  href="X3DTriangles.html#TEnumerateTriangleFunc">TEnumerateTriangleFunc</a>); virtual; abstract;</code></td>
</tr>
<tr><td colspan="2">
<p>
Enumerate every triangle of this octree.

<p>It passes to EnumerateTriangleFunc callback a Triangle. Triangle is passed as a pointer (never <code>Nil</code>) &mdash; these are guaranteed to be &quot;stable&quot; pointers stored inside octrees' lists (so they will be valid as long as octree (and eventual children octrees for <a class="normal" href="CastleShapeOctree.TShapeOctree.html">TShapeOctree</a>)).

<p>Every triangle is guaranteed to have it's World coordinates updated (to put it simply, when this is used on <a class="normal" href="CastleShapeOctree.TShapeOctree.html">TShapeOctree</a>, then we call UpdateWorld on each triangle).</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="TrianglesCount"></a><code>function <b>TrianglesCount</b>: Cardinal; virtual; abstract;</code></td>
</tr>
<tr><td colspan="2">
<p>
Number of triangles within the octree. This counts all triangles returned by <a class="normal" href="X3DTriangles.TBaseTrianglesOctree.html#EnumerateTriangles">EnumerateTriangles</a>.</p>
</td></tr>
</table>
<!-- Piwik -->
<script type="text/javascript">
  var _paq = _paq || [];
  _paq.push(["trackPageView"]);
  _paq.push(["enableLinkTracking"]);

  (function() {
    var u=(("https:" == document.location.protocol) ? "https" : "http") + "://michalis.ii.uni.wroc.pl/piwik-castle-engine/";
    _paq.push(["setTrackerUrl", u+"piwik.php"]);
    _paq.push(["setSiteId", "1"]);
    var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
    g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
  })();
</script>
<!-- End Piwik Code -->

<noscript>
<!-- Piwik Image Tracker -->
<img src="http://michalis.ii.uni.wroc.pl/piwik-castle-engine/piwik.php?idsite=1&amp;rec=1" style="border:0" alt="" />
<!-- End Piwik -->
</noscript>
<hr noshade size="1"><span class="appinfo"><em>Generated by <a  href="http://pasdoc.sourceforge.net/">PasDoc 0.13.0</a> on 2015-06-15 04:43:18</em>
</span>
</td></tr></table></body></html>