/* * Creates a sun and appends it to planetsList. */ void CreateSun(GLfloat radius, enum planetShape shape) { struct PlanetStruct planet; planet.center = SetVector(0, 0, 0); planet.startingPosition = planet.center; planet.radius = radius; planet.orbitalSpeed = 0; planet.orbitalAxis = SetVector(0,1,0); planet.rotationalSpeed = 0.0002; planet.rotationalAxis = SetVector(1,1,0); planet.type = shape; planet.textureScale = 1; CreatePlanet(planet, NO_SOUND); }
void CreateStandardPlanet(vec3 center, GLfloat radius, enum planetShape shape, GLuint playSound) { struct PlanetStruct planet; planet.center = center; planet.radius = radius; planet.orbitalSpeed = 0.001; planet.orbitalAxis = SetVector(0,1,0); planet.rotationalSpeed = 0.001; planet.rotationalAxis = SetVector(1,1,0); planet.type = shape; planet.textureScale = 1; if(shape == CUBE_PLANET) //Doesn't scale properly atm planet.radius = 128; CreatePlanet(planet, playSound); }
void Space::GenBody(double time, SystemBody* sbody, Frame* f) { Entity e = m_entities->create(); if (sbody->GetType() != SystemBody::TYPE_GRAVPOINT) { if (sbody->GetSuperType() == SystemBody::SUPERTYPE_STAR) { CreateStar(e, sbody); } else if ((sbody->GetType() == SystemBody::TYPE_STARPORT_ORBITAL) || (sbody->GetType() == SystemBody::TYPE_STARPORT_SURFACE)) { //SpaceStation *ss = new SpaceStation(sbody); //b = ss; return; } else { CreatePlanet(e, sbody); } e.assign<NameComponent>(sbody->GetName()); e.assign<PosOrientComponent>(vector3d(0.0), matrix3x3d(1.0)); } f = MakeFrameFor(time, sbody, e, f); for (SystemBody* child : sbody->GetChildren()) GenBody(time, child, f); }