| 273 | } |
| 274 | |
| 275 | void Renderer::DrawNFS34Metadata(Entity *targetEntity) { |
| 276 | switch (targetEntity->type) { |
| 277 | case EntityType::OBJ_POLY: |
| 278 | break; |
| 279 | case EntityType::GLOBAL: |
| 280 | break; |
| 281 | case EntityType::LANE: |
| 282 | break; |
| 283 | case EntityType::LIGHT: { |
| 284 | Light *targetLight = &boost::get<Light>(targetEntity->glMesh); |
| 285 | ImVec4 lightColour(targetLight->colour.x, targetLight->colour.y, targetLight->colour.z, |
| 286 | targetLight->colour.w); |
| 287 | ImVec4 lightAttenuation(targetLight->attenuation.x, targetLight->attenuation.y, targetLight->attenuation.z, |
| 288 | 0.0f); |
| 289 | // Colour, type, attenuation, position and NFS unknowns |
| 290 | ImGui::ColorEdit4("Light Colour", (float *) &lightColour); // Edit 3 floats representing a color |
| 291 | targetLight->colour = glm::vec4(lightColour.x, lightColour.y, lightColour.z, lightColour.w); |
| 292 | ImGui::SliderFloat3("Attenuation (A, B, C)", (float *) &lightAttenuation, 0, 10.0f); |
| 293 | targetLight->attenuation = glm::vec3(lightAttenuation.x, lightAttenuation.y, lightAttenuation.z); |
| 294 | ImGui::Text("x: %f y: %f z: %f ", targetLight->position.x, targetLight->position.y, |
| 295 | targetLight->position.z); |
| 296 | ImGui::Separator(); |
| 297 | ImGui::Text("NFS Data"); |
| 298 | ImGui::Text("Type: %ld", targetLight->type); |
| 299 | ImGui::Text("Unknowns: "); |
| 300 | ImGui::Text("[1]: %d", targetLight->unknown1); |
| 301 | ImGui::Text("[2]: %d", targetLight->unknown2); |
| 302 | ImGui::Text("[3]: %d", targetLight->unknown3); |
| 303 | ImGui::Text("[4]: %f", targetLight->unknown4); |
| 304 | } |
| 305 | break; |
| 306 | case EntityType::ROAD: |
| 307 | break; |
| 308 | case EntityType::XOBJ: |
| 309 | break; |
| 310 | case EntityType::SOUND: |
| 311 | break; |
| 312 | case EntityType::CAR: |
| 313 | // TODO: Allow adjustment of shader parameters here as well, and car colour |
| 314 | Car *targetCar = boost::get<Car *>(targetEntity->glMesh); |
| 315 | ImGui::Text("%s", targetCar->name.c_str()); |
| 316 | ImGui::Text("Ray Distances U: %f F: %f R: %f L: %f", targetCar->upDistance, targetCar->forwardDistance, |
| 317 | targetCar->rightDistance, targetCar->leftDistance); |
| 318 | // Physics Parameters |
| 319 | ImGui::SliderFloat("Engine Force", &targetCar->gEngineForce, 0, 10000.0f); |
| 320 | ImGui::SliderFloat("Breaking Force", &targetCar->gBreakingForce, 0, 1000.0f); |
| 321 | ImGui::SliderFloat("Max Engine Force", &targetCar->maxEngineForce, 0, 10000.0f); |
| 322 | ImGui::SliderFloat("Max Breaking Force", &targetCar->maxBreakingForce, 0, 1000.0f); |
| 323 | ImGui::SliderFloat("Susp Rest.", &targetCar->suspensionRestLength, 0, 0.1f); // btScalar(0.030); |
| 324 | // TODO: When this is modified, the connection points of the wheels need changing |
| 325 | ImGui::SliderFloat("Susp Stiff.", &targetCar->suspensionStiffness, 0, 1000.f); |
| 326 | ImGui::SliderFloat("Susp Damp.", &targetCar->suspensionDamping, 0, 1000.f); |
| 327 | ImGui::SliderFloat("Susp Compr.", &targetCar->suspensionCompression, 0, 1000.f); |
| 328 | ImGui::SliderFloat("Friction.", &targetCar->wheelFriction, 0, 1.f); |
| 329 | ImGui::SliderFloat("Roll Infl.", &targetCar->rollInfluence, 0, 0.5); |
| 330 | ImGui::SliderFloat("Steer Incr.", &targetCar->steeringIncrement, 0.f, 0.1f); |
| 331 | ImGui::SliderFloat("Steer Clamp", &targetCar->steeringClamp, 0.f, 0.5f); |
| 332 | // Graphics Parameters |
nothing calls this directly
no test coverage detected