overte/interface/src/Stars.h
Sam Gateau 738369e21f Replacing glutSolidSphere by a cached Geometry
Instead of calling glutSolidSphere, just call Application::getInstance()->getGeometryCache()->renderSphere(...)

- replaced all the instances of "glutSolidSphere"
- Changed the atmosphere shaders so instead of drawing a sphere of the size of the atmosphere, we draw a unit sphere, the vertices get scaled at the right radius in th vertex shader using  fOuterRadius
2014-10-03 16:55:58 -07:00

55 lines
1.4 KiB
C++

//
// Stars.h
// interface/src
//
// Created by Tobias Schwinger on 3/22/13.
// Copyright 2013 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#ifndef hifi_Stars_h
#define hifi_Stars_h
#include <glm/glm.hpp>
namespace starfield { class Controller; }
// Starfield rendering component.
class Stars {
public:
Stars();
~Stars();
// Generate stars from random number
// The numStars parameter sets the number of stars to generate.
bool generate(unsigned numStars, unsigned seed);
// Renders the starfield from a local viewer's perspective.
// The parameters specifiy the field of view.
void render(float fovY, float aspect, float nearZ, float alpha);
// Sets the resolution for FOV culling.
//
// The parameter determines the number of tiles in azimuthal
// and altitudinal directions.
//
// GPU resources are updated upon change in which case 'true'
// is returned.
bool setResolution(unsigned k);
// Returns true when stars have been loaded
bool isStarsLoaded() const { return _starsLoaded; };
private:
// don't copy/assign
Stars(Stars const&); // = delete;
Stars& operator=(Stars const&); // delete;
starfield::Controller* _controller;
bool _starsLoaded;
};
#endif // hifi_Stars_h