Add previousVoxel to raycast result.
Thanks to Sceptrix for the patch http://thermite3d.org/phpBB3/viewtopic.php?t=243
This commit is contained in:
parent
0c97756a0c
commit
e4535b1255
@ -41,6 +41,7 @@ namespace PolyVox
|
|||||||
bool foundIntersection;
|
bool foundIntersection;
|
||||||
///If an intersection was found then this field holds the intersecting voxel, otherwise it is undefined.
|
///If an intersection was found then this field holds the intersecting voxel, otherwise it is undefined.
|
||||||
Vector3DInt32 intersectionVoxel;
|
Vector3DInt32 intersectionVoxel;
|
||||||
|
Vector3DInt32 previousVoxel;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// The Raycast class can be used to find the fist filled voxel along a given path.
|
/// The Raycast class can be used to find the fist filled voxel along a given path.
|
||||||
|
@ -143,6 +143,7 @@ namespace PolyVox
|
|||||||
m_result.intersectionVoxel = Vector3DInt32(i,j,k);
|
m_result.intersectionVoxel = Vector3DInt32(i,j,k);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
m_result.previousVoxel = Vector3DInt32(i,j,k);
|
||||||
|
|
||||||
if(tx <= ty && tx <= tz)
|
if(tx <= ty && tx <= tz)
|
||||||
{
|
{
|
||||||
@ -174,5 +175,6 @@ namespace PolyVox
|
|||||||
//Didn't hit anything
|
//Didn't hit anything
|
||||||
m_result.foundIntersection = false;
|
m_result.foundIntersection = false;
|
||||||
m_result.intersectionVoxel = Vector3DInt32(0,0,0);
|
m_result.intersectionVoxel = Vector3DInt32(0,0,0);
|
||||||
|
m_result.previousVoxel = Vector3DInt32(0,0,0);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user