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

aabb

aabb(英文全称:Axis-Aligned Bounding Box)是一个三维空间中的立方体,它的六个面都与X,Y,Z轴平行。aabb常常用于快速碰撞检测、物体选择以及物体剔除等计算。在Yuka js库的MeshGeometry中,aabb的计算方法如下:

方法

updateAABB

updateAABB(): void

此方法用于更新当前MeshGeometry对象的aabb。

getAABB

getAABB(): Box3

此方法用于获取当前MeshGeometry对象的aabb。

属性

aabb

aabb: Box3

此属性表示当前MeshGeometry对象的aabb。

示例

import { MeshGeometry } from 'yuka';

const meshGeometry = new MeshGeometry();
meshGeometry.updateVertices( [
    -1, -1,  1,
    1, -1,  1,
    1,  1,  1,
    -1,  1,  1
] );
meshGeometry.updateIndices( [
    0, 1, 2,
    2, 3, 0
] );

meshGeometry.updateAABB();
console.log( meshGeometry.getAABB() ); 

结论

aabb是一个三维空间中的立方体,常常用于快速碰撞检测、物体选择以及物体剔除等计算中。在Yuka js库的MeshGeometry中,aabb可以使用updateAABB方法进行更新,或者使用getAABB方法获取当前MeshGeometry对象的aabb。在进行场景渲染时,可以使用aabb进行剔除提高渲染效率。