Switched to floats for vetex positions ready for mesh smoothing.
Added new way to detect duplicate vertices but it's not enabled as it doesn't work yet...
This commit is contained in:
@ -22,7 +22,12 @@ namespace PolyVox
|
||||
VoxelType voxel1nz = volIter.peekVoxel0px0py1nz() > 0 ? 1: 0;
|
||||
VoxelType voxel1pz = volIter.peekVoxel0px0py1pz() > 0 ? 1: 0;
|
||||
|
||||
return Vector3DFloat(int(voxel1px) - int(voxel1nx),int(voxel1py) - int(voxel1ny),int(voxel1pz) - int(voxel1nz));
|
||||
return Vector3DFloat
|
||||
(
|
||||
static_cast<float>(voxel1px) - static_cast<float>(voxel1nx),
|
||||
static_cast<float>(voxel1py) - static_cast<float>(voxel1ny),
|
||||
static_cast<float>(voxel1pz) - static_cast<float>(voxel1nz)
|
||||
);
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
@ -114,6 +119,6 @@ namespace PolyVox
|
||||
weights[0][2][2] * ( pVoxel1px1py1nz) + weights[2][2][2] *
|
||||
( pVoxel1px1py1pz));
|
||||
|
||||
return Vector3DFloat(xGrad,yGrad,zGrad);
|
||||
return Vector3DFloat(static_cast<float>(xGrad),static_cast<float>(yGrad),static_cast<float>(zGrad));
|
||||
}
|
||||
}
|
@ -26,6 +26,9 @@ namespace PolyVox
|
||||
std::vector<SurfaceVertex> m_vecVertices;
|
||||
|
||||
static long int vertexIndices[POLYVOX_REGION_SIDE_LENGTH*2+1][POLYVOX_REGION_SIDE_LENGTH*2+1][POLYVOX_REGION_SIDE_LENGTH*2+1];
|
||||
static boost::int32_t vertexIndicesX[POLYVOX_REGION_SIDE_LENGTH][POLYVOX_REGION_SIDE_LENGTH][POLYVOX_REGION_SIDE_LENGTH];
|
||||
static boost::int32_t vertexIndicesY[POLYVOX_REGION_SIDE_LENGTH][POLYVOX_REGION_SIDE_LENGTH][POLYVOX_REGION_SIDE_LENGTH];
|
||||
static boost::int32_t vertexIndicesZ[POLYVOX_REGION_SIDE_LENGTH][POLYVOX_REGION_SIDE_LENGTH][POLYVOX_REGION_SIDE_LENGTH];
|
||||
|
||||
static long int noOfVerticesSubmitted;
|
||||
static long int noOfVerticesAccepted;
|
||||
@ -33,6 +36,9 @@ namespace PolyVox
|
||||
|
||||
long int getSizeInBytes(void);
|
||||
|
||||
boost::int32_t getIndexFor(const Vector3DFloat& pos);
|
||||
void setIndexFor(const Vector3DFloat& pos, boost::int32_t newIndex);
|
||||
|
||||
private:
|
||||
bool m_AllowDuplicateVertices;
|
||||
};
|
||||
|
Reference in New Issue
Block a user