コード例 #1
0
ファイル: Raycast.cpp プロジェクト: holocronweaver/OgreVox
bool Raycast::operator()(
  const PolyVox::PagedVolume<BYTE>::Sampler& sampler)
{
  // If the ray is inside the volume then check if it has hit a solid voxel.
  //if(!sampler.isCurrentPositionValid())
  //{
  if(sampler.getVoxel() > 0) { // You can replace this with your own condition if you want to.
    // setVoxel
    // getVoxel
    position = sampler.getPosition();
    // We've hit something, so stop traversing.
    return false;
  }
  //}

  // By default we continue traversing.
  return true;
}
コード例 #2
0
	bool ColoredCubesRaycastTestFunctor::operator()(const ::PolyVox::PagedVolume<Color>::Sampler& sampler)
	{
		mLastPos = sampler.getPosition();

		return sampler.getVoxel().getAlpha() == 0;
	}