|
|
|
@ -548,17 +548,32 @@ void render_body_info_ui(SimulationState* sim, RenderState* render_state) { |
|
|
|
strcat(info_text, "\n"); |
|
|
|
strcat(info_text, "\n"); |
|
|
|
strcat(info_text, temp_buffer); |
|
|
|
strcat(info_text, temp_buffer); |
|
|
|
|
|
|
|
|
|
|
|
// Position
|
|
|
|
if (body->parent_index <= 0) { |
|
|
|
snprintf(temp_buffer, sizeof(temp_buffer), "Position: (%.2e, %.2e, %.2e)", |
|
|
|
// Position
|
|
|
|
body->position.x, body->position.y, body->position.z); |
|
|
|
snprintf(temp_buffer, sizeof(temp_buffer), "Position: (%.2e, %.2e, %.2e)", |
|
|
|
strcat(info_text, "\n"); |
|
|
|
body->position.x, body->position.y, body->position.z); |
|
|
|
strcat(info_text, temp_buffer); |
|
|
|
strcat(info_text, "\n"); |
|
|
|
|
|
|
|
strcat(info_text, temp_buffer); |
|
|
|
|
|
|
|
|
|
|
|
// Velocity
|
|
|
|
// Velocity
|
|
|
|
double vel_mag = vec3_magnitude(body->velocity); |
|
|
|
double vel_mag = vec3_magnitude(body->velocity); |
|
|
|
snprintf(temp_buffer, sizeof(temp_buffer), "Velocity: %.2f m/s", vel_mag); |
|
|
|
snprintf(temp_buffer, sizeof(temp_buffer), "Velocity: %.2f m/s", vel_mag); |
|
|
|
strcat(info_text, "\n"); |
|
|
|
strcat(info_text, "\n"); |
|
|
|
strcat(info_text, temp_buffer); |
|
|
|
strcat(info_text, temp_buffer); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// Position (Local)
|
|
|
|
|
|
|
|
snprintf(temp_buffer, sizeof(temp_buffer), "local_position: (%.2e, %.2e, %.2e)", |
|
|
|
|
|
|
|
body->local_position.x, body->local_position.y, body->local_position.z); |
|
|
|
|
|
|
|
strcat(info_text, "\n"); |
|
|
|
|
|
|
|
strcat(info_text, temp_buffer); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Velocity (Local)
|
|
|
|
|
|
|
|
double parent_vel_mag = vec3_magnitude(sim->bodies[body->parent_index].velocity); |
|
|
|
|
|
|
|
double vel_mag = vec3_magnitude(body->velocity) - parent_vel_mag; |
|
|
|
|
|
|
|
snprintf(temp_buffer, sizeof(temp_buffer), "local_velocity: %.2f m/s", vel_mag); |
|
|
|
|
|
|
|
strcat(info_text, "\n"); |
|
|
|
|
|
|
|
strcat(info_text, temp_buffer); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Orbital elements
|
|
|
|
// Orbital elements
|
|
|
|
snprintf(temp_buffer, sizeof(temp_buffer), "Eccentricity: %.3f", body->eccentricity); |
|
|
|
snprintf(temp_buffer, sizeof(temp_buffer), "Eccentricity: %.3f", body->eccentricity); |
|
|
|
|