4 #ifndef _3ESSPHERETESSELLATOR_H_ 5 #define _3ESSPHERETESSELLATOR_H_ 9 #include "3esvector3.h" 10 #include "3esvectorhash.h" 12 #include <unordered_map> 19 size_t operator()(
const Vector3f &v)
const;
20 size_t operator()(
const Vector3d &v)
const;
23 typedef std::unordered_map<Vector3f, unsigned, SphereVertexHash> SphereVertexMap;
25 inline size_t SphereVertexHash::operator()(
const Vector3f &v)
const 31 inline size_t SphereVertexHash::operator()(
const Vector3d &v)
const 40 void _3es_coreAPI
sphereInitialise(std::vector<Vector3f> &vertices, std::vector<unsigned> &indices, SphereVertexMap *vertexMap =
nullptr);
46 void _3es_coreAPI
subdivideUnitSphere(std::vector<Vector3f> &vertices, std::vector<unsigned> &indices, SphereVertexMap &vertexMap);
49 void _3es_coreAPI
sphereSubdivision(std::vector<Vector3f> &vertices, std::vector<unsigned> &indices,
float radius = 1.0f,
const Vector3f &origin =
Vector3f(0.0f),
int depth = 2);
52 #endif // _3ESSPHERETESSELLATOR_H_ void _3es_coreAPI sphereSubdivision(std::vector< Vector3f > &vertices, std::vector< unsigned > &indices, float radius=1.0f, const Vector3f &origin=Vector3f(0.0f), int depth=2)
Tessellate a sphere using a subdivision technique starting from an icosahedron.
Definition: 3esbounds.h:13
Vector3< float > Vector3f
Defines a single precision vector.
Definition: 3esvector3.h:14
void _3es_coreAPI subdivideUnitSphere(std::vector< Vector3f > &vertices, std::vector< unsigned > &indices, SphereVertexMap &vertexMap)
Subdivide a unit sphere.
Represents a vector in R3.
Definition: 3esvector3.h:14
uint32_t hash(float x, float y, float z)
Generate a hash code for a 3-component vertex.
Definition: 3esvectorhash.h:94
void _3es_coreAPI sphereInitialise(std::vector< Vector3f > &vertices, std::vector< unsigned > &indices, SphereVertexMap *vertexMap=nullptr)
Initialise a unity sphere as an icosahedron.
T x
Direct data member access.
Definition: 3esvector3.h:30
Definition: 3esspheretessellator.h:17