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

boundingRadius属性是 GameEntity 类中用于定义实体的边界半径的属性。

描述

boundingRadius 属性是一个数字类型的值,表示实体在3D空间中的半径。该属性用于用于优化场景中物体的渲染,也可用于检测实体间的碰撞。

当实体的形状为球体时,通常将 boundingRadius 属性设置为球体的半径。然而,当实体的形状不规则时,计算 boundingRadius属性可能会更加复杂。

用法

const entity = new GameEntity();
entity.boundingRadius = 10;

注意事项

  • boundingRadius 属性仅对3D实体有效,对于2D实体该属性值为0。
  • boundingRadius 属性值越小,实体的渲染速度以及碰撞检测的精度会越高。
  • 当实体在3D空间中的形状不规则时,可以通过算法或手动测量来计算 boundingRadius 的值。