NDEVR
API Documentation
Skybox.h
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Design
28File: Skybox
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include <NDEVR/Model.h>
34#if NDEVR_VIEWPORT
35namespace NDEVR
36{
41 class NDEVR_DESIGN_API Skybox : public Model
42 {
43 public:
50 public:
53 Skybox(const Model& model)
54 : Model(model)
55 , m_grid_visible(false)
56 {}
57
59 void hideGrid();
62 void setToColor(const RGBColor& color);
68 void setToGradient(const RGBColor& top_a, const RGBColor& top_b, const RGBColor& bottom_a, const RGBColor& bottom_b);
72 void setToGradient(const RGBColor& top, const RGBColor& bottom);
74 void setToSky();
78 void showGrid(fltp08 grid_spacing, fltp04 thickness);
84 bool gridVisible() { return m_grid_visible; }
85 protected:
87 };
88}
89#endif
The equivelent of std::vector but with a bit more control.
Definition Buffer.hpp:58
Model()
Default constructor. Creates an uninitialized Model.
Definition Model.h:365
Represents a color in the RGB space with optional alpha transparency.
Definition RGBColor.h:57
bool m_grid_visible
Whether the ground-plane grid overlay is currently visible.
Definition Skybox.h:86
Skybox(const Model &model)
Constructs a Skybox from an existing Model.
Definition Skybox.h:53
void setToColor(const RGBColor &color)
Sets the skybox to a uniform solid color.
void setupSkybox()
Initializes the skybox geometry and model structure.
static Buffer< Triangle< 3, fltp04 > > getCube()
Generates cube geometry as a buffer of triangles for use as a skybox mesh.
bool gridVisible()
Returns whether the ground-plane grid is currently visible.
Definition Skybox.h:84
void setToSky()
Sets the skybox to a default sky appearance.
void setToGradient(const RGBColor &top_a, const RGBColor &top_b, const RGBColor &bottom_a, const RGBColor &bottom_b)
Sets the skybox to a four-corner gradient.
void showGrid(fltp08 grid_spacing, fltp04 thickness)
Shows a ground-plane grid overlay with the specified spacing and line thickness.
void hideGrid()
Hides the ground-plane grid overlay.
void setToGradient(const RGBColor &top, const RGBColor &bottom)
Sets the skybox to a vertical two-color gradient.
static Buffer< Triangle< 3, fltp04 > > getPlane()
Generates plane geometry as a buffer of triangles for use as a skybox backdrop.
The primary namespace for the NDEVR SDK.
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...
double fltp08
Defines an alias representing an 8 byte floating-point number.