33 #ifndef RVO_RVO_SIMULATOR_H_ 34 #define RVO_RVO_SIMULATOR_H_ 54 const size_t
RVO_ERROR = std::numeric_limits<size_t>::max();
129 RVOSimulator(
float timeStep,
float neighborDist, size_t maxNeighbors,
130 float timeHorizon,
float timeHorizonObst,
float radius,
190 size_t maxNeighbors,
float timeHorizon,
191 float timeHorizonObst,
float radius,
float maxSpeed,
439 float radius = 0.0f)
const;
481 float timeHorizon,
float timeHorizonObst,
482 float radius,
float maxSpeed,
579 std::vector<Agent *> agents_;
580 Agent *defaultAgent_;
583 std::vector<Obstacle *> obstacles_;
size_t getNextObstacleVertexNo(size_t vertexNo) const
Returns the number of the obstacle vertex succeeding the specified obstacle vertex in its polygon...
void setAgentMaxNeighbors(size_t agentNo, size_t maxNeighbors)
Sets the maximum neighbor count of a specified agent.
void setAgentPrefVelocity(size_t agentNo, const Vector2 &prefVelocity)
Sets the two-dimensional preferred velocity of a specified agent.
Defines a two-dimensional vector.
Definition: Vector2.h:48
size_t getPrevObstacleVertexNo(size_t vertexNo) const
Returns the number of the obstacle vertex preceding the specified obstacle vertex in its polygon...
size_t getAgentMaxNeighbors(size_t agentNo) const
Returns the maximum neighbor count of a specified agent.
size_t getAgentNumObstacleNeighbors(size_t agentNo) const
Returns the count of obstacle neighbors taken into account to compute the current velocity for the sp...
size_t getAgentObstacleNeighbor(size_t agentNo, size_t neighborNo) const
Returns the specified obstacle neighbor of the specified agent.
size_t addAgent(const Vector2 &position, float neighborDist, size_t maxNeighbors, float timeHorizon, float timeHorizonObst, float radius, float maxSpeed, const Vector2 &velocity=Vector2())
Adds a new agent to the simulation.
float getAgentNeighborDist(size_t agentNo) const
Returns the maximum neighbor distance of a specified agent.
const Vector2 & getObstacleVertex(size_t vertexNo) const
Returns the two-dimensional position of a specified obstacle vertex.
const Line & getAgentORCALine(size_t agentNo, size_t lineNo) const
Returns the specified ORCA constraint of the specified agent.
void setAgentPosition(size_t agentNo, const Vector2 &position)
Sets the two-dimensional position of a specified agent.
void setAgentTimeHorizonObst(size_t agentNo, float timeHorizonObst)
Sets the time horizon of a specified agent with respect to obstacles.
float getTimeStep() const
Returns the time step of the simulation.
void setTimeStep(float timeStep)
Sets the time step of the simulation.
const Vector2 & getAgentPosition(size_t agentNo) const
Returns the two-dimensional position of a specified agent.
~RVOSimulator()
Destroys this simulator instance.
float getAgentRadius(size_t agentNo) const
Returns the radius of a specified agent.
bool queryVisibility(const Vector2 &point1, const Vector2 &point2, float radius=0.0f) const
Performs a visibility query between the two specified points with respect to the obstacles.
float getGlobalTime() const
Returns the global time of the simulation.
float getAgentTimeHorizon(size_t agentNo) const
Returns the time horizon of a specified agent.
const size_t RVO_ERROR
Error value.
Definition: RVOSimulator.h:54
size_t addAgent(const Vector2 &position)
Adds a new agent with default properties to the simulation.
void processObstacles()
Processes the obstacles that have been added so that they are accounted for in the simulation...
Vector2()
Constructs and initializes a two-dimensional vector instance to (0.0, 0.0).
Definition: Vector2.h:54
void setAgentRadius(size_t agentNo, float radius)
Sets the radius of a specified agent.
size_t getNumObstacleVertices() const
Returns the count of obstacle vertices in the simulation.
RVOSimulator()
Constructs a simulator instance.
void setAgentTimeHorizon(size_t agentNo, float timeHorizon)
Sets the time horizon of a specified agent with respect to other agents.
size_t getAgentNumORCALines(size_t agentNo) const
Returns the count of ORCA constraints used to compute the current velocity for the specified agent...
void setAgentVelocity(size_t agentNo, const Vector2 &velocity)
Sets the two-dimensional linear velocity of a specified agent.
float getAgentMaxSpeed(size_t agentNo) const
Returns the maximum speed of a specified agent.
void setAgentDefaults(float neighborDist, size_t maxNeighbors, float timeHorizon, float timeHorizonObst, float radius, float maxSpeed, const Vector2 &velocity=Vector2())
Sets the default properties for any new agent that is added.
void setAgentNeighborDist(size_t agentNo, float neighborDist)
Sets the maximum neighbor distance of a specified agent.
size_t getAgentNumAgentNeighbors(size_t agentNo) const
Returns the count of agent neighbors taken into account to compute the current velocity for the speci...
Vector2 point
A point on the directed line.
Definition: RVOSimulator.h:64
Defines a directed line.
Definition: RVOSimulator.h:59
Defines the simulation.
Definition: RVOSimulator.h:81
const Vector2 & getAgentPrefVelocity(size_t agentNo) const
Returns the two-dimensional preferred velocity of a specified agent.
const Vector2 & getAgentVelocity(size_t agentNo) const
Returns the two-dimensional linear velocity of a specified agent.
size_t getAgentAgentNeighbor(size_t agentNo, size_t neighborNo) const
Returns the specified agent neighbor of the specified agent.
size_t addObstacle(const std::vector< Vector2 > &vertices)
Adds a new obstacle to the simulation.
void doStep()
Lets the simulator perform a simulation step and updates the two-dimensional position and two-dimensi...
void setAgentMaxSpeed(size_t agentNo, float maxSpeed)
Sets the maximum speed of a specified agent.
RVOSimulator(float timeStep, float neighborDist, size_t maxNeighbors, float timeHorizon, float timeHorizonObst, float radius, float maxSpeed, const Vector2 &velocity=Vector2())
Constructs a simulator instance and sets the default properties for any new agent that is added...
size_t getNumAgents() const
Returns the count of agents in the simulation.
Vector2 direction
The direction of the directed line.
Definition: RVOSimulator.h:69
friend class Obstacle
Definition: RVOSimulator.h:588
float getAgentTimeHorizonObst(size_t agentNo) const
Returns the time horizon with respect to obstacles of a specified agent.