@@ -45,11 +45,9 @@ void NavAgent2D::_update_rvo_agent_properties() {
45
45
rvo_agent.radius_ = radius;
46
46
rvo_agent.maxSpeed_ = max_speed;
47
47
rvo_agent.position_ = RVO2D::Vector2 (position.x , position.y );
48
- rvo_agent.elevation_ = 0.0 ; // TODO: Remove?
49
48
// Replacing the internal velocity directly causes major jitter / bugs due to unpredictable velocity jumps, left line here for testing.
50
49
// rvo_agent.velocity_ = RVO2D::Vector2(velocity.x, velocity.y);
51
50
rvo_agent.prefVelocity_ = RVO2D::Vector2 (velocity.x , velocity.y );
52
- rvo_agent.height_ = 1.0 ; // TODO: Remove?
53
51
rvo_agent.avoidance_layers_ = avoidance_layers;
54
52
rvo_agent.avoidance_mask_ = avoidance_mask;
55
53
rvo_agent.avoidance_priority_ = avoidance_priority;
@@ -178,7 +176,6 @@ void NavAgent2D::set_max_speed(real_t p_max_speed) {
178
176
void NavAgent2D::set_position (const Vector2 &p_position) {
179
177
position = p_position;
180
178
if (avoidance_enabled) {
181
- rvo_agent.elevation_ = 0.0 ; // TODO: Remove?
182
179
rvo_agent.position_ = RVO2D::Vector2 (p_position.x , p_position.y );
183
180
}
184
181
agent_dirty = true ;
@@ -264,15 +261,13 @@ const Dictionary NavAgent2D::get_avoidance_data() const {
264
261
_avoidance_data[" max_neighbors" ] = int (rvo_agent.maxNeighbors_ );
265
262
_avoidance_data[" max_speed" ] = float (rvo_agent.maxSpeed_ );
266
263
_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 ());
272
268
_avoidance_data[" radius" ] = float (rvo_agent.radius_ );
273
269
_avoidance_data[" time_horizon_agents" ] = float (rvo_agent.timeHorizon_ );
274
270
_avoidance_data[" time_horizon_obstacles" ] = float (rvo_agent.timeHorizonObst_ );
275
- _avoidance_data[" height" ] = float (rvo_agent.height_ ); // TODO: Remove?
276
271
_avoidance_data[" avoidance_layers" ] = int (rvo_agent.avoidance_layers_ );
277
272
_avoidance_data[" avoidance_mask" ] = int (rvo_agent.avoidance_mask_ );
278
273
_avoidance_data[" avoidance_priority" ] = float (rvo_agent.avoidance_priority_ );
0 commit comments