Merge branch 'feature/cubiquity-version' of https://bitbucket.org/volumesoffun/polyvox.git into develop
This commit is contained in:
commit
1bff5c207c
@ -82,7 +82,7 @@ namespace PolyVox
|
|||||||
struct IndexAndMaterial
|
struct IndexAndMaterial
|
||||||
{
|
{
|
||||||
int32_t iIndex;
|
int32_t iIndex;
|
||||||
int32_t uMaterial; //Should actually use the material type here, but this is ok for now.
|
typename VolumeType::VoxelType uMaterial;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum FaceNames
|
enum FaceNames
|
||||||
@ -113,16 +113,16 @@ namespace PolyVox
|
|||||||
// This is a bit ugly - it seems that the C++03 syntax is different from the C++11 syntax? See this thread: http://stackoverflow.com/questions/6076015/typename-outside-of-template
|
// This is a bit ugly - it seems that the C++03 syntax is different from the C++11 syntax? See this thread: http://stackoverflow.com/questions/6076015/typename-outside-of-template
|
||||||
// Long term we should probably come back to this and if the #ifdef is still needed then maybe it should check for C++11 mode instead of MSVC?
|
// Long term we should probably come back to this and if the #ifdef is still needed then maybe it should check for C++11 mode instead of MSVC?
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh<PositionMaterial>* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded());
|
CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh<PositionMaterial<typename VolumeType::VoxelType> >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded());
|
||||||
#else
|
#else
|
||||||
CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh<PositionMaterial>* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded());
|
CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh<PositionMaterial<typename VolumeType::VoxelType> >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), bool bMergeQuads = true, IsQuadNeeded isQuadNeeded = IsQuadNeeded());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
void execute();
|
void execute();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int32_t addVertex(uint32_t uX, uint32_t uY, uint32_t uZ, uint32_t uMaterial, Array<3, IndexAndMaterial>& existingVertices);
|
int32_t addVertex(uint32_t uX, uint32_t uY, uint32_t uZ, typename VolumeType::VoxelType uMaterial, Array<3, IndexAndMaterial>& existingVertices);
|
||||||
bool performQuadMerging(std::list<Quad>& quads);
|
bool performQuadMerging(std::list<Quad>& quads);
|
||||||
bool mergeQuads(Quad& q1, Quad& q2);
|
bool mergeQuads(Quad& q1, Quad& q2);
|
||||||
|
|
||||||
@ -135,7 +135,7 @@ namespace PolyVox
|
|||||||
Region m_regSizeInVoxels;
|
Region m_regSizeInVoxels;
|
||||||
|
|
||||||
//The surface patch we are currently filling.
|
//The surface patch we are currently filling.
|
||||||
SurfaceMesh<PositionMaterial>* m_meshCurrent;
|
SurfaceMesh<PositionMaterial<typename VolumeType::VoxelType> >* m_meshCurrent;
|
||||||
|
|
||||||
//Used to avoid creating duplicate vertices.
|
//Used to avoid creating duplicate vertices.
|
||||||
Array<3, IndexAndMaterial> m_previousSliceVertices;
|
Array<3, IndexAndMaterial> m_previousSliceVertices;
|
||||||
|
@ -36,7 +36,7 @@ namespace PolyVox
|
|||||||
const uint32_t CubicSurfaceExtractor<VolumeType, IsQuadNeeded>::MaxVerticesPerPosition = 8;
|
const uint32_t CubicSurfaceExtractor<VolumeType, IsQuadNeeded>::MaxVerticesPerPosition = 8;
|
||||||
|
|
||||||
template<typename VolumeType, typename IsQuadNeeded>
|
template<typename VolumeType, typename IsQuadNeeded>
|
||||||
CubicSurfaceExtractor<VolumeType, IsQuadNeeded>::CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh<PositionMaterial>* result, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, bool bMergeQuads, IsQuadNeeded isQuadNeeded)
|
CubicSurfaceExtractor<VolumeType, IsQuadNeeded>::CubicSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh<PositionMaterial<typename VolumeType::VoxelType> >* result, WrapMode eWrapMode, typename VolumeType::VoxelType tBorderValue, bool bMergeQuads, IsQuadNeeded isQuadNeeded)
|
||||||
:m_volData(volData)
|
:m_volData(volData)
|
||||||
,m_regSizeInVoxels(region)
|
,m_regSizeInVoxels(region)
|
||||||
,m_meshCurrent(result)
|
,m_meshCurrent(result)
|
||||||
@ -88,7 +88,7 @@ namespace PolyVox
|
|||||||
{
|
{
|
||||||
uint32_t regX = x - m_regSizeInVoxels.getLowerX();
|
uint32_t regX = x - m_regSizeInVoxels.getLowerX();
|
||||||
|
|
||||||
uint32_t material; //Filled in by callback
|
typename VolumeType::VoxelType material; //Filled in by callback
|
||||||
typename VolumeType::VoxelType currentVoxel = volumeSampler.getVoxel();
|
typename VolumeType::VoxelType currentVoxel = volumeSampler.getVoxel();
|
||||||
typename VolumeType::VoxelType negXVoxel = volumeSampler.peekVoxel1nx0py0pz();
|
typename VolumeType::VoxelType negXVoxel = volumeSampler.peekVoxel1nx0py0pz();
|
||||||
typename VolumeType::VoxelType negYVoxel = volumeSampler.peekVoxel0px1ny0pz();
|
typename VolumeType::VoxelType negYVoxel = volumeSampler.peekVoxel0px1ny0pz();
|
||||||
@ -205,7 +205,7 @@ namespace PolyVox
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename VolumeType, typename IsQuadNeeded>
|
template<typename VolumeType, typename IsQuadNeeded>
|
||||||
int32_t CubicSurfaceExtractor<VolumeType, IsQuadNeeded>::addVertex(uint32_t uX, uint32_t uY, uint32_t uZ, uint32_t uMaterialIn, Array<3, IndexAndMaterial>& existingVertices)
|
int32_t CubicSurfaceExtractor<VolumeType, IsQuadNeeded>::addVertex(uint32_t uX, uint32_t uY, uint32_t uZ, typename VolumeType::VoxelType uMaterialIn, Array<3, IndexAndMaterial>& existingVertices)
|
||||||
{
|
{
|
||||||
for(uint32_t ct = 0; ct < MaxVerticesPerPosition; ct++)
|
for(uint32_t ct = 0; ct < MaxVerticesPerPosition; ct++)
|
||||||
{
|
{
|
||||||
@ -214,14 +214,14 @@ namespace PolyVox
|
|||||||
if(rEntry.iIndex == -1)
|
if(rEntry.iIndex == -1)
|
||||||
{
|
{
|
||||||
//No vertices matched and we've now hit an empty space. Fill it by creating a vertex. The 0.5f offset is because vertices set between voxels in order to build cubes around them.
|
//No vertices matched and we've now hit an empty space. Fill it by creating a vertex. The 0.5f offset is because vertices set between voxels in order to build cubes around them.
|
||||||
rEntry.iIndex = m_meshCurrent->addVertex(PositionMaterial(Vector3DFloat(static_cast<float>(uX) - 0.5f, static_cast<float>(uY) - 0.5f, static_cast<float>(uZ) - 0.5f), uMaterialIn));
|
rEntry.iIndex = m_meshCurrent->addVertex(PositionMaterial<typename VolumeType::VoxelType> (Vector3DFloat(static_cast<float>(uX) - 0.5f, static_cast<float>(uY) - 0.5f, static_cast<float>(uZ) - 0.5f), uMaterialIn));
|
||||||
rEntry.uMaterial = uMaterialIn;
|
rEntry.uMaterial = uMaterialIn;
|
||||||
|
|
||||||
return rEntry.iIndex;
|
return rEntry.iIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
//If we have an existing vertex and the material matches then we can return it.
|
//If we have an existing vertex and the material matches then we can return it.
|
||||||
if(rEntry.uMaterial == static_cast<int32_t>(uMaterialIn))
|
if(rEntry.uMaterial == uMaterialIn)
|
||||||
{
|
{
|
||||||
return rEntry.iIndex;
|
return rEntry.iIndex;
|
||||||
}
|
}
|
||||||
@ -268,7 +268,7 @@ namespace PolyVox
|
|||||||
{
|
{
|
||||||
//All four vertices of a given quad have the same material,
|
//All four vertices of a given quad have the same material,
|
||||||
//so just check that the first pair of vertices match.
|
//so just check that the first pair of vertices match.
|
||||||
if(std::abs(m_meshCurrent->getVertices()[q1.vertices[0]].getMaterial() - m_meshCurrent->getVertices()[q2.vertices[0]].getMaterial()) < 0.001)
|
if(m_meshCurrent->getVertices()[q1.vertices[0]].getMaterial() == m_meshCurrent->getVertices()[q2.vertices[0]].getMaterial())
|
||||||
{
|
{
|
||||||
//Now check whether quad 2 is adjacent to quad one by comparing vertices.
|
//Now check whether quad 2 is adjacent to quad one by comparing vertices.
|
||||||
//Adjacent quads must share two vertices, and the second quad could be to the
|
//Adjacent quads must share two vertices, and the second quad could be to the
|
||||||
|
@ -1,52 +1,52 @@
|
|||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
Copyright (c) 2005-2009 David Williams
|
Copyright (c) 2005-2009 David Williams
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
arising from the use of this software.
|
arising from the use of this software.
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
Permission is granted to anyone to use this software for any purpose,
|
||||||
including commercial applications, and to alter it and redistribute it
|
including commercial applications, and to alter it and redistribute it
|
||||||
freely, subject to the following restrictions:
|
freely, subject to the following restrictions:
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
1. The origin of this software must not be misrepresented; you must not
|
||||||
claim that you wrote the original software. If you use this software
|
claim that you wrote the original software. If you use this software
|
||||||
in a product, an acknowledgment in the product documentation would be
|
in a product, an acknowledgment in the product documentation would be
|
||||||
appreciated but is not required.
|
appreciated but is not required.
|
||||||
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
2. Altered source versions must be plainly marked as such, and must not be
|
||||||
misrepresented as being the original software.
|
misrepresented as being the original software.
|
||||||
|
|
||||||
3. This notice may not be removed or altered from any source
|
3. This notice may not be removed or altered from any source
|
||||||
distribution.
|
distribution.
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
#ifndef __PolyVox_DefaultIsQuadNeeded_H__
|
#ifndef __PolyVox_DefaultIsQuadNeeded_H__
|
||||||
#define __PolyVox_DefaultIsQuadNeeded_H__
|
#define __PolyVox_DefaultIsQuadNeeded_H__
|
||||||
|
|
||||||
#include "PolyVoxCore/Impl/TypeDef.h"
|
#include "PolyVoxCore/Impl/TypeDef.h"
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
namespace PolyVox
|
namespace PolyVox
|
||||||
{
|
{
|
||||||
template<typename VoxelType>
|
template<typename VoxelType>
|
||||||
class DefaultIsQuadNeeded
|
class DefaultIsQuadNeeded
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
bool operator()(VoxelType back, VoxelType front, uint32_t& materialToUse)
|
bool operator()(VoxelType back, VoxelType front, uint32_t& materialToUse)
|
||||||
{
|
{
|
||||||
if((back > 0) && (front == 0))
|
if((back > 0) && (front == 0))
|
||||||
{
|
{
|
||||||
materialToUse = static_cast<uint32_t>(back);
|
materialToUse = static_cast<uint32_t>(back);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //__PolyVox_DefaultIsQuadNeeded_H__
|
#endif //__PolyVox_DefaultIsQuadNeeded_H__
|
@ -41,9 +41,9 @@ namespace PolyVox
|
|||||||
// This is a bit ugly - it seems that the C++03 syntax is different from the C++11 syntax? See this thread: http://stackoverflow.com/questions/6076015/typename-outside-of-template
|
// This is a bit ugly - it seems that the C++03 syntax is different from the C++11 syntax? See this thread: http://stackoverflow.com/questions/6076015/typename-outside-of-template
|
||||||
// Long term we should probably come back to this and if the #ifdef is still needed then maybe it should check for C++11 mode instead of MSVC?
|
// Long term we should probably come back to this and if the #ifdef is still needed then maybe it should check for C++11 mode instead of MSVC?
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh<PositionMaterialNormal>* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType(), Controller controller = Controller());
|
MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh<PositionMaterialNormal<typename Controller::MaterialType> >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType(), Controller controller = Controller());
|
||||||
#else
|
#else
|
||||||
MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh<PositionMaterialNormal>* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), Controller controller = Controller());
|
MarchingCubesSurfaceExtractor(VolumeType* volData, Region region, SurfaceMesh<PositionMaterialNormal<typename Controller::MaterialType> >* result, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType(), Controller controller = Controller());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void execute();
|
void execute();
|
||||||
@ -193,7 +193,7 @@ namespace PolyVox
|
|||||||
uint32_t m_uNoOfOccupiedCells;
|
uint32_t m_uNoOfOccupiedCells;
|
||||||
|
|
||||||
//The surface patch we are currently filling.
|
//The surface patch we are currently filling.
|
||||||
SurfaceMesh<PositionMaterialNormal>* m_meshCurrent;
|
SurfaceMesh<PositionMaterialNormal<typename Controller::MaterialType> >* m_meshCurrent;
|
||||||
|
|
||||||
//Information about the region we are currently processing
|
//Information about the region we are currently processing
|
||||||
Region m_regSizeInVoxels;
|
Region m_regSizeInVoxels;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -132,12 +132,12 @@ namespace PolyVox
|
|||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// PositionMaterial
|
// PositionMaterial
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
class PositionMaterial;
|
template<typename MaterialType> class PositionMaterial;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// PositionMaterialNormal
|
// PositionMaterialNormal
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
class PositionMaterialNormal;
|
template<typename MaterialType> class PositionMaterialNormal;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// RawVolume
|
// RawVolume
|
||||||
|
@ -21,6 +21,8 @@ freely, subject to the following restrictions:
|
|||||||
distribution.
|
distribution.
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
|
#include "PolyVoxCore/Impl/Utility.h"
|
||||||
|
|
||||||
namespace PolyVox
|
namespace PolyVox
|
||||||
{
|
{
|
||||||
template <typename VoxelType>
|
template <typename VoxelType>
|
||||||
|
@ -36,49 +36,107 @@ namespace PolyVox
|
|||||||
#ifdef SWIG
|
#ifdef SWIG
|
||||||
class PositionMaterial
|
class PositionMaterial
|
||||||
#else
|
#else
|
||||||
|
template<typename MaterialType>
|
||||||
class POLYVOX_API PositionMaterial
|
class POLYVOX_API PositionMaterial
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PositionMaterial();
|
PositionMaterial()
|
||||||
PositionMaterial(Vector3DFloat positionToSet, float materialToSet);
|
{
|
||||||
|
}
|
||||||
|
|
||||||
float getMaterial(void) const;
|
PositionMaterial(Vector3DFloat positionToSet, MaterialType materialToSet)
|
||||||
const Vector3DFloat& getPosition(void) const;
|
:position(positionToSet)
|
||||||
|
,material(materialToSet)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void setMaterial(float materialToSet);
|
MaterialType getMaterial(void) const
|
||||||
void setPosition(const Vector3DFloat& positionToSet);
|
{
|
||||||
|
return material;
|
||||||
|
}
|
||||||
|
|
||||||
|
const Vector3DFloat& getPosition(void) const
|
||||||
|
{
|
||||||
|
return position;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setMaterial(MaterialType materialToSet)
|
||||||
|
{
|
||||||
|
material = materialToSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setPosition(const Vector3DFloat& positionToSet)
|
||||||
|
{
|
||||||
|
position = positionToSet;
|
||||||
|
}
|
||||||
public:
|
public:
|
||||||
//Nicely fits into four floats.
|
//Nicely fits into four floats.
|
||||||
Vector3DFloat position;
|
Vector3DFloat position;
|
||||||
float material;
|
MaterialType material;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef SWIG
|
#ifdef SWIG
|
||||||
class PositionMaterialNormal
|
class PositionMaterialNormal
|
||||||
#else
|
#else
|
||||||
|
template<typename MaterialType>
|
||||||
class POLYVOX_API PositionMaterialNormal
|
class POLYVOX_API PositionMaterialNormal
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PositionMaterialNormal();
|
PositionMaterialNormal()
|
||||||
PositionMaterialNormal(Vector3DFloat positionToSet, float materialToSet);
|
{
|
||||||
PositionMaterialNormal(Vector3DFloat positionToSet, Vector3DFloat normalToSet, float materialToSet);
|
}
|
||||||
|
|
||||||
float getMaterial(void) const;
|
PositionMaterialNormal(Vector3DFloat positionToSet, MaterialType materialToSet)
|
||||||
const Vector3DFloat& getNormal(void) const;
|
:position(positionToSet)
|
||||||
const Vector3DFloat& getPosition(void) const;
|
,material(materialToSet)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void setMaterial(float materialToSet);
|
PositionMaterialNormal(Vector3DFloat positionToSet, Vector3DFloat normalToSet, MaterialType materialToSet)
|
||||||
void setNormal(const Vector3DFloat& normalToSet);
|
:position(positionToSet)
|
||||||
void setPosition(const Vector3DFloat& positionToSet);
|
,normal(normalToSet)
|
||||||
|
,material(materialToSet)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
MaterialType getMaterial(void) const
|
||||||
|
{
|
||||||
|
return material;
|
||||||
|
}
|
||||||
|
|
||||||
|
const Vector3DFloat& getNormal(void) const
|
||||||
|
{
|
||||||
|
return normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
const Vector3DFloat& getPosition(void) const
|
||||||
|
{
|
||||||
|
return position;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setMaterial(MaterialType materialToSet)
|
||||||
|
{
|
||||||
|
material = materialToSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setNormal(const Vector3DFloat& normalToSet)
|
||||||
|
{
|
||||||
|
normal = normalToSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setPosition(const Vector3DFloat& positionToSet)
|
||||||
|
{
|
||||||
|
position = positionToSet;
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//Nicely fits into seven floats, meaning we
|
//Nicely fits into seven floats, meaning we
|
||||||
//can squeeze in one more for material blending.
|
//can squeeze in one more for material blending.
|
||||||
Vector3DFloat position;
|
Vector3DFloat position;
|
||||||
Vector3DFloat normal;
|
Vector3DFloat normal;
|
||||||
float material; //FIXME: This shouldn't be float on CPU?
|
MaterialType material; //FIXME: This shouldn't be float on CPU?
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,86 +25,9 @@ freely, subject to the following restrictions:
|
|||||||
|
|
||||||
namespace PolyVox
|
namespace PolyVox
|
||||||
{
|
{
|
||||||
PositionMaterialNormal::PositionMaterialNormal()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
PositionMaterialNormal::PositionMaterialNormal(Vector3DFloat positionToSet, float materialToSet)
|
|
||||||
:position(positionToSet)
|
|
||||||
,material(materialToSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
PositionMaterialNormal::PositionMaterialNormal(Vector3DFloat positionToSet, Vector3DFloat normalToSet, float materialToSet)
|
|
||||||
:position(positionToSet)
|
|
||||||
,normal(normalToSet)
|
|
||||||
,material(materialToSet)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
float PositionMaterialNormal::getMaterial(void) const
|
|
||||||
{
|
|
||||||
return material;
|
|
||||||
}
|
|
||||||
|
|
||||||
const Vector3DFloat& PositionMaterialNormal::getNormal(void) const
|
|
||||||
{
|
|
||||||
return normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
const Vector3DFloat& PositionMaterialNormal::getPosition(void) const
|
|
||||||
{
|
|
||||||
return position;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PositionMaterialNormal::setMaterial(float materialToSet)
|
|
||||||
{
|
|
||||||
material = materialToSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PositionMaterialNormal::setNormal(const Vector3DFloat& normalToSet)
|
|
||||||
{
|
|
||||||
normal = normalToSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PositionMaterialNormal::setPosition(const Vector3DFloat& positionToSet)
|
|
||||||
{
|
|
||||||
position = positionToSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// PositionMaterial
|
// PositionMaterial
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
PositionMaterial::PositionMaterial()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
PositionMaterial::PositionMaterial(Vector3DFloat positionToSet, float materialToSet)
|
|
||||||
:position(positionToSet)
|
|
||||||
,material(materialToSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
float PositionMaterial::getMaterial(void) const
|
|
||||||
{
|
|
||||||
return material;
|
|
||||||
}
|
|
||||||
|
|
||||||
const Vector3DFloat& PositionMaterial::getPosition(void) const
|
|
||||||
{
|
|
||||||
return position;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PositionMaterial::setMaterial(float materialToSet)
|
|
||||||
{
|
|
||||||
material = materialToSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PositionMaterial::setPosition(const Vector3DFloat& positionToSet)
|
|
||||||
{
|
|
||||||
position = positionToSet;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user