Initial
This commit is contained in:
25
engine/ANGLE.CPP
Normal file
25
engine/ANGLE.CPP
Normal file
@@ -0,0 +1,25 @@
|
||||
#include <engine/angle.hpp>
|
||||
|
||||
void Triangle::orderPoints(void)
|
||||
{
|
||||
Point minPoint;
|
||||
WORD minIndex;
|
||||
|
||||
for(int ptIndex=0;ptIndex<VectorPoints;ptIndex++)
|
||||
{
|
||||
if(!ptIndex){minIndex=ptIndex;minPoint=operator[](ptIndex);}
|
||||
else if((operator[](ptIndex).y()<minPoint.y())||(operator[](ptIndex).y()==minPoint.y()&&operator[](ptIndex).x()<minPoint.x()))
|
||||
{
|
||||
minIndex=ptIndex;
|
||||
minPoint=operator[](ptIndex);
|
||||
}
|
||||
}
|
||||
operator[](minIndex)=operator[](0);
|
||||
operator[](0)=minPoint;
|
||||
if((operator[](1).y()<operator[](2).y())||(operator[](1).y()==operator[](2).y()&&operator[](1).x()<operator[](2).x()))
|
||||
{
|
||||
minPoint=operator[](2);
|
||||
operator[](2)=operator[](1);
|
||||
operator[](1)=minPoint;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user