blob: 6d19e7366fdb6eebd56c19259fe015f104aff215 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
/******************************************************************************
*
* El'Beem - Free Surface Fluid Simulation with the Lattice Boltzmann Method
* Copyright 2003,2004 Nils Thuerey
*
* A simple sphere object
*
*****************************************************************************/
#ifndef NTL_GEOSPHERE_H
#include "ntl_geometryobject.h"
/*! A simple box object generatedd by 12 triangles */
class ntlGeometrySphere : public ntlGeometryObject
{
public:
/* Init constructor */
ntlGeometrySphere( void );
//! Return type id
virtual int getTypeId() { return GEOCLASSTID_SPHERE; }
virtual void getTriangles( vector<ntlTriangle> *triangles,
vector<ntlVec3Gfx> *vertices,
vector<ntlVec3Gfx> *normals, int objectId );
/*! for easy GUI detection get start of axis aligned bounding box, return NULL of no BB */
virtual inline ntlVec3Gfx *getBBStart() { return &mvBBStart; }
virtual inline ntlVec3Gfx *getBBEnd() { return &mvBBEnd; }
/*! Init refinement attribute */
virtual void initialize(ntlRenderGlobals *glob);
private:
/*! Center of the sphere */
ntlVec3Gfx mvCenter;
/*! radius */
gfxReal mRadius;
/*! refinement factor along polar angle */
int mRefPolar;
/*! refinement factor per segment (azimuthal angle) */
int mRefAzim;
/*! Start and end points of bounding box */
ntlVec3Gfx mvBBStart, mvBBEnd;
public:
/* Access methods */
/*! Access start vector */
inline ntlVec3Gfx getCenter( void ){ return mvCenter; }
inline void setCenter( const ntlVec3Gfx &set ){ mvCenter = set; }
};
#define NTL_GEOSPHERE_H
#endif
|