- Crear interfaz abstracta Shape con métodos virtuales - Refactorizar RotoBall → SphereShape (clase polimórfica) - Implementar CubeShape con triple rotación (X/Y/Z) - Distribución inteligente en cubo: vértices/centros/grid 3D - Cambiar controles: F=toggle, Q/W/E/R/T/Y/U/I=figuras, B=temas - Actualizar SimulationMode: ROTOBALL → SHAPE - Añadir enum ShapeType (8 figuras: Sphere/Cube/Helix/Torus/etc.) - Incluir source/shapes/*.cpp en CMakeLists.txt - Física compartida escalable entre todas las figuras - Roadmap: 6 figuras pendientes (Helix/Torus/Wave/Cylinder/Icosahedron/Atom) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
22 lines
909 B
C++
22 lines
909 B
C++
#pragma once
|
|
|
|
#include "shape.h"
|
|
|
|
// Figura: Esfera 3D con distribución uniforme (Fibonacci Sphere Algorithm)
|
|
// Comportamiento: Rotación dual en ejes X e Y
|
|
// Uso anterior: RotoBall
|
|
class SphereShape : public Shape {
|
|
private:
|
|
float angle_x_ = 0.0f; // Ángulo de rotación en eje X (rad)
|
|
float angle_y_ = 0.0f; // Ángulo de rotación en eje Y (rad)
|
|
float radius_ = 0.0f; // Radio de la esfera (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 "SPHERE"; }
|
|
float getScaleFactor(float screen_height) const override;
|
|
};
|