- 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>
22 lines
902 B
C++
22 lines
902 B
C++
#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;
|
|
};
|