/*1* Agent.h2* RVO2-3D Library3*4* Copyright 2008 University of North Carolina at Chapel Hill5*6* Licensed under the Apache License, Version 2.0 (the "License");7* you may not use this file except in compliance with the License.8* You may obtain a copy of the License at9*10* http://www.apache.org/licenses/LICENSE-2.011*12* Unless required by applicable law or agreed to in writing, software13* distributed under the License is distributed on an "AS IS" BASIS,14* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.15* See the License for the specific language governing permissions and16* limitations under the License.17*18* Please send all bug reports to <[email protected]>.19*20* The authors may be contacted via:21*22* Jur van den Berg, Stephen J. Guy, Jamie Snape, Ming C. Lin, Dinesh Manocha23* Dept. of Computer Science24* 201 S. Columbia St.25* Frederick P. Brooks, Jr. Computer Science Bldg.26* Chapel Hill, N.C. 27599-317527* United States of America28*29* <http://gamma.cs.unc.edu/RVO2/>30*/3132/**33* \file Agent.h34* \brief Contains the Agent class.35*/36#ifndef RVO3D_AGENT_H_37#define RVO3D_AGENT_H_3839#include <cstddef>40#include <cstdint>41#include <utility>42#include <vector>4344#include "RVOSimulator3d.h"45#include "Vector3.h"4647namespace RVO3D {48/**49* \brief Defines an agent in the simulation.50*/51class Agent3D {52public:53/**54* \brief Constructs an agent instance.55* \param sim The simulator instance.56*/57explicit Agent3D();5859/**60* \brief Computes the neighbors of this agent.61*/62void computeNeighbors(RVOSimulator3D *sim_);6364/**65* \brief Computes the new velocity of this agent.66*/67void computeNewVelocity(RVOSimulator3D *sim_);6869/**70* \brief Inserts an agent neighbor into the set of neighbors of this agent.71* \param agent A pointer to the agent to be inserted.72* \param rangeSq The squared range around this agent.73*/74void insertAgentNeighbor(const Agent3D *agent, float &rangeSq);7576/**77* \brief Updates the three-dimensional position and three-dimensional velocity of this agent.78*/79void update(RVOSimulator3D *sim_);8081Vector3 newVelocity_;82Vector3 position_;83Vector3 prefVelocity_;84Vector3 velocity_;85RVOSimulator3D *sim_;86size_t id_;87size_t maxNeighbors_;88float maxSpeed_;89float neighborDist_;90float radius_;91float timeHorizon_;92float timeHorizonObst_;93std::vector<std::pair<float, const Agent3D *> > agentNeighbors_;94std::vector<Plane> orcaPlanes_;95float height_ = 1.0;96uint32_t avoidance_layers_ = 1;97uint32_t avoidance_mask_ = 1;98float avoidance_priority_ = 1.0;99100friend class KdTree3D;101friend class RVOSimulator3D;102};103}104105#endif /* RVO3D_AGENT_H_ */106107108