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

功能描述

fromAABB是Yuka js库中的ConvexHull类的一个静态方法,用于生成在Axis-Aligned Bounding Box(轴对齐包围盒)上的凸包。

语法

ConvexHull.fromAABB( aabb )
  • 参数

    • aabb : AABB类型,Axis-Aligned Bounding Box(轴对齐包围盒)。
  • 返回值: ConvexHull类型,凸包。

示例

import { ConvexHull, AABB } from 'yuka'

const aabb = new AABB()
aabb.setFromCenterAndSize( new Vector3( 0, 0, 0 ), new Vector3( 2, 2, 2 ) )

const convexHull = ConvexHull.fromAABB( aabb ) // 以轴对齐包围盒生成凸包

注意事项

fromAABB方法只适用于轴对齐包围盒的凸包生成,如果需要在其他情况下生成凸包,可以使用ConvexHull类的其他方法。