Skip to content

Commit aba6a0f

Browse files
Remove hight/elevation
1 parent b825065 commit aba6a0f

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

modules/navigation_2d/nav_agent_2d.cpp

+4-9
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,9 @@ void NavAgent2D::_update_rvo_agent_properties() {
4545
rvo_agent.radius_ = radius;
4646
rvo_agent.maxSpeed_ = max_speed;
4747
rvo_agent.position_ = RVO2D::Vector2(position.x, position.y);
48-
rvo_agent.elevation_ = 0.0; // TODO: Remove?
4948
// Replacing the internal velocity directly causes major jitter / bugs due to unpredictable velocity jumps, left line here for testing.
5049
//rvo_agent.velocity_ = RVO2D::Vector2(velocity.x, velocity.y);
5150
rvo_agent.prefVelocity_ = RVO2D::Vector2(velocity.x, velocity.y);
52-
rvo_agent.height_ = 1.0; // TODO: Remove?
5351
rvo_agent.avoidance_layers_ = avoidance_layers;
5452
rvo_agent.avoidance_mask_ = avoidance_mask;
5553
rvo_agent.avoidance_priority_ = avoidance_priority;
@@ -178,7 +176,6 @@ void NavAgent2D::set_max_speed(real_t p_max_speed) {
178176
void NavAgent2D::set_position(const Vector2 &p_position) {
179177
position = p_position;
180178
if (avoidance_enabled) {
181-
rvo_agent.elevation_ = 0.0; // TODO: Remove?
182179
rvo_agent.position_ = RVO2D::Vector2(p_position.x, p_position.y);
183180
}
184181
agent_dirty = true;
@@ -264,15 +261,13 @@ const Dictionary NavAgent2D::get_avoidance_data() const {
264261
_avoidance_data["max_neighbors"] = int(rvo_agent.maxNeighbors_);
265262
_avoidance_data["max_speed"] = float(rvo_agent.maxSpeed_);
266263
_avoidance_data["neighbor_distance"] = float(rvo_agent.neighborDist_);
267-
// TODO: Change type?
268-
_avoidance_data["new_velocity"] = Vector3(rvo_agent.newVelocity_.x(), 0.0, rvo_agent.newVelocity_.y());
269-
_avoidance_data["velocity"] = Vector3(rvo_agent.velocity_.x(), 0.0, rvo_agent.velocity_.y());
270-
_avoidance_data["position"] = Vector3(rvo_agent.position_.x(), 0.0, rvo_agent.position_.y());
271-
_avoidance_data["preferred_velocity"] = Vector3(rvo_agent.prefVelocity_.x(), 0.0, rvo_agent.prefVelocity_.y());
264+
_avoidance_data["new_velocity"] = Vector2(rvo_agent.newVelocity_.x(), rvo_agent.newVelocity_.y());
265+
_avoidance_data["velocity"] = Vector2(rvo_agent.velocity_.x(), rvo_agent.velocity_.y());
266+
_avoidance_data["position"] = Vector2(rvo_agent.position_.x(), rvo_agent.position_.y());
267+
_avoidance_data["preferred_velocity"] = Vector2(rvo_agent.prefVelocity_.x(), rvo_agent.prefVelocity_.y());
272268
_avoidance_data["radius"] = float(rvo_agent.radius_);
273269
_avoidance_data["time_horizon_agents"] = float(rvo_agent.timeHorizon_);
274270
_avoidance_data["time_horizon_obstacles"] = float(rvo_agent.timeHorizonObst_);
275-
_avoidance_data["height"] = float(rvo_agent.height_); // TODO: Remove?
276271
_avoidance_data["avoidance_layers"] = int(rvo_agent.avoidance_layers_);
277272
_avoidance_data["avoidance_mask"] = int(rvo_agent.avoidance_mask_);
278273
_avoidance_data["avoidance_priority"] = float(rvo_agent.avoidance_priority_);

modules/navigation_2d/nav_map_2d.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,6 @@ void NavMap2D::_update_rvo_obstacles_tree() {
486486
for (size_t i = 0; i < rvo_vertices.size(); i++) {
487487
RVO2D::Obstacle2D *rvo_obstacle = new RVO2D::Obstacle2D();
488488
rvo_obstacle->point_ = rvo_vertices[i];
489-
rvo_obstacle->height_ = 1.0; // TODO: Remove?
490-
rvo_obstacle->elevation_ = 0.0; // TODO: Remove?
491489

492490
rvo_obstacle->avoidance_layers_ = _obstacle_avoidance_layers;
493491

0 commit comments

Comments
 (0)