private Vector2D VectorToWorldSpace(Vector2D vec, Vector2D AgentHeading, Vector2D AgentSide) { //make a copy of the point Vector2D TransVec = new Vector2D(vec.X, vec.Y); ; //create a transformation matrix C2DMatrix matTransform = new C2DMatrix(); //rotate matTransform.Rotate(AgentHeading, AgentSide); //now transform the vertices matTransform.TransformVector2D(TransVec); return TransVec; }
private Vector2D PointToWorldSpace(Vector2D point, Vector2D AgentHeading, Vector2D AgentSide, Vector2D AgentPosition) { //make a copy of the point Vector2D TransPoint = new Vector2D(point.X, point.Y); ; //create a transformation matrix C2DMatrix matTransform = new C2DMatrix(); //rotate matTransform.Rotate(AgentHeading, AgentSide); //and translate matTransform.Translate(AgentPosition.X, AgentPosition.Y); //now transform the vertices matTransform.TransformVector2D(TransPoint); return TransPoint; }