Scaled vertices to always be integers.

This commit is contained in:
David Williams
2007-08-31 21:10:24 +00:00
parent 5f836e0c31
commit c1286a7847
5 changed files with 90 additions and 61 deletions

View File

@ -6,12 +6,12 @@ namespace Ogre
{
}
SurfaceVertex::SurfaceVertex(Vector3 positionToSet)
SurfaceVertex::SurfaceVertex(UIntVector3 positionToSet)
:position(positionToSet)
{
}
SurfaceVertex::SurfaceVertex(Vector3 positionToSet, Vector3 normalToSet)
SurfaceVertex::SurfaceVertex(UIntVector3 positionToSet, Vector3 normalToSet)
:position(positionToSet)
,normal(normalToSet)
{
@ -20,21 +20,21 @@ namespace Ogre
bool SurfaceVertex::operator==(const SurfaceVertex& rhs) const
{
//We dont't check the normal here as it may not have been set. But if two vertices have the same position they should have the same normal too.
return
/*return
(
(abs(position.x - rhs.position.x) <= 0.01) &&
(abs(position.y - rhs.position.y) <= 0.01) &&
(abs(position.z - rhs.position.z) <= 0.01) &&
(abs(alpha - rhs.alpha) <= 0.01)
);
);*/
/*return
return
(
(position.x == rhs.position.x) &&
(position.x == rhs.position.y) &&
(position.x == rhs.position.z) &&
(alpha == rhs.alpha)
);*/
(abs(alpha - rhs.alpha) <= 0.01)
);
}
bool SurfaceVertex::operator < (const SurfaceVertex& rhs) const