SLProject
4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
z
Functions
a
c
d
e
f
g
i
l
m
n
o
p
r
s
t
u
v
w
z
Variables
Typedefs
Enumerations
Enumerator
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Typedefs
Enumerations
Enumerator
c
d
e
f
h
i
k
l
m
n
r
s
t
Properties
Related Functions
Files
File List
File Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
Functions
b
c
e
f
g
i
j
m
o
p
r
s
t
u
v
w
y
Variables
a
b
c
d
e
f
g
h
i
l
m
n
p
r
s
t
v
w
Typedefs
a
c
h
j
o
s
t
Enumerations
a
c
d
e
h
s
t
w
Enumerator
a
b
c
d
e
f
h
i
k
l
m
n
p
r
s
t
u
v
Macros
a
b
e
f
g
i
l
m
o
p
s
t
u
w
SLBox.h
Go to the documentation of this file.
1
/**
2
* \file SLBox.h
3
* \date July 2014
4
* \authors Marcus Hudritsch
5
* \copyright http://opensource.org/licenses/GPL-3.0
6
* \remarks Please use clangformat to format the code. See more code style on
7
* https://github.com/cpvrlab/SLProject4/wiki/SLProject-Coding-Style
8
*/
9
10
#ifndef SLBOX_H
11
#define SLBOX_H
12
13
#include <
SLEnums.h
>
14
#include <
SLMesh.h
>
15
16
//-----------------------------------------------------------------------------
17
/**
18
* @brief Axis aligned box mesh
19
* @details The SLBox node draws an axis aligned box from a minimal corner to
20
* a maximal corner. If the minimal and maximal corner are swapped the normals
21
* will point inside.
22
* @remarks It is important that during instantiation NO OpenGL functions (gl*)
23
* get called because this constructor will be most probably called in a parallel
24
* thread from within an SLScene::registerAssetsToLoad or SLScene::assemble
25
* function. All objects that get rendered have to do their OpenGL initialization
26
* when they are used the first time during rendering in the main thread.
27
* For this SLMesh it means that the objects for OpenGL drawing (_vao, _vaoP,
28
* _vaoN, _vaoT and _vaoS) remain unused until the first frame is rendered.
29
*/
30
class
SLBox
:
public
SLMesh
31
{
32
public
:
33
SLBox
(
SLAssetManager
* assetMgr,
34
SLfloat
minx = 0,
35
SLfloat
miny = 0,
36
SLfloat
minz = 0,
37
SLfloat
maxx = 1,
38
SLfloat
maxy = 1,
39
SLfloat
maxz = 1,
40
const
SLstring
&
name
=
"box mesh"
,
41
SLMaterial
*
mat
=
nullptr
);
42
SLBox
(
SLAssetManager
* assetMgr,
43
const
SLVec3f
& min,
44
const
SLVec3f
& max,
45
const
SLstring
&
name
=
"box mesh"
,
46
SLMaterial
*
mat
=
nullptr
);
47
48
void
buildMesh
(
SLMaterial
*
mat
);
49
50
private
:
51
SLVec3f
_min
;
//!< minimal corner
52
SLVec3f
_max
;
//!< maximum corner
53
};
54
//-----------------------------------------------------------------------------
55
#endif
SLfloat
float SLfloat
Definition:
SL.h:173
SLstring
string SLstring
Definition:
SL.h:158
SLEnums.h
SLMesh.h
SLAssetManager
Toplevel holder of the assets meshes, materials, textures and shaders.
Definition:
SLAssetManager.h:33
SLBox
Axis aligned box mesh.
Definition:
SLBox.h:31
SLBox::SLBox
SLBox(SLAssetManager *assetMgr, SLfloat minx=0, SLfloat miny=0, SLfloat minz=0, SLfloat maxx=1, SLfloat maxy=1, SLfloat maxz=1, const SLstring &name="box mesh", SLMaterial *mat=nullptr)
SLBox::SLBox ctor with min. & max. coords. of the axis aligned box.
Definition:
SLBox.cpp:15
SLBox::_max
SLVec3f _max
maximum corner
Definition:
SLBox.h:52
SLBox::buildMesh
void buildMesh(SLMaterial *mat)
SLBox::buildMesh fills in the underlying arrays from the SLMesh object.
Definition:
SLBox.cpp:47
SLBox::_min
SLVec3f _min
minimal corner
Definition:
SLBox.h:51
SLMaterial
Defines a standard CG material with textures and a shader program.
Definition:
SLMaterial.h:56
SLMesh
An SLMesh object is a triangulated mesh, drawn with one draw call.
Definition:
SLMesh.h:134
SLMesh::mat
SLMaterial * mat() const
Definition:
SLMesh.h:177
SLObject::name
const SLstring & name() const
Definition:
SLObject.h:38
SLVec3< SLfloat >
modules
sl
source
mesh
SLBox.h
Generated by
1.9.1