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

remove

remove()是Yuka js库的Vehicle类的一个方法。该方法从世界中移除当前的交通工具(vehicle)。

语法

vehicle.remove();

返回值

无返回值。

使用说明

在使用该方法之前,需要先创建交通工具实例并添加到世界中。

const vehicle = new Vehicle();
world.add(vehicle);

然后,在需要移除交通工具时,调用remove()方法即可将其从世界中移除。

vehicle.remove();

示例

以下示例展示了如何使用remove()方法将交通工具从世界中移除:

const world = new World();
const vehicle = new Vehicle();
world.add(vehicle);

// 等待一段时间

vehicle.remove();

此示例中,worldvehicle均为Yuka js库中的类。首先,创建了世界实例并添加了一个交通工具实例。然后,等待了一段时间后,使用remove()方法将交通工具从世界中移除。