예제 #1
0
	HawkVector2D HawkRect2D::operator [](Int32 iIdx) const
	{
		A_Exception(iIdx>= 0 && iIdx<=3);

		if (iIdx == 0) 
		{
			return Point;
		}
		else if (iIdx == 1) 
		{
			return Point + Edge[0];
		}
		else if (iIdx == 2)
		{
			return Point + Edge[0] + Edge[1];
		}
		else if (iIdx == 3)
		{
			return Point + Edge[1];
		}
		return HawkVector2D();
	}
예제 #2
0
	//默认构造函数
	HawkRect2D::HawkRect2D()
	{ 
		Point = HawkVector2D(0,0);
		Edge[0] = HawkVector2D(1,0);
		Edge[1] = HawkVector2D(0,1);
	};
예제 #3
0
	void  HawkRect2D::Clear()
	{
		Point = HawkVector2D(0,0);
		Edge[0] = HawkVector2D(1,0);
		Edge[1] = HawkVector2D(0,1);
	}
예제 #4
0
//默认构造
HawkRay2D::HawkRay2D() : Point(HawkVector2D()),Direction(HawkVector2D())
{
}
예제 #5
0
	void HawkTransform::Rotate(HawkRect2D& oRect,const HawkVector2D& oRefPt,const HawkRadian& oRad)
	{
		Rotate(oRect.Point,oRefPt,oRad);
		Rotate(oRect.Edge[0],HawkVector2D(0,0),oRad);
		Rotate(oRect.Edge[1],HawkVector2D(0,0),oRad);
	}
예제 #6
0
	void HawkTransform::Rotate(HawkTriangle2D& oTrig,const HawkVector2D& oRefPt,const HawkRadian& oRad)
	{
		Rotate(oTrig.Point,oRefPt,oRad);
		Rotate(oTrig.Edge[0],HawkVector2D(0,0),oRad);
		Rotate(oTrig.Edge[1],HawkVector2D(0,0),oRad);
	}
예제 #7
0
	void HawkTransform::Rotate(HawkRay2D& oRay,const HawkVector2D& oRefPt,const HawkRadian& oRad)
	{
		Rotate(oRay.Point,oRefPt,oRad);
		Rotate(oRay.Direction,HawkVector2D(0,0),oRad);
	}
예제 #8
0
	void HawkTransform::Rotate(HawkLine2D& oLine,const HawkVector2D& oRefPt,const HawkRadian& oRad)
	{
		Rotate(oLine.Point,oRefPt,oRad);
		Rotate(oLine.Direction,HawkVector2D(0,0),oRad);
	}