PolyVox
0.2.1
Open source voxel management library
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
PolyVoxCore
include
PolyVoxCore
VertexTypes.h
Go to the documentation of this file.
1
/*******************************************************************************
2
Copyright (c) 2005-2009 David Williams
3
4
This software is provided 'as-is', without any express or implied
5
warranty. In no event will the authors be held liable for any damages
6
arising from the use of this software.
7
8
Permission is granted to anyone to use this software for any purpose,
9
including commercial applications, and to alter it and redistribute it
10
freely, subject to the following restrictions:
11
12
1. The origin of this software must not be misrepresented; you must not
13
claim that you wrote the original software. If you use this software
14
in a product, an acknowledgment in the product documentation would be
15
appreciated but is not required.
16
17
2. Altered source versions must be plainly marked as such, and must not be
18
misrepresented as being the original software.
19
20
3. This notice may not be removed or altered from any source
21
distribution.
22
*******************************************************************************/
23
24
#ifndef __PolyVox_SurfaceVertex_H__
25
#define __PolyVox_SurfaceVertex_H__
26
27
#include "
Impl/TypeDef.h
"
28
29
#include "
PolyVoxCore/Vector.h
"
30
31
#include <bitset>
32
#include <vector>
33
34
namespace
PolyVox
35
{
36
#ifdef SWIG
37
class
PositionMaterial
38
#else
39
class
POLYVOX_API
PositionMaterial
40
#endif
41
{
42
public
:
43
PositionMaterial
();
44
PositionMaterial
(
Vector3DFloat
positionToSet,
float
materialToSet);
45
46
float
getMaterial
(
void
)
const
;
47
const
Vector3DFloat
&
getPosition
(
void
)
const
;
48
49
void
setMaterial
(
float
materialToSet);
50
void
setPosition
(
const
Vector3DFloat
& positionToSet);
51
public
:
52
//Nicely fits into four floats.
53
Vector3DFloat
position
;
54
float
material
;
55
};
56
57
#ifdef SWIG
58
class
PositionMaterialNormal
59
#else
60
class
POLYVOX_API
PositionMaterialNormal
61
#endif
62
{
63
public
:
64
PositionMaterialNormal
();
65
PositionMaterialNormal
(
Vector3DFloat
positionToSet,
float
materialToSet);
66
PositionMaterialNormal
(
Vector3DFloat
positionToSet,
Vector3DFloat
normalToSet,
float
materialToSet);
67
68
float
getMaterial
(
void
)
const
;
69
const
Vector3DFloat
&
getNormal
(
void
)
const
;
70
const
Vector3DFloat
&
getPosition
(
void
)
const
;
71
72
void
setMaterial
(
float
materialToSet);
73
void
setNormal
(
const
Vector3DFloat
& normalToSet);
74
void
setPosition
(
const
Vector3DFloat
& positionToSet);
75
76
public
:
77
//Nicely fits into seven floats, meaning we
78
//can squeeze in one more for material blending.
79
Vector3DFloat
position
;
80
Vector3DFloat
normal
;
81
float
material
;
//FIXME: This shouldn't be float on CPU?
82
};
83
}
84
85
#endif
Generated by
1.8.1