refactor: eliminar Rotation3D i el seu camí de codi (codi mort)
L'struct Rotation3D, la funció apply3dRotation i el paràmetre opcional rotation_3d de renderShape mai s'activaven en cap caller: - Ship, Enemy i Bullet passaven explícitament nullptr. - Title scene, logo scene, starfield, vector_text i ship_animator usaven el default nullptr (set els 7 callers). CLAUDE.md descriu un sistema 3D del title screen que ja no està viu — el comentari en ship_animator.cpp aclareix que la perspectiva s'ha bakeat dins de la shape, així que la rotació dinàmica era residu històric. Esborrats: struct Rotation3D + ctors + hasRotation(), apply3dRotation(), la branca rotation_3d a transformPoint() i el seu paràmetre, el paràmetre rotation_3d de renderShape, i els arguments nullptr als 3 callers d'entitats. Hallazgo #16 de CODE_REVIEW.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -20,17 +20,16 @@
|
||||
#include "game/constants.hpp"
|
||||
|
||||
Ship::Ship(Rendering::Renderer* renderer, const char* shape_file)
|
||||
: Entity(renderer)
|
||||
{
|
||||
: Entity(renderer) {
|
||||
// Brightness específico para naves
|
||||
brightness_ = Defaults::Brightness::NAU;
|
||||
|
||||
// Configuración del cuerpo físico
|
||||
body_.setMass(10.0F); // Masa de referencia para choques
|
||||
body_.radius = Defaults::Entities::SHIP_RADIUS; // Radio de colisión
|
||||
body_.restitution = 0.6F; // Rebote moderado contra paredes
|
||||
body_.linear_damping = 1.5F; // Fricción exponencial (s⁻¹)
|
||||
body_.angular_damping = 0.0F; // La rotación es 100% por input, no inercial
|
||||
body_.setMass(10.0F); // Masa de referencia para choques
|
||||
body_.radius = Defaults::Entities::SHIP_RADIUS; // Radio de colisión
|
||||
body_.restitution = 0.6F; // Rebote moderado contra paredes
|
||||
body_.linear_damping = 1.5F; // Fricción exponencial (s⁻¹)
|
||||
body_.angular_damping = 0.0F; // La rotación es 100% por input, no inercial
|
||||
|
||||
// Cargar shape compartida desde archivo
|
||||
shape_ = Graphics::ShapeLoader::load(shape_file);
|
||||
@@ -158,6 +157,5 @@ void Ship::draw() const {
|
||||
const float VISUAL_PUSH = SPEED / 33.33F;
|
||||
const float SCALE = 1.0F + (VISUAL_PUSH / 12.0F);
|
||||
|
||||
Rendering::renderShape(renderer_, shape_, center_, angle_, SCALE, 1.0F, brightness_,
|
||||
/*rotation_3d=*/nullptr, Defaults::Palette::SHIP);
|
||||
Rendering::renderShape(renderer_, shape_, center_, angle_, SCALE, 1.0F, brightness_, Defaults::Palette::SHIP);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user