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

fromAABB

该方法使用给定的AABB (Axis Aligned Bounding Box) 创建一个具有六个面的多面体。

语法

Polyhedron.fromAABB(aabb)

参数

  • aabb:表示一个AABB (Axis Aligned Bounding Box) 的对象,其中包含了最小点和最大点的坐标值。

返回值

返回的是一个多面体对象。

示例

var aabb = { min: { x: -1, y: -1, z: -1 }, max: { x: 1, y: 1, z: 1 } };
var polyhedron = Polyhedron.fromAABB(aabb);

以上示例将创建一个从 (-1,-1,-1) 到 (1,1,1) 的AABB,并使用该AABB创建一个多面体。

备注

多面体是一种几何图形,它由平面多边形组成,符合欧拉公式V - E + F = 2。多面体的面可以是多边形、三角形、四边形等等,每个面都沿着它们的边缘邻接到其他面,这样就构成了一个几何体。

参考资料