Package | flare.physics.geom |
Class | public class BVH |
Inheritance | BVH ![]() |
Property | Defined By | ||
---|---|---|---|
maxDepth : int = 8 [static]
The maximun number of depth nodes allowed. | BVH | ||
maxX : Number
The maximum position along the Z-Axis in local space. | BVH | ||
maxY : Number
The maximum position along the Z-Axis in local space. | BVH | ||
maxZ : Number
The maximum position along the Z-Axis in local space. | BVH | ||
minX : Number
The minimum position along the X-Axis in local space. | BVH | ||
minY : Number
The minimum position along the Y-Axis in local space. | BVH | ||
minZ : Number
The minimum position along the Z-Axis in local space. | BVH | ||
node0 : BVH
The first leaf of this BVH node. | BVH | ||
node1 : BVH
The second leaf of this BVH node. | BVH | ||
parent : BVH
The parent BVH tree node. | BVH | ||
tris : Vector.<Triangle>
The triangle list contained in this node. | BVH |
Method | Defined By | ||
---|---|---|---|
Creates a new BVH node. | BVH | ||
build(depth:int = 0):void
Builds this node and slits into new nodes recursively if necessary. | BVH | ||
intersectRay(from:Vector3D, direction:Vector3D, out:Vector.<BVH>, count:int = 0, sort:Boolean = true):int
Test a ray againts the BVH. | BVH | ||
intersectSphere(from:Vector3D, radius:Number, out:Vector.<BVH>, count:int = 0):int
Thest a sphere volume against the BVH tree. | BVH | ||
trim():void
Recalculates the local space bounds for all the tree nodes. | BVH |
maxDepth | property |
public static var maxDepth:int = 8
The maximun number of depth nodes allowed.
maxX | property |
public var maxX:Number
The maximum position along the Z-Axis in local space.
maxY | property |
public var maxY:Number
The maximum position along the Z-Axis in local space.
maxZ | property |
public var maxZ:Number
The maximum position along the Z-Axis in local space.
minX | property |
public var minX:Number
The minimum position along the X-Axis in local space.
minY | property |
public var minY:Number
The minimum position along the Y-Axis in local space.
minZ | property |
public var minZ:Number
The minimum position along the Z-Axis in local space.
node0 | property |
public var node0:BVH
The first leaf of this BVH node.
node1 | property |
public var node1:BVH
The second leaf of this BVH node.
parent | property |
public var parent:BVH
The parent BVH tree node.
tris | property |
public var tris:Vector.<Triangle>
The triangle list contained in this node.
BVH | () | Constructor |
public function BVH(parent:BVH = null)
Creates a new BVH node.
Parametersparent:BVH (default = null ) — The parent node or null if it is the root node.
|
build | () | method |
public function build(depth:int = 0):void
Builds this node and slits into new nodes recursively if necessary.
Parameters
depth:int (default = 0 ) — The current node depth.
|
intersectRay | () | method |
public function intersectRay(from:Vector3D, direction:Vector3D, out:Vector.<BVH>, count:int = 0, sort:Boolean = true):int
Test a ray againts the BVH.
Parameters
from:Vector3D — The source position of the ray.
| |
direction:Vector3D — The normalized direction of the ray.
| |
out:Vector.<BVH> — The output list of BVH nodes.
| |
count:int (default = 0 ) — The first index on the output list from where to start adding the resulted nodes.
| |
sort:Boolean (default = true ) — Sort the result along the ray direction.
|
int — The current index of the output BVH vector.
|
intersectSphere | () | method |
public function intersectSphere(from:Vector3D, radius:Number, out:Vector.<BVH>, count:int = 0):int
Thest a sphere volume against the BVH tree.
Parameters
from:Vector3D — The source position of the sphere.
| |
radius:Number — The radius of the sphere to test.
| |
out:Vector.<BVH> — The output list of BVH nodes.
| |
count:int (default = 0 ) — The first index on the output list from where to start adding the resulted nodes.
|
int — The current index of the output BVH vector.
|
trim | () | method |
public function trim():void
Recalculates the local space bounds for all the tree nodes.