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(); }
//默认构造函数 HawkRect2D::HawkRect2D() { Point = HawkVector2D(0,0); Edge[0] = HawkVector2D(1,0); Edge[1] = HawkVector2D(0,1); };
void HawkRect2D::Clear() { Point = HawkVector2D(0,0); Edge[0] = HawkVector2D(1,0); Edge[1] = HawkVector2D(0,1); }
//默认构造 HawkRay2D::HawkRay2D() : Point(HawkVector2D()),Direction(HawkVector2D()) { }
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); }
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); }
void HawkTransform::Rotate(HawkRay2D& oRay,const HawkVector2D& oRefPt,const HawkRadian& oRad) { Rotate(oRay.Point,oRefPt,oRad); Rotate(oRay.Direction,HawkVector2D(0,0),oRad); }
void HawkTransform::Rotate(HawkLine2D& oLine,const HawkVector2D& oRefPt,const HawkRadian& oRad) { Rotate(oLine.Point,oRefPt,oRad); Rotate(oLine.Direction,HawkVector2D(0,0),oRad); }