Castle Game EngineIntroduction Units Class Hierarchy Classes, Interfaces, Objects and Records Types Variables Constants Functions and Procedures Identifiers |
Class TBaseTrianglesOctreeNode
Unit
X3DTriangles
Declaration
type TBaseTrianglesOctreeNode = class(TOctreeNode)
Description
no description available, TOctreeNode description follows
Octree node.
Leaf nodes store a list of indexes in ItemsIndices array. These are usuallly indexes to some array of items on TOctree. 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 TOctreeNode class doesn't clarify what kind of items are actually kept.
Not leaf (internal) nodes have 8 children nodes in TreeSubNodes.
Each TOctreeNode also has some essential properties like Box, MiddlePoint and ParentTree.
Hierarchy
Overview
Methods
Description
Methods
 |
function CommonSphere(const pos: TVector3Single; const Radius: Single; const TriangleToIgnore: PTriangle; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): PTriangle; |
These realize the common implementation of SphereCollision: traversing down the octree nodes. They take care of traversing down the non-leaf nodes, you only have to override the CommonXxxLeaf versions where you handle the leaves (and you have to call CommonXxx from normal Xxx routines).
|
 |
function SphereCollision(const pos: TVector3Single; const Radius: Single; const TriangleToIgnore: PTriangle; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): PTriangle; virtual; abstract; |
See TBaseTrianglesOctree for documentation of these routines.
Note that methods here do not try to limit detected intersections to their boxes. If you will insert a large triangle into a node, that is partially inside and partially outside of this node, the collision methods may find an intersection outside of this node.
This is not be a problem for a root node, since the root node has a box such that every triangle is completely inside. But it is important to remember when you implement recursive *Collision calls in nodes: if you want to query your subnodes in some particular order (for example to honour ReturnClosestIntersection = True ), then remember that one subnode may detect a collision that in fact happened in other subnode.
|
|