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

resolveReferences

resolveReferences()是Yuka.js的SteeringManager类的方法之一,其作用是将每个代理的参考点(target)转换为世界空间中的位置,并将其存储在SteeringAgent类的属性target中。

语法

SteeringManager.resolveReferences( agents )

参数

  • agents:类型为Array的参数。代理列表。

返回值

该函数没有返回值。

示例

const steeringManager = new YUKA.SteeringManager();
const steeringAgent = new YUKA.SteeringAgent( new YUKA.Vector3( 1, 0, 1 ) );
steeringManager.add( steeringAgent );

// Set the target of the proxy.
steeringAgent.setTarget( new YUKA.Vector3( 3, 0, 3 ) );

// Resolve references to calculate world space position.
steeringManager.resolveReferences( [ steeringAgent ] );

说明

resolveReferences绑定了每个代理的参考点(target)并将其转换为在世界空间中的位置,并将结果储存在代理的属性target中。

该函数用于帮助SteeringAgent类的实例在空间中移动,计算其目标机器人和其他位置相关的力和转弯信息。

异常

该函数不会抛出任何异常。

参考

  • SteeringManager
  • SteeringAgent