Esempio n. 1
0
        public static Vector2D PointToWorldSpace(Vector2D point, Vector2D agentHeading, Vector2D agentSide, Vector2D agentPosition)
        {
            Vector2D  transPoint   = point;
            C2DMatrix matTransform = new C2DMatrix();

            matTransform.Rotate(agentHeading, agentSide);
            matTransform.Translate(agentPosition.x, agentPosition.y);
            matTransform.TransformVector2Ds(ref transPoint);
            return(transPoint);
        }
Esempio n. 2
0
        public static Vector2D PointToWorldSpace(Vector2D point, Vector2D AgentHeading, Vector2D AgentSide, Vector2D AgentPosition)
        {
            //make a copy of the point
            Vector2D TransPoint = point;

            //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.TransformVector2Ds(TransPoint);

            return(TransPoint);
        }