27 assert(
slices >= 3 &&
"Error: Not enough slices.");
28 assert(
slices > 0 &&
"Error: Not enough stacks.");
29 assert(thetaStartDEG >= 0.0f && thetaStartDEG < 180.0f &&
30 "Error: Polar start angle < 0 or > 180");
31 assert(thetaEndDEG > 0.0f && thetaEndDEG <= 180.0f &&
32 "Error: Polar end angle < 0 or > 180");
33 assert(thetaStartDEG < thetaEndDEG &&
34 "Error: Polar start angle > end angle");
44 _isVolume = (thetaStartDEG == 0.0f && thetaEndDEG == 180.0f);
float SLfloat
analog to GLfloat
unsigned int SLuint
analog to GLuint
string SLstring
Redefinition of standard types for platform independence.
Toplevel holder of the assets meshes, materials, textures and shaders.
Defines a standard CG material with textures and a shader program.
SLbool _isVolume
Flag for RT if mesh is a closed volume.
SLRevolver is an SLMesh object built out of revolving points.
SLbool _smoothLast
flag if the normal of the last point is eqaual to revAxis
SLVec3f _revAxis
axis of revolution
SLbool _smoothFirst
flag if the normal of the first point is eqaual to -revAxis
SLuint _slices
NO. of slices.
void buildMesh(SLMaterial *mat=nullptr)
SLVVec3f _revPoints
Array revolving points.
SLuint _stacks
No. of stacks (mostly used)
SLfloat _thetaStartDEG
Polar start angle 0-180deg.
SLfloat _thetaEndDEG
Polar end angle 1-180deg.
SLfloat _radius
radius of the sphere
SLSpheric(SLAssetManager *assetMgr, SLfloat radius, SLfloat thetaStartDEG, SLfloat thetaEndDEG, SLuint stacks=32, SLuint slices=32, SLstring name="spheric mesh", SLMaterial *mat=nullptr)
void set(const T X, const T Y, const T Z)
void fromSpherical(T r, T theta, T phi)
Calculates the vector from spherical coords r, theta & phi in radians.
static const float DEG2RAD