Implementar figura CYLINDER (cilindro 3D) - Tecla Y

- Nueva clase CylinderShape con ecuaciones paramétricas
- Distribución uniforme en anillos y circunferencia
- Rotación simple en eje Y
- Dimensiones: radius=0.25, height=0.5 (proporción altura)
- Compatible con física spring-damper y z-sorting

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-10-04 06:38:58 +02:00
parent 8b642f6903
commit ac3309ffd1
4 changed files with 107 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
#pragma once
#include "shape.h"
// Figura: Cilindro 3D rotante
// Comportamiento: Superficie cilíndrica con rotación en eje Y
// Ecuaciones: x = r*cos(u), y = v, z = r*sin(u)
class CylinderShape : public Shape {
private:
float angle_y_ = 0.0f; // Ángulo de rotación en eje Y (rad)
float radius_ = 0.0f; // Radio del cilindro (píxeles)
float height_ = 0.0f; // Altura del cilindro (píxeles)
int num_points_ = 0; // Cantidad de puntos generados
public:
void generatePoints(int num_points, float screen_width, float screen_height) override;
void update(float delta_time, float screen_width, float screen_height) override;
void getPoint3D(int index, float& x, float& y, float& z) const override;
const char* getName() const override { return "CYLINDER"; }
float getScaleFactor(float screen_height) const override;
};