#pragma once #include "IndexedGeometry.h" #include "Vector.h" namespace Aftr { class IndexedGeometryCylinder : public IndexedGeometry { public: static IndexedGeometryCylinder* New(float topRadius = 1, float bottomRadius = 1, float height = 1, unsigned int slices = 5, unsigned int stacks = 1, bool useNormals = false, bool useTextureCoords = false); virtual ~IndexedGeometryCylinder() {} float getHeight() const noexcept; float getTopRadius() const noexcept; float getBottomRadius() const noexcept; /// Returns a pointer to a list containing all verticies within this model. /// This list is indexed by the corresponding CompositeIndexList. virtual const std::vector< Vector >& getCompositeVertexList() const override; /// Returns a pointer to a list containing all indicies into the corresponding /// CompositeVertexList. virtual const std::vector< unsigned int >& getCompositeIndexList() const override; protected: IndexedGeometryCylinder(float topRadius, float bottomRadius, float height, unsigned int slices, unsigned int stacks, bool useNormals, bool useTextureCoords); virtual void createVertices(); virtual void createIndices(); virtual void createTextureCoords(); virtual void createNormals();//TODO: normals may be backwards, verify -- CM float topRadius; float bottomRadius; float height; unsigned int slices; unsigned int stacks; bool useNormals = false; bool useTextureCoords = false; std::vector verts; //SLN TODO: POPulate and use this, right now composite list isn't sync'd std::vector idx; //SLN TODO: POPulate and use this, right now composite list isn't sync'd }; }