Castle Game Engine: X3DTriangles: Class TBaseTrianglesOctreeNode

# Class TBaseTrianglesOctreeNode
Description | Hierarchy | Fields | Methods | Properties
## 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 TObject TOctreeNode TBaseTrianglesOctreeNode ## Overview ### Methods
| `function CommonSphere(const pos: TVector3Single; const Radius: Single; const TriangleToIgnore: PTriangle; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): PTriangle;`
| `function CommonSphereLeaf(const pos: TVector3Single; const Radius: Single; const TriangleToIgnore: PTriangle; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): PTriangle; virtual; abstract;`
| `function CommonBox(const ABox: TBox3D; const TriangleToIgnore: PTriangle; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): PTriangle;`
| `function CommonBoxLeaf(const ABox: TBox3D; const TriangleToIgnore: PTriangle; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): PTriangle; virtual; abstract;`
| `function CommonSegment( out Intersection: TVector3Single; out IntersectionDistance: Single; const pos1, pos2: TVector3Single; const Tag: TMailboxTag; const ReturnClosestIntersection: boolean; const TriangleToIgnore: PTriangle; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): PTriangle;`
| `function CommonSegmentLeaf( out Intersection: TVector3Single; out IntersectionDistance: Single; const pos1, pos2: TVector3Single; const Tag: TMailboxTag; const ReturnClosestIntersection: boolean; const TriangleToIgnore: PTriangle; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): PTriangle; virtual; abstract;`
| `function CommonRay( out Intersection: TVector3Single; out IntersectionDistance: Single; const RayOrigin, RayDirection: TVector3Single; const Tag: TMailboxTag; const ReturnClosestIntersection: boolean; const TriangleToIgnore: PTriangle; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): PTriangle;`
| `function CommonRayLeaf( out Intersection: TVector3Single; out IntersectionDistance: Single; const RayOrigin, RayDirection: TVector3Single; const Tag: TMailboxTag; const ReturnClosestIntersection: boolean; const TriangleToIgnore: PTriangle; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): PTriangle; virtual; abstract;`
| `function SphereCollision(const pos: TVector3Single; const Radius: Single; const TriangleToIgnore: PTriangle; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): PTriangle; virtual; abstract;`
| `function IsSphereCollision(const pos: TVector3Single; const Radius: Single; const TriangleToIgnore: PTriangle; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): boolean; virtual; abstract;`
| `function BoxCollision(const ABox: TBox3D; const TriangleToIgnore: PTriangle; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): PTriangle; virtual; abstract;`
| `function IsBoxCollision(const ABox: TBox3D; const TriangleToIgnore: PTriangle; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): boolean; virtual; abstract;`
| `function SegmentCollision( out Intersection: TVector3Single; out IntersectionDistance: Single; const pos1, pos2: TVector3Single; const Tag: TMailboxTag; const ReturnClosestIntersection: boolean; const TriangleToIgnore: PTriangle; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): PTriangle; virtual; abstract;`
| `function IsSegmentCollision( const pos1, pos2: TVector3Single; const Tag: TMailboxTag; const TriangleToIgnore: PTriangle; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): boolean; virtual; abstract;`
| `function RayCollision( out Intersection: TVector3Single; out IntersectionDistance: Single; const RayOrigin, RayDirection: TVector3Single; const Tag: TMailboxTag; const ReturnClosestIntersection: boolean; const TriangleToIgnore: PTriangle; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): PTriangle; virtual; abstract;`
| `function IsRayCollision( const RayOrigin, RayDirection: TVector3Single; const Tag: TMailboxTag; const TriangleToIgnore: PTriangle; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): boolean; virtual; abstract;`
## 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 CommonSphereLeaf(const pos: TVector3Single; const Radius: Single; const TriangleToIgnore: PTriangle; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): PTriangle; virtual; abstract;`
| `function CommonBox(const ABox: TBox3D; const TriangleToIgnore: PTriangle; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): PTriangle;`
| `function CommonBoxLeaf(const ABox: TBox3D; const TriangleToIgnore: PTriangle; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): PTriangle; virtual; abstract;`
| `function CommonSegment( out Intersection: TVector3Single; out IntersectionDistance: Single; const pos1, pos2: TVector3Single; const Tag: TMailboxTag; const ReturnClosestIntersection: boolean; const TriangleToIgnore: PTriangle; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): PTriangle;`
| `function CommonSegmentLeaf( out Intersection: TVector3Single; out IntersectionDistance: Single; const pos1, pos2: TVector3Single; const Tag: TMailboxTag; const ReturnClosestIntersection: boolean; const TriangleToIgnore: PTriangle; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): PTriangle; virtual; abstract;`
| `function CommonRay( out Intersection: TVector3Single; out IntersectionDistance: Single; const RayOrigin, RayDirection: TVector3Single; const Tag: TMailboxTag; const ReturnClosestIntersection: boolean; const TriangleToIgnore: PTriangle; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): PTriangle;`
| `function CommonRayLeaf( out Intersection: TVector3Single; out IntersectionDistance: Single; const RayOrigin, RayDirection: TVector3Single; const Tag: TMailboxTag; const ReturnClosestIntersection: boolean; const TriangleToIgnore: PTriangle; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): PTriangle; virtual; abstract;`
| `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.
| `function IsSphereCollision(const pos: TVector3Single; const Radius: Single; const TriangleToIgnore: PTriangle; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): boolean; virtual; abstract;`
| `function BoxCollision(const ABox: TBox3D; const TriangleToIgnore: PTriangle; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): PTriangle; virtual; abstract;`
| `function IsBoxCollision(const ABox: TBox3D; const TriangleToIgnore: PTriangle; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): boolean; virtual; abstract;`
| `function SegmentCollision( out Intersection: TVector3Single; out IntersectionDistance: Single; const pos1, pos2: TVector3Single; const Tag: TMailboxTag; const ReturnClosestIntersection: boolean; const TriangleToIgnore: PTriangle; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): PTriangle; virtual; abstract;`
| `function IsSegmentCollision( const pos1, pos2: TVector3Single; const Tag: TMailboxTag; const TriangleToIgnore: PTriangle; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): boolean; virtual; abstract;`
| `function RayCollision( out Intersection: TVector3Single; out IntersectionDistance: Single; const RayOrigin, RayDirection: TVector3Single; const Tag: TMailboxTag; const ReturnClosestIntersection: boolean; const TriangleToIgnore: PTriangle; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): PTriangle; virtual; abstract;`
| `function IsRayCollision( const RayOrigin, RayDirection: TVector3Single; const Tag: TMailboxTag; const TriangleToIgnore: PTriangle; const IgnoreMarginAtStart: boolean; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): boolean; virtual; abstract;`
Generated by PasDoc 0.13.0 on 2015-06-15 04:43:18