Eliminated dome calls to getVoxelAt.
This commit is contained in:
parent
45af7a4246
commit
efb6d12fc8
@ -40,7 +40,7 @@ bool testVoxelValidator(const VolumeType* volData, const Vector3DInt32& v3dPos)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
typename VolumeType::VoxelType voxel = volData->getVoxelAt(v3dPos);
|
typename VolumeType::VoxelType voxel = volData->getVoxel<WrapModes::None>(v3dPos);
|
||||||
if(voxel != 0)
|
if(voxel != 0)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@ -109,6 +109,12 @@ public:
|
|||||||
{
|
{
|
||||||
return mVolumeData[uXPos][uYPos][uZPos];
|
return mVolumeData[uXPos][uYPos][uZPos];
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
// Should never happen
|
||||||
|
POLYVOX_ASSERT(false, "Invalid wrap mode");
|
||||||
|
return VoxelType();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -146,23 +152,6 @@ public:
|
|||||||
return getVoxel(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), eWrapMode, tBorder);
|
return getVoxel(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), eWrapMode, tBorder);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Gets the value used for voxels which are outside the volume
|
|
||||||
VoxelType getBorderValue(void) const { return 0; }
|
|
||||||
/// Gets a voxel at the position given by <tt>x,y,z</tt> coordinates
|
|
||||||
VoxelType getVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos) const
|
|
||||||
{
|
|
||||||
if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos)))
|
|
||||||
{
|
|
||||||
return mVolumeData[uXPos][uYPos][uZPos];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return getBorderValue();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// Gets a voxel at the position given by a 3D vector
|
|
||||||
VoxelType getVoxelAt(const Vector3DInt32& v3dPos) const { return getVoxelAt(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ()); }
|
|
||||||
|
|
||||||
/// Sets the value used for voxels which are outside the volume
|
/// Sets the value used for voxels which are outside the volume
|
||||||
void setBorderValue(const VoxelType& tBorder) { }
|
void setBorderValue(const VoxelType& tBorder) { }
|
||||||
/// Sets the voxel at the position given by <tt>x,y,z</tt> coordinates
|
/// Sets the voxel at the position given by <tt>x,y,z</tt> coordinates
|
||||||
|
Loading…
x
Reference in New Issue
Block a user