TransformPoint() public method

Transform a 2D point.
public TransformPoint ( Vector2f point ) : Vector2f
point Vector2f Point to transform
return Vector2f
Ejemplo n.º 1
0
 /// <summary>
 /// Calculate the corner positions based on the transform of the parent object
 /// </summary>
 /// <param name="parentTransform">Transformation of the parent</param>
 public void UpdateTransform(Transform parentTransform)
 {
     //init array if its still uninitialized
     if (Position == null)
         Position = new Vector2f[4];
     //for every corner
     for(int i=0;i<4;++i)
     {
         //translate the base corner with the parents transform
         Position[i]=parentTransform.TransformPoint(BatchedDrawable.Corners[i]);
     }
 }
Ejemplo n.º 2
0
 public Vector2f GetCenter(Transform transform)
 {
     return transform.TransformPoint(Position + size / 2);
 }