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

brakingWeight

brakingWeight属性是ObstacleAvoidanceBehavior中的一个配置参数,用于控制避障行为中制动的力度。

语法

obstacleAvoidanceBehavior.brakingWeight = value;

参数

  • value - 一个数值类型,表示制动力度的大小。默认值为1。

描述

ObstacleAvoidanceBehavior是一种基于力的行为,用于模拟避免碰撞障碍物的行为。在避免障碍物的过程中,机器人需要在一定范围内检测周围的障碍物,并适当地制动以避免碰撞。brakingWeight属性用于控制制动力度的大小,值越大则制动力度越大,机器人避障的速度越慢。

示例

// 定义一个避障行为
var obstacleAvoidanceBehavior = new Yuka.ObstacleAvoidanceBehavior();

// 设置`brakingWeight`
obstacleAvoidanceBehavior.brakingWeight = 0.5;

// 启用避障行为
robot.steering.add(obstacleAvoidanceBehavior);

在上述代码中,机器人启用了避障行为,并且将brakingWeight属性设置为0.5,表示在避障的过程中需要适当减速。