Removed IntegralVector3.h
This commit is contained in:
parent
e180f67bae
commit
cc4902b4d7
@ -19,7 +19,6 @@ SET(INC_FILES
|
||||
include/Constants.h
|
||||
include/ForwardDeclarations.h
|
||||
include/IndexedSurfacePatch.h
|
||||
include/IntegralVector3.h
|
||||
include/MarchingCubesTables.h
|
||||
include/PolyVoxSceneManager.h
|
||||
include/RegionGeometry.h
|
||||
|
@ -1,114 +0,0 @@
|
||||
/******************************************************************************
|
||||
This file is part of a voxel plugin for OGRE
|
||||
Copyright (C) 2006 David Williams
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
******************************************************************************/
|
||||
#ifndef __IntegralVector3_H__
|
||||
#define __IntegralVector3_H__
|
||||
|
||||
#include "boost/cstdint.hpp"
|
||||
|
||||
#include "Vector.h"
|
||||
|
||||
namespace PolyVox
|
||||
{
|
||||
template <typename Type> class IntegralVector3
|
||||
{
|
||||
public:
|
||||
IntegralVector3()
|
||||
:x(0)
|
||||
,y(0)
|
||||
,z(0)
|
||||
{
|
||||
}
|
||||
|
||||
IntegralVector3(Type xToSet, Type yToSet, Type zToSet)
|
||||
:x(xToSet)
|
||||
,y(yToSet)
|
||||
,z(zToSet)
|
||||
{
|
||||
}
|
||||
|
||||
void setData(Type xToSet, Type yToSet, Type zToSet)
|
||||
{
|
||||
x = xToSet;
|
||||
y = yToSet;
|
||||
z = zToSet;
|
||||
}
|
||||
|
||||
bool operator==(const IntegralVector3<Type>& rhs) const throw()
|
||||
{
|
||||
return ((x == rhs.x) && (y == rhs.y) && (z == rhs.z));
|
||||
}
|
||||
|
||||
bool operator<(const IntegralVector3<Type>& rhs) const throw()
|
||||
{
|
||||
if(x != rhs.x)
|
||||
return (x < rhs.x);
|
||||
else if(y != rhs.y)
|
||||
return (y < rhs.y);
|
||||
else if(z != rhs.z)
|
||||
return (z < rhs.z);
|
||||
else
|
||||
return false; //They are equal
|
||||
}
|
||||
|
||||
Vector3DFloat toVector3DFloat(void) const
|
||||
{
|
||||
return Vector3DFloat(x, y, z);
|
||||
}
|
||||
|
||||
Type x;
|
||||
Type y;
|
||||
Type z;
|
||||
};
|
||||
|
||||
template <typename Type>
|
||||
IntegralVector3<Type> operator-(const IntegralVector3<Type>& lhs, const IntegralVector3<Type>& rhs)
|
||||
{
|
||||
IntegralVector3<Type> result;
|
||||
|
||||
result.x = lhs.x - rhs.x;
|
||||
result.y = lhs.y - rhs.y;
|
||||
result.z = lhs.z - rhs.z;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename Type>
|
||||
IntegralVector3<Type> operator+(const IntegralVector3<Type>& lhs, const IntegralVector3<Type>& rhs)
|
||||
{
|
||||
IntegralVector3<Type> result;
|
||||
|
||||
result.x = lhs.x + rhs.x;
|
||||
result.y = lhs.y + rhs.y;
|
||||
result.z = lhs.z + rhs.z;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
typedef IntegralVector3<char> CharVector3;
|
||||
typedef IntegralVector3<short> ShortVector3;
|
||||
typedef IntegralVector3<int> IntVector3;
|
||||
typedef IntegralVector3<long> LongVector3;
|
||||
|
||||
typedef IntegralVector3<boost::uint8_t> UCharVector3;
|
||||
typedef IntegralVector3<boost::uint16_t> UShortVector3;
|
||||
typedef IntegralVector3<boost::uint16_t> UIntVector3;
|
||||
typedef IntegralVector3<boost::uint32_t> ULongVector3;
|
||||
}
|
||||
|
||||
#endif
|
@ -73,7 +73,7 @@ namespace PolyVox
|
||||
void generateMeshDataForRegion(boost::uint16_t regionX,boost:: uint16_t regionY, boost::uint16_t regionZ, IndexedSurfacePatch* singleMaterialPatch, IndexedSurfacePatch* multiMaterialPatch) const;
|
||||
|
||||
bool containsPoint(Vector3DFloat pos, float boundary);
|
||||
bool containsPoint(IntVector3 pos, boost::uint16_t boundary);
|
||||
bool containsPoint(Vector3DInt32 pos, boost::uint16_t boundary);
|
||||
|
||||
|
||||
|
||||
|
@ -21,7 +21,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#define __RegionGeometry_H__
|
||||
|
||||
#include "IndexedSurfacePatch.h"
|
||||
#include "IntegralVector3.h"
|
||||
|
||||
namespace PolyVox
|
||||
{
|
||||
|
@ -22,8 +22,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
#include "TypeDef.h"
|
||||
|
||||
#include "IntegralVector3.h"
|
||||
#include "SurfaceTypes.h"
|
||||
#include "Vector.h"
|
||||
|
||||
namespace PolyVox
|
||||
{
|
||||
|
@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#include "Block.h"
|
||||
#include "Constants.h"
|
||||
#include "TypeDef.h"
|
||||
#include "IntegralVector3.h"
|
||||
#include "Vector.h"
|
||||
|
||||
namespace PolyVox
|
||||
{
|
||||
@ -45,7 +45,7 @@ namespace PolyVox
|
||||
Block* getBlock(boost::uint16_t index);
|
||||
|
||||
bool containsPoint(Vector3DFloat pos, float boundary);
|
||||
bool containsPoint(IntVector3 pos, boost::uint16_t boundary);
|
||||
bool containsPoint(Vector3DInt32 pos, boost::uint16_t boundary);
|
||||
|
||||
bool loadFromFile(const std::string& sFilename);
|
||||
bool saveToFile(const std::string& sFilename);
|
||||
|
@ -22,6 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#include "boost/cstdint.hpp"
|
||||
|
||||
#include "TypeDef.h"
|
||||
#include "Vector.h"
|
||||
|
||||
namespace PolyVox
|
||||
{
|
||||
|
@ -685,7 +685,7 @@ namespace PolyVox
|
||||
|
||||
uint8_t PolyVoxSceneManager::getMaterialIndexAt(uint16_t uX, uint16_t uY, uint16_t uZ)
|
||||
{
|
||||
if(volumeData->containsPoint(IntVector3(uX,uY,uZ),0))
|
||||
if(volumeData->containsPoint(Vector3DInt32(uX,uY,uZ),0))
|
||||
{
|
||||
VolumeIterator volIter(*volumeData);
|
||||
return volIter.getVoxelAt(uX,uY,uZ);
|
||||
@ -706,7 +706,7 @@ namespace PolyVox
|
||||
return volumeData->containsPoint(pos, boundary);
|
||||
}
|
||||
|
||||
bool PolyVoxSceneManager::containsPoint(IntVector3 pos, uint16_t boundary)
|
||||
bool PolyVoxSceneManager::containsPoint(Vector3DInt32 pos, uint16_t boundary)
|
||||
{
|
||||
return volumeData->containsPoint(pos, boundary);
|
||||
}
|
||||
|
@ -17,7 +17,6 @@ along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
******************************************************************************/
|
||||
|
||||
#include "IntegralVector3.h"
|
||||
#include "Volume.h"
|
||||
#include "VolumeIterator.h"
|
||||
|
||||
@ -148,14 +147,14 @@ namespace PolyVox
|
||||
&& (pos.z() > boundary);
|
||||
}
|
||||
|
||||
bool Volume::containsPoint(IntVector3 pos, uint16_t boundary)
|
||||
bool Volume::containsPoint(Vector3DInt32 pos, uint16_t boundary)
|
||||
{
|
||||
return (pos.x < OGRE_VOLUME_SIDE_LENGTH - 1 - boundary)
|
||||
&& (pos.y < OGRE_VOLUME_SIDE_LENGTH - 1 - boundary)
|
||||
&& (pos.z < OGRE_VOLUME_SIDE_LENGTH - 1 - boundary)
|
||||
&& (pos.x > boundary)
|
||||
&& (pos.y > boundary)
|
||||
&& (pos.z > boundary);
|
||||
return (pos.x() < OGRE_VOLUME_SIDE_LENGTH - 1 - boundary)
|
||||
&& (pos.y() < OGRE_VOLUME_SIDE_LENGTH - 1 - boundary)
|
||||
&& (pos.z() < OGRE_VOLUME_SIDE_LENGTH - 1 - boundary)
|
||||
&& (pos.x() > boundary)
|
||||
&& (pos.y() > boundary)
|
||||
&& (pos.z() > boundary);
|
||||
}
|
||||
|
||||
bool Volume::loadFromFile(const std::string& sFilename)
|
||||
|
Loading…
x
Reference in New Issue
Block a user