AABB
AlignmentBehavior
ArriveBehavior
AStar
BFS
BoundingSphere
BVH
BVHNode
Cell
CellSpacePartitioning
CohesionBehavior
CompositeGoal
ConvexHull
Corridor
CostTable
DFS
Dijkstra
Edge
EntityManager
EvadeBehavior
EventDispatcher
Behavior
FollowPathBehavior
FuzzyAND
FuzzyCompositeTerm
FuzzyFAIRLY
FuzzyModule
FuzzyOR
FuzzyRule
FuzzySet
FuzzyTerm
FuzzyVariable
FuzzyVERY
GameEntity
Goal
GoalEvaluator
Graph
GraphUtils
HalfEdge
HeuristicPolicyDijkstra
HeuristicPolicyEuclid
HeuristicPolicyEuclidSquared
HeuristicPolicyManhattan
InterposeBehavior
LeftSCurveFuzzySet
LeftShoulderFuzzySet
LineSegment
Logger
MathUtils
Matrix3
Matrix4
MemoryRecord
MemorySystem
MeshGeometry
MessageDispatcher
MovingEntity
NavEdge
NavMesh
NavMeshLoader
NavNode
Node
NormalDistFuzzySet
OBB
ObstacleAvoidanceBehavior
OffsetPursuitBehavior
OnPathBehavior
Path
Plane
Polygon
Polyhedron
PriorityQueue
PursuitBehavior
Quaternion
Ray
RectangleTriggerRegion
Regular
RightSCurveFuzzySet
RightShoulderFuzzySet
SAT
SeekBehavior
SeparationBehavior
SingletonFuzzySet
Smoother
SphericalTriggerRegion
State
StateMachine
SteeringBehavior
SteeringManager
Task
TaskQueue
Telegram
Think
Time
TriangularFuzzySet
Trigger
TriggerRegion
Vector3
Vehicle
Version
WanderBehavior

children

BVHNode是一个tree结构,每个节点都有两个子节点,分别是左子节点和右子节点。这些子节点可以通过children数组访问。children数组包含两个元素,一个是BVHNode类型的左子节点,另一个是BVHNode类型的右子节点。这些子节点负责BVHNode的空间划分,以及对包含于其中的物体进行排序和管理。

语法

BVHNode.children

返回值

返回一个数组,包含两个元素,分别是BVHNode类型的左子节点和右子节点。

示例

// 创建一个BVHNode节点,并添加子节点
const node = new BVHNode();
const leftChild = new BVHNode();
const rightChild = new BVHNode();
node.children = [leftChild, rightChild];

注意事项

  1. children数组是有序的,第一个元素是左子节点,第二个元素是右子节点。
  2. 可以通过直接修改children来改变BVHNode节点的子节点。
  3. 对于底层BVHNode,children数组可能是空的,因为它们本身就不需要进一步划分。