39 lines
1.2 KiB
C++
39 lines
1.2 KiB
C++
// # Replaced double with float
|
|
// # Predecessor: pedestrian_reduced.hpp
|
|
|
|
#pragma once
|
|
#include "constants_float.hpp"
|
|
|
|
struct Pedestrian {
|
|
|
|
int color;
|
|
|
|
float curr_vel_x;
|
|
float curr_vel_y;
|
|
|
|
float w_x;
|
|
float w_y;
|
|
|
|
float curr_pos_x;
|
|
float curr_pos_y;
|
|
|
|
float e_x;
|
|
float e_y;
|
|
|
|
float v_max;
|
|
|
|
float desired_v0;
|
|
|
|
float destination_x;
|
|
float destination_y;
|
|
|
|
float s_b_sq;
|
|
float s_b_e_x;
|
|
float s_b_e_y;
|
|
|
|
Pedestrian() : color(0), curr_vel_x(0.0), curr_vel_y(0), w_x(0.0), w_y(0.0), curr_pos_x(0.0), curr_pos_y(0.0), e_x(0.0), e_y(0.0), v_max(0.0), desired_v0(0.0), destination_x(0.0), destination_y(0.0), s_b_sq(0.0), s_b_e_x(0.0), s_b_e_y(0.0) {}
|
|
|
|
Pedestrian(int clr, float c_v_x, float c_v_y, float c_p_x, float c_p_y, float e_x, float e_y, float v_max, float desired_v0, float d_x, float d_y)
|
|
: color(clr), curr_vel_x(c_v_x), curr_vel_y(c_v_y), w_x(c_v_x), w_y(c_v_y), curr_pos_x(c_p_x), curr_pos_y(c_p_y), e_x(e_x), e_y(e_y), v_max(v_max), desired_v0(desired_v0), destination_x(d_x), destination_y(d_y), s_b_sq((c_v_x * c_v_x + c_v_y * c_v_y) * delta_t_sq), s_b_e_x(e_x * (sqrt(c_v_x * c_v_x + c_v_y * c_v_y)) * delta_t), s_b_e_y(e_y * (sqrt(c_v_x * c_v_x + c_v_y * c_v_y)) * delta_t) {}
|
|
};
|