示例#1
0
文件: Camera.cs 项目: tivtag/Fly
        public Atom.Math.Vector2 Project(Atom.Math.Vector2 point)
        {
            Vector3 projected = this.device.Viewport.Project(
                new Vector3(point.X, point.Y, 0),
                this.Projection, this.View, Matrix.Identity
                );

            return(new Atom.Math.Vector2(projected.X, projected.Y));
        }
示例#2
0
        public void ScaleTo(Atom.Math.Vector2 factor)
        {
            var desc = this.fixtureDescriptor as IScaleable;

            if (desc != null)
            {
                desc.ScaleTo(factor);
                this.Generate();
            }
        }
示例#3
0
文件: Camera.cs 项目: tivtag/Fly
        public Atom.Math.Vector2 UnprojectIdentity(Atom.Math.Vector2 point)
        {
            var     identity  = Matrix.Identity;
            Vector3 projected = this.device.Viewport.Unproject(
                new Vector3(point.X, point.Y, 0),
                this.Projection, identity, identity
                );

            return(new Atom.Math.Vector2(projected.X, projected.Y));
        }
示例#4
0
 public bool IntersectsAt(Atom.Math.Vector2 point)
 {
     if (fixture != null)
     {
         var p = point.ToXna();
         return(fixture.TestPoint(ref p));
     }
     else
     {
         return(false);
     }
 }
示例#5
0
 public void ScaleTo(Atom.Math.Vector2 factor)
 {
     this.Radius = factor.Length * 0.05f;
 }
示例#6
0
 public void ScaleTo(Atom.Math.Vector2 factor)
 {
     this.Width  = Atom.Math.MathUtilities.Clamp(Math.Abs(factor.X), 1, 1000);
     this.Height = Atom.Math.MathUtilities.Clamp(Math.Abs(factor.Y), 1, 1000);
 }