载入中...
搜索中...
未找到
eve::math::steering 命名空间参考

类

struct  Vector2
 Stateless steering vector algorithms shared by 2D and 3D callers. 更多...
 
struct  Vector3
 Plain 3D value used by the stateless steering calculations. 更多...
 

函数

Vector2 seek (Vector2 position, Vector2 target, float maxSpeed)
 Returns a velocity of at most maxSpeed directed from position to target.
 
Vector3 seek (Vector3 position, Vector3 target, float maxSpeed)
 Returns a velocity of at most maxSpeed directed from position to target.
 
Vector2 flee (Vector2 position, Vector2 target, float maxSpeed)
 Returns a velocity of at most maxSpeed directed away from target.
 
Vector3 flee (Vector3 position, Vector3 target, float maxSpeed)
 Returns a velocity of at most maxSpeed directed away from target.
 
Vector2 arrive (Vector2 position, Vector2 target, float maxSpeed, float slowRadius, float stopRadius)
 Slows toward target inside slowRadius and stops inside stopRadius.
 
Vector3 arrive (Vector3 position, Vector3 target, float maxSpeed, float slowRadius, float stopRadius)
 Slows toward target inside slowRadius and stops inside stopRadius.
 
Vector2 separation (Vector2 position, std::span< const Vector2 > neighbors, float radius, float maxAcceleration)
 Computes bounded separation acceleration from a borrowed neighbor snapshot.
 
Vector3 separation (Vector3 position, std::span< const Vector3 > neighbors, float radius, float maxAcceleration)
 Computes bounded separation acceleration from a borrowed neighbor snapshot.
 
int pathTarget (Vector2 position, std::span< const Vector2 > points, int current, float tolerance)
 Selects the current path point, advancing across points within tolerance.
 
int pathTarget (Vector3 position, std::span< const Vector3 > points, int current, float tolerance)
 Selects the current path point, advancing across points within tolerance.
 
Vector2 avoid (Vector2 position, Vector2 velocity, Vector2 obstacle, float obstacleRadius, float lookAhead, float maxAcceleration)
 Computes avoidance acceleration away from a predicted obstacle overlap.
 
Vector3 avoid (Vector3 position, Vector3 velocity, Vector3 obstacle, float obstacleRadius, float lookAhead, float maxAcceleration)
 Computes avoidance acceleration away from a predicted obstacle overlap.
 

函数说明

◆ arrive() [1/2]

EVENGINE_API_FOUNDATION Vector2 eve::math::steering::arrive ( Vector2  position,
Vector2  target,
float  maxSpeed,
float  slowRadius,
float  stopRadius 
)

Slows toward target inside slowRadius and stops inside stopRadius.

在文件 Steering.cpp 第 161 行定义.

引用了 position , 以及 target.

被这些函数引用 eve::math::Math::steeringArrive2() , 以及 eve::math::Math::steeringArrive3().

◆ arrive() [2/2]

EVENGINE_API_FOUNDATION Vector3 eve::math::steering::arrive ( Vector3  position,
Vector3  target,
float  maxSpeed,
float  slowRadius,
float  stopRadius 
)

Slows toward target inside slowRadius and stops inside stopRadius.

在文件 Steering.cpp 第 165 行定义.

引用了 position , 以及 target.

◆ avoid() [1/2]

EVENGINE_API_FOUNDATION Vector2 eve::math::steering::avoid ( Vector2  position,
Vector2  velocity,
Vector2  obstacle,
float  obstacleRadius,
float  lookAhead,
float  maxAcceleration 
)

Computes avoidance acceleration away from a predicted obstacle overlap.

在文件 Steering.cpp 第 185 行定义.

引用了 position.

被这些函数引用 eve::math::Math::steeringAvoid2() , 以及 eve::math::Math::steeringAvoid3().

◆ avoid() [2/2]

EVENGINE_API_FOUNDATION Vector3 eve::math::steering::avoid ( Vector3  position,
Vector3  velocity,
Vector3  obstacle,
float  obstacleRadius,
float  lookAhead,
float  maxAcceleration 
)

Computes avoidance acceleration away from a predicted obstacle overlap.

在文件 Steering.cpp 第 189 行定义.

引用了 position.

◆ flee() [1/2]

EVENGINE_API_FOUNDATION Vector2 eve::math::steering::flee ( Vector2  position,
Vector2  target,
float  maxSpeed 
)

Returns a velocity of at most maxSpeed directed away from target.

在文件 Steering.cpp 第 155 行定义.

引用了 position , 以及 target.

被这些函数引用 eve::math::Math::steeringFlee2() , 以及 eve::math::Math::steeringFlee3().

◆ flee() [2/2]

EVENGINE_API_FOUNDATION Vector3 eve::math::steering::flee ( Vector3  position,
Vector3  target,
float  maxSpeed 
)

Returns a velocity of at most maxSpeed directed away from target.

在文件 Steering.cpp 第 158 行定义.

引用了 position , 以及 target.

◆ pathTarget() [1/2]

EVENGINE_API_FOUNDATION int eve::math::steering::pathTarget ( Vector2  position,
std::span< const Vector2 >  points,
int  current,
float  tolerance 
)

Selects the current path point, advancing across points within tolerance.

返回
A valid point index, or -1 when points is empty or contains a non-finite point. @cost Linear in the number of points advanced during this call.

在文件 Steering.cpp 第 177 行定义.

引用了 current, points , 以及 position.

被这些函数引用 eve::math::Math::steeringPathTarget2() , 以及 eve::math::Math::steeringPathTarget3().

◆ pathTarget() [2/2]

EVENGINE_API_FOUNDATION int eve::math::steering::pathTarget ( Vector3  position,
std::span< const Vector3 >  points,
int  current,
float  tolerance 
)

Selects the current path point, advancing across points within tolerance.

返回
A valid point index, or -1 when points is empty or contains a non-finite point. @cost Linear in the number of points advanced during this call.

在文件 Steering.cpp 第 181 行定义.

引用了 current, points , 以及 position.

◆ seek() [1/2]

EVENGINE_API_FOUNDATION Vector2 eve::math::steering::seek ( Vector2  position,
Vector2  target,
float  maxSpeed 
)

Returns a velocity of at most maxSpeed directed from position to target.

在文件 Steering.cpp 第 149 行定义.

引用了 position , 以及 target.

被这些函数引用 eve::math::Math::steeringSeek2() , 以及 eve::math::Math::steeringSeek3().

◆ seek() [2/2]

EVENGINE_API_FOUNDATION Vector3 eve::math::steering::seek ( Vector3  position,
Vector3  target,
float  maxSpeed 
)

Returns a velocity of at most maxSpeed directed from position to target.

在文件 Steering.cpp 第 152 行定义.

引用了 position , 以及 target.

◆ separation() [1/2]

EVENGINE_API_FOUNDATION Vector2 eve::math::steering::separation ( Vector2  position,
std::span< const Vector2 >  neighbors,
float  radius,
float  maxAcceleration 
)

Computes bounded separation acceleration from a borrowed neighbor snapshot.

参数
neighborsBorrowed only for this call; the function retains no references. @cost Linear in the number of neighbors.

在文件 Steering.cpp 第 169 行定义.

引用了 position , 以及 radius.

被这些函数引用 eve::math::Math::steeringSeparation2() , 以及 eve::math::Math::steeringSeparation3().

◆ separation() [2/2]

EVENGINE_API_FOUNDATION Vector3 eve::math::steering::separation ( Vector3  position,
std::span< const Vector3 >  neighbors,
float  radius,
float  maxAcceleration 
)

Computes bounded separation acceleration from a borrowed neighbor snapshot.

参数
neighborsBorrowed only for this call; the function retains no references. @cost Linear in the number of neighbors.

在文件 Steering.cpp 第 173 行定义.

引用了 position , 以及 radius.