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
|
<!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: CastleOctree: Class TOctreeNode</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="TOctreeNode"></a><h1 class="cio">Class TOctreeNode</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><a class="section" href="#PasDoc-Fields">Fields</a></td><td><a class="section" href="#PasDoc-Methods">Methods</a></td><td><a class="section" href="#PasDoc-Properties">Properties</a></td></tr></table>
<a name="PasDoc-Description"></a><h2 class="unit">Unit</h2>
<p class="unitlink">
<a href="CastleOctree.html">CastleOctree</a></p>
<h2 class="declaration">Declaration</h2>
<p class="declaration">
<code>type TOctreeNode = class(TObject)</code></p>
<h2 class="description">Description</h2>
<p>
Octree node.
<p></p>
<ul class="paragraph_spacing">
<li><p><i>Leaf nodes</i> store a list of indexes in <a class="normal" href="CastleOctree.TOctreeNode.html#ItemsIndices">ItemsIndices</a> array. These are usuallly indexes to some array of items on <a class="normal" href="CastleOctree.TOctree.html">TOctree</a>. For the sake of this unit they are just some integers that uniquely describe items that you want to keep in octree leafs. The base abstract <code>TOctreeNode</code> class doesn't clarify what kind of items are actually kept.</p></li>
<li><p><i>Not leaf (internal) nodes</i> have 8 children nodes in <a class="normal" href="CastleOctree.TOctreeNode.html#TreeSubNodes">TreeSubNodes</a>.</p></li>
</ul>
<p>
<p>Each <a class="normal" href="CastleOctree.TOctreeNode.html">TOctreeNode</a> also has some essential properties like Box, <a class="normal" href="CastleOctree.TOctreeNode.html#MiddlePoint">MiddlePoint</a> and ParentTree.</p>
<a name="PasDoc-Hierarchy"></a><h2 class="hierarchy">Hierarchy</h2>
<ul class="hierarchy"><li class="ancestor">TObject</li>
<li class="thisitem">TOctreeNode</li></ul><h2 class="overview">Overview</h2>
<a name="PasDoc-Fields"></a><h3 class="summary">Fields</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><b><a href="CastleOctree.TOctreeNode.html#TreeSubNodes">TreeSubNodes</a></b>: array [boolean, boolean, boolean] of <a href="CastleOctree.TOctreeNode.html">TOctreeNode</a>;</code></td>
</tr>
</table>
<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="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code>procedure <b><a href="CastleOctree.TOctreeNode.html#PutItemIntoSubNodes">PutItemIntoSubNodes</a></b>(ItemIndex: integer); 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="CastleOctree.TOctreeNode.html#ItemsCount">ItemsCount</a></b>: integer;</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="CastleOctree.TOctreeNode.html#AddItem">AddItem</a></b>(ItemIndex: integer);</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>constructor <b><a href="CastleOctree.TOctreeNode.html#Create">Create</a></b>(const ABox: <a href="CastleBoxes.TBox3D.html">TBox3D</a>; AParentTree: <a href="CastleOctree.TOctree.html">TOctree</a>; AParentNode: <a href="CastleOctree.TOctreeNode.html">TOctreeNode</a>; ADepth: integer; AsLeaf: 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>destructor <b><a href="CastleOctree.TOctreeNode.html#Destroy">Destroy</a></b>; override;</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="CastleOctree.TOctreeNode.html#SubnodeWithPoint">SubnodeWithPoint</a></b>(const P: <a href="CastleVectors.html#TVector3Double">TVector3Double</a>): <a href="CastleOctree.html#TOctreeSubnodeIndex">TOctreeSubnodeIndex</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="CastleOctree.TOctreeNode.html#SubnodeWithPoint">SubnodeWithPoint</a></b>(const P: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>): <a href="CastleOctree.html#TOctreeSubnodeIndex">TOctreeSubnodeIndex</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>procedure <b><a href="CastleOctree.TOctreeNode.html#SubnodesWithBox">SubnodesWithBox</a></b>(const ABox: <a href="CastleBoxes.TBox3D.html">TBox3D</a>; out SubnodeLow, SubnodeHigh: <a href="CastleOctree.html#TOctreeSubnodeIndex">TOctreeSubnodeIndex</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="CastleOctree.TOctreeNode.html#FrustumCollisionPossible">FrustumCollisionPossible</a></b>(const Frustum: <a href="CastleFrustum.TFrustum.html">TFrustum</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>procedure <b><a href="CastleOctree.TOctreeNode.html#PushChildrenFrontToBack">PushChildrenFrontToBack</a></b>(List: TOrderedList; const Position: <a href="CastleVectors.html#TVector3Single">TVector3Single</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>procedure <b><a href="CastleOctree.TOctreeNode.html#PushChildrenBackToFront">PushChildrenBackToFront</a></b>(List: TOrderedList; const Position: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>);</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>procedure <b><a href="CastleOctree.TOctreeNode.html#PushChildren">PushChildren</a></b>(List: TOrderedList);</code></td>
</tr>
</table>
<a name="PasDoc-Properties"></a><h3 class="summary">Properties</h3>
<table class="summary wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code>property <b><a href="CastleOctree.TOctreeNode.html#InternalParentTree">InternalParentTree</a></b>: <a href="CastleOctree.TOctree.html">TOctree</a> read FParentTree;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code>property <b><a href="CastleOctree.TOctreeNode.html#InternalParentNode">InternalParentNode</a></b>: <a href="CastleOctree.TOctreeNode.html">TOctreeNode</a> read FParentNode;</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>property <b><a href="CastleOctree.TOctreeNode.html#ItemsIndices">ItemsIndices</a></b>: <a href="CastleUtils.TIntegerList.html">TIntegerList</a> read FItemsIndices;</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>property <b><a href="CastleOctree.TOctreeNode.html#IsLeaf">IsLeaf</a></b>: boolean read fIsLeaf write SetLeaf;</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>property <b><a href="CastleOctree.TOctreeNode.html#MiddlePoint">MiddlePoint</a></b>: <a href="CastleVectors.html#TVector3Single">TVector3Single</a> read fMiddlePoint;</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>property <b><a href="CastleOctree.TOctreeNode.html#Box">Box</a></b>: <a href="CastleBoxes.TBox3D.html">TBox3D</a> read fBox;</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>property <b><a href="CastleOctree.TOctreeNode.html#BoundingSphereCenter">BoundingSphereCenter</a></b>: <a href="CastleVectors.html#TVector3Single">TVector3Single</a> read FBoundingSphereCenter;</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>property <b><a href="CastleOctree.TOctreeNode.html#BoundingSphereRadiusSqr">BoundingSphereRadiusSqr</a></b>: Single read FBoundingSphereRadiusSqr;</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>property <b><a href="CastleOctree.TOctreeNode.html#Depth">Depth</a></b>: integer read fDepth;</code></td>
</tr>
</table>
<h2 class="description">Description</h2>
<h3 class="detail">Fields</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="TreeSubNodes"></a><code><b>TreeSubNodes</b>: array [boolean, boolean, boolean] of <a href="CastleOctree.TOctreeNode.html">TOctreeNode</a>;</code></td>
</tr>
<tr><td colspan="2">
<p>
Child octree nodes, only if this is an internal node (<a class="normal" href="CastleOctree.TOctreeNode.html#IsLeaf">IsLeaf</a> = <code>False</code>). When this is a leaf (<a class="normal" href="CastleOctree.TOctreeNode.html#IsLeaf">IsLeaf</a> = <code>True</code>), these are all <code>Nil</code>.
<p>Indexed by booleans, "true" means that given coordinate is >= than corresponding <a class="normal" href="CastleOctree.TOctreeNode.html#MiddlePoint">MiddlePoint</a> coordinate. For example <code>TreeSubNodes</code>[true, true, true] are coordinates between <a class="normal" href="CastleOctree.TOctreeNode.html#MiddlePoint">MiddlePoint</a> and Box[1].
<p>Subnodes class is always the same as our (Self) class.
<p>This field is read-only from outside of this unit.</p>
</td></tr>
</table>
<h3 class="detail">Methods</h3>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><a name="PutItemIntoSubNodes"></a><code>procedure <b>PutItemIntoSubNodes</b>(ItemIndex: integer); virtual; abstract;</code></td>
</tr>
<tr><td colspan="2">
<p>
Insert given index into appropriate subnodes. This should call SubNode.AddItem(ItemIndex) for chosen <a class="normal" href="CastleOctree.TOctreeNode.html#TreeSubNodes">TreeSubNodes</a> (maybe all, maybe none). It all depends on what is your definition of "an octree item" – you generally want to check how given item collides with BoundingBoxes of your <a class="normal" href="CastleOctree.TOctreeNode.html#TreeSubNodes">TreeSubNodes</a> and call SubNode.AddItem(ItemIndex) for each SubNode that contains (al least part) of your ItemIndex.
<p>Don't ever call this directly from subclasses of <a class="normal" href="CastleOctree.TOctreeNode.html">TOctreeNode</a>. <a class="normal" href="CastleOctree.TOctreeNode.html">TOctreeNode</a> internally calls it when it needs to.
<p>You can assume here that all <a class="normal" href="CastleOctree.TOctreeNode.html#TreeSubNodes">TreeSubNodes</a> are <> nil. But you shouldn't assume here anything about value of <a class="normal" href="CastleOctree.TOctreeNode.html#IsLeaf">IsLeaf</a> or ItemIndices <> nil (yes, this means that this function may be internally called when the state of this object is partially invalid).</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="ItemsCount"></a><code>function <b>ItemsCount</b>: integer;</code></td>
</tr>
<tr><td colspan="2">
<p>
Number of items stored here. Same thing as ItemsIndices.Count, but has somewhat nicer name if you have Items[] property defined in a subclass. Use this only when you know that <a class="normal" href="CastleOctree.TOctreeNode.html#ItemsIndices">ItemsIndices</a> <> nil.</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="AddItem"></a><code>procedure <b>AddItem</b>(ItemIndex: integer);</code></td>
</tr>
<tr><td colspan="2">
<p>
Insert an item into this octree node.
<p>It takes care of the octree structure properties:
<p></p>
<ul class="paragraph_spacing">
<li><p>Splits a leaf node into non-leaf node if maximum number of items in leaf is exceeded (and Depth < MaxDepth).</p></li>
<li><p>And when you insert an item into non-leaf node, it correctly puts it into children subnodes too.</p></li>
</ul>
<p></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="Create"></a><code>constructor <b>Create</b>(const ABox: <a href="CastleBoxes.TBox3D.html">TBox3D</a>; AParentTree: <a href="CastleOctree.TOctree.html">TOctree</a>; AParentNode: <a href="CastleOctree.TOctreeNode.html">TOctreeNode</a>; ADepth: integer; AsLeaf: boolean);</code></td>
</tr>
<tr><td colspan="2">
<p>
Simple constructor. Calculates <a class="normal" href="CastleOctree.TOctreeNode.html#MiddlePoint">MiddlePoint</a> as a middle of the ABox, or as (0, 0, 0) if ABox is empty.</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="Destroy"></a><code>destructor <b>Destroy</b>; override;</code></td>
</tr>
<tr><td colspan="2">
</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="SubnodeWithPoint"></a><code>function <b>SubnodeWithPoint</b>(const P: <a href="CastleVectors.html#TVector3Double">TVector3Double</a>): <a href="CastleOctree.html#TOctreeSubnodeIndex">TOctreeSubnodeIndex</a>; overload;</code></td>
</tr>
<tr><td colspan="2">
<p>
In which subnode does the given point lie. Decides using <a class="normal" href="CastleOctree.TOctreeNode.html#MiddlePoint">MiddlePoint</a>.
<p>This is a simple utility, ignores what is our <a class="normal" href="CastleOctree.TOctreeNode.html#Box">Box</a> (doesn't check is P is inside <a class="normal" href="CastleOctree.TOctreeNode.html#Box">Box</a> at all), ignores if we're leaf or not.</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="SubnodeWithPoint"></a><code>function <b>SubnodeWithPoint</b>(const P: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>): <a href="CastleOctree.html#TOctreeSubnodeIndex">TOctreeSubnodeIndex</a>; overload;</code></td>
</tr>
<tr><td colspan="2">
</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="SubnodesWithBox"></a><code>procedure <b>SubnodesWithBox</b>(const ABox: <a href="CastleBoxes.TBox3D.html">TBox3D</a>; out SubnodeLow, SubnodeHigh: <a href="CastleOctree.html#TOctreeSubnodeIndex">TOctreeSubnodeIndex</a>);</code></td>
</tr>
<tr><td colspan="2">
</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="FrustumCollisionPossible"></a><code>function <b>FrustumCollisionPossible</b>(const Frustum: <a href="CastleFrustum.TFrustum.html">TFrustum</a>): boolean;</code></td>
</tr>
<tr><td colspan="2">
<p>
Simple check for frustum collision.</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="PushChildrenFrontToBack"></a><code>procedure <b>PushChildrenFrontToBack</b>(List: TOrderedList; const Position: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>);</code></td>
</tr>
<tr><td colspan="2">
<p>
Push children nodes (use this only for non-leafs) into the List. </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="PushChildrenBackToFront"></a><code>procedure <b>PushChildrenBackToFront</b>(List: TOrderedList; const Position: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>);</code></td>
</tr>
<tr><td colspan="2">
</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="PushChildren"></a><code>procedure <b>PushChildren</b>(List: TOrderedList);</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<h3 class="detail">Properties</h3>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><a name="InternalParentTree"></a><code>property <b>InternalParentTree</b>: <a href="CastleOctree.TOctree.html">TOctree</a> read FParentTree;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><a name="InternalParentNode"></a><code>property <b>InternalParentNode</b>: <a href="CastleOctree.TOctreeNode.html">TOctreeNode</a> read FParentNode;</code></td>
</tr>
<tr><td colspan="2">
<p>
Parent node of the octree. <code>Nil</code> for the root node.</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="ItemsIndices"></a><code>property <b>ItemsIndices</b>: <a href="CastleUtils.TIntegerList.html">TIntegerList</a> read FItemsIndices;</code></td>
</tr>
<tr><td colspan="2">
<p>
Items stored at the octree node. Items are stored here (and <code>ItemsIndices</code> <> nil) only when this is a leaf item (<a class="normal" href="CastleOctree.TOctreeNode.html#IsLeaf">IsLeaf</a> = <code>True</code>) or when ParentTree.ItemsInNonLeafNodes is <code>True</code>. In the latter case, we store items even in internal nodes, see <a class="normal" href="CastleOctree.TOctree.html#ItemsInNonLeafNodes">TOctree.ItemsInNonLeafNodes</a>.
<p>Never put any items in the octree node by direct ItemsIndices.Add. Instead you must use <a class="normal" href="CastleOctree.TOctreeNode.html#AddItem">AddItem</a> method.</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="IsLeaf"></a><code>property <b>IsLeaf</b>: boolean read fIsLeaf write SetLeaf;</code></td>
</tr>
<tr><td colspan="2">
<p>
Is this a leaf node.
<p>Changing this property rearranges items correctly. If you change this from <code>False</code> to <code>True</code> then all items from subnodes are correctly gathered and stored in our <a class="normal" href="CastleOctree.TOctreeNode.html#ItemsIndices">ItemsIndices</a>. If you change this from <code>True</code> to <code>False</code> then subnodes are created and we insert to them our items, following the <a class="normal" href="CastleOctree.TOctreeNode.html#MiddlePoint">MiddlePoint</a> rule.</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="MiddlePoint"></a><code>property <b>MiddlePoint</b>: <a href="CastleVectors.html#TVector3Single">TVector3Single</a> read fMiddlePoint;</code></td>
</tr>
<tr><td colspan="2">
<p>
Middle point of the octree node, determines how our subnodes divide the space. This is defined for leaf nodes too, since leaf nodes may have to be converted into internal nodes at some point.
<p>Note that <code>MiddlePoint</code> does not need to be exactly in the middle of the octree node. This is it's default value (if you called constructor without explicitly providing <code>MiddlePoint</code> value), but it's not a requirement. <code>MiddlePoint</code> may be anywhere inside <a class="normal" href="CastleOctree.TOctreeNode.html#Box">Box</a>.
<p>This way you can explicitly specify some <code>MiddlePoint</code> if you know that if will yield better hierarchical division of your scene.
<p>When <a class="normal" href="CastleOctree.TOctreeNode.html#Box">Box</a> is empty, then value of <code>MiddlePoint</code> is undefined.</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="Box"></a><code>property <b>Box</b>: <a href="CastleBoxes.TBox3D.html">TBox3D</a> read fBox;</code></td>
</tr>
<tr><td colspan="2">
<p>
Axis-aligned box in the 3D space that contains all items within this node. It's allowed that some items are actually larger and go (partially) outside of this box too (so you don't have to split one triangle into many when it doesn't fit perfectly into octree node), but it's undefined if the parts that go outside will be detected by collision routines of this node.
<p>Special case: when this is empty, then <a class="normal" href="CastleOctree.TOctreeNode.html#MiddlePoint">MiddlePoint</a> has undefined value and <a class="normal" href="CastleOctree.TOctreeNode.html#IsLeaf">IsLeaf</a> must be true.</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="BoundingSphereCenter"></a><code>property <b>BoundingSphereCenter</b>: <a href="CastleVectors.html#TVector3Single">TVector3Single</a> read FBoundingSphereCenter;</code></td>
</tr>
<tr><td colspan="2">
<p>
Bounding sphere of this box. Right now simply calculated as the smallest possible sphere enclosing Box. So they are only a bad approximation of bounding Box, but they can be sometimes useful in stuations when detecting collision versus bounding sphere is much faster than detecting them versus bounding box.
<p><a class="normal" href="CastleOctree.TOctreeNode.html#BoundingSphereRadiusSqr">BoundingSphereRadiusSqr</a> = 0 and <code>BoundingSphereCenter</code> is undefined if Box is empty.</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="BoundingSphereRadiusSqr"></a><code>property <b>BoundingSphereRadiusSqr</b>: Single read FBoundingSphereRadiusSqr;</code></td>
</tr>
<tr><td colspan="2">
</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="Depth"></a><code>property <b>Depth</b>: integer read fDepth;</code></td>
</tr>
<tr><td colspan="2">
</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&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:10</em>
</span>
</td></tr></table></body></html>
|