This class represent a asteroid with a 3D random fractal shape
LargeSize=12, MediumSize=6, SmallSize=3
This class represent a asteroid with a 3D random fractal shape. The fractal shape is stored in a mesh and it is generated, starting from a loaded base mesh (i.e. ast.raw or tetra.raw) and by recursively subdividing each face into four smaller faces. Version History
- 0.4s Added the Explode and GenerateSub
Ast3DFract(char *filename="data/tetra.raw", float _size=5, int recur=1, int seed=-1)
int Draw()
void Split(int seed, float strenght=1)
Point3f MidPoint( Point3f &p0, Point3f &p1, Point3f const &BC, int seed, float strengh)
BC - the BariCenter of the Asteroids; the perturbation is along the line from bc to the middlepoint
seed - a random seed to avoid to calculate always the same asteroid when starting from the same triangles...
stenght - the {strenght} of the perturbation when strenght == 0 the shape tends to a sphere, good values are in the [.2,2] range.
void Explode(list<Ast *> &AL, list<GameObj *> &OL)
void GenerateSub()
Alphabetic index HTML hierarchy of classes or Java