载入中...
搜索中...
未找到
Steering.h
浏览该文件的文档.
1#pragma once
2
3#include "common/Export.h"
4
5#include <span>
6
7namespace eve::math::steering {
8
18 float x = 0.f;
19 float y = 0.f;
20};
21
24 float x = 0.f;
25 float y = 0.f;
26 float z = 0.f;
27};
28
33
38
40EVENGINE_API_FOUNDATION Vector2 arrive(Vector2 position, Vector2 target, float maxSpeed, float slowRadius,
41 float stopRadius);
43EVENGINE_API_FOUNDATION Vector3 arrive(Vector3 position, Vector3 target, float maxSpeed, float slowRadius,
44 float stopRadius);
45
51EVENGINE_API_FOUNDATION Vector2 separation(Vector2 position, std::span<const Vector2> neighbors, float radius,
52 float maxAcceleration);
58EVENGINE_API_FOUNDATION Vector3 separation(Vector3 position, std::span<const Vector3> neighbors, float radius,
59 float maxAcceleration);
60
66EVENGINE_API_FOUNDATION int pathTarget(Vector2 position, std::span<const Vector2> points, int current, float tolerance);
72EVENGINE_API_FOUNDATION int pathTarget(Vector3 position, std::span<const Vector3> points, int current, float tolerance);
73
75EVENGINE_API_FOUNDATION Vector2 avoid(Vector2 position, Vector2 velocity, Vector2 obstacle, float obstacleRadius,
76 float lookAhead, float maxAcceleration);
78EVENGINE_API_FOUNDATION Vector3 avoid(Vector3 position, Vector3 velocity, Vector3 obstacle, float obstacleRadius,
79 float lookAhead, float maxAcceleration);
80
81} // namespace eve::math::steering
LogicalId target
float y
Definition AnimClip.cpp:738
float x
Definition AnimClip.cpp:738
float z
Definition AnimClip.cpp:738
#define EVENGINE_API_FOUNDATION_INLINE
仅供"只有内联成员"的类型使用的组宏:拥有者 dllexport,消费方不导入。
Definition Export.h:170
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
Definition Export.h:106
std::array< float, 3 > position
float radius
std::shared_ptr< const std::vector< glm::vec2 > > points
double current
float separation
Definition TreeMesh.cpp:159
Vector2 arrive(Vector2 position, Vector2 target, float maxSpeed, float slowRadius, float stopRadius)
Slows toward target inside slowRadius and stops inside stopRadius.
Definition Steering.cpp:161
Vector2 seek(Vector2 position, Vector2 target, float maxSpeed)
Returns a velocity of at most maxSpeed directed from position to target.
Definition Steering.cpp:149
Vector2 avoid(Vector2 position, Vector2 velocity, Vector2 obstacle, float obstacleRadius, float lookAhead, float maxAcceleration)
Computes avoidance acceleration away from a predicted obstacle overlap.
Definition Steering.cpp:185
Vector2 flee(Vector2 position, Vector2 target, float maxSpeed)
Returns a velocity of at most maxSpeed directed away from target.
Definition Steering.cpp:155
int pathTarget(Vector2 position, std::span< const Vector2 > points, int current, float tolerance)
Selects the current path point, advancing across points within tolerance.
Definition Steering.cpp:177
Stateless steering vector algorithms shared by 2D and 3D callers.
Definition Steering.h:17
Plain 3D value used by the stateless steering calculations.
Definition Steering.h:23