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

boundingRadius

在Yuka.js库的Trigger中,boundingRadius属性表示触发器的半径范围。该属性是一个非负数值,以单位长度为单位,表示触发器半径长度。

语法

trigger.boundingRadius

描述

触发器的boundingRadius属性用于计算与其他物体的碰撞。根据该属性定义的范围,当两个触发器的范围相互重叠时,被认为是发生了碰撞。该属性的值应该足够大,确保在使用场景中正确的检测到触发器之间的碰撞。

示例

const trigger = new YUKA.Trigger();
trigger.boundingRadius = 2;

注意事项

  • boundingRadius属性值不能为负数。如果设置了负数,将在运行时抛出异常。
  • boundingRadius的值较大时,将对性能产生影响。需要根据具体的使用情况,合理设置该属性的值。
  • boundingRadius属性的值和其他属性都应该根据具体的场景需求和实际数据进行调整和测试,以达到最优的性能和精度。