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

Region

简介

Region 是 Yukajs Trigger 中常用的概念之一,表示区域。在Trigger中,我们可以将一个区域定义为一个立体体积,当其他物体进入这个区域时会触发相应的事件。

属性

center

  • 类型:Vector3
  • 说明:表示该区域的中心点坐标。

halfExtent

  • 类型:Vector3
  • 说明:表示该区域在三个轴方向各自半长的长度。

type

  • 类型:String
  • 说明:表示该区域的类型,例如“盒型”或“球型”等。

方法

containsPoint(point)

  • 参数:
    • point:Vector3
  • 返回值:Boolean
  • 说明:判断一个点是否在该区域内。

intersectsBox(box)

  • 参数:
    • box:Box3
  • 返回值:Boolean
  • 说明:判断该区域是否与一个盒子相交。

intersectsSphere(sphere)

  • 参数:
    • sphere:Sphere
  • 返回值:Boolean
  • 说明:判断该区域是否与一个球体相交。