当前位置: 首页>>代码示例>>C#>>正文


C# Vector2d类代码示例

本文整理汇总了C#中Vector2d的典型用法代码示例。如果您正苦于以下问题:C# Vector2d类的具体用法?C# Vector2d怎么用?C# Vector2d使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Vector2d类属于命名空间,在下文中一共展示了Vector2d类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LightWeightPolylineVertex

 /// <summary>
 /// Initializes a new instance of the <c>LightWeightPolylineVertex</c> class.
 /// </summary>
 public LightWeightPolylineVertex()
 {
     this.location = Vector2d.Zero;
     this.bulge = 0.0f;
     this.beginThickness = 0.0f;
     this.endThickness = 0.0f;
 }
开发者ID:fearog,项目名称:axecalc,代码行数:10,代码来源:LightWeightPolylineVertex.cs

示例2: Rotate

        public void Rotate(Vector2d startPoint, Vector2d endPoint)
        {
            var rotation = CalculateRotation(startPoint, endPoint);
            _tempCameraOrientation = rotation.GetRotationMatrix();

            FireCameraChanged();
        }
开发者ID:Valax321,项目名称:SPUD-Engine,代码行数:7,代码来源:TrackballCamera.cs

示例3: Next

 public static Vector2d Next(this Random random, Vector2d min, Vector2d max)
 {
     return new Vector2d(
         min.X + random.NextDouble() * (max.X - min.X),
         min.Y + random.NextDouble() * (max.Y - min.Y)
     );
 }
开发者ID:nicolas-repiquet,项目名称:Granite,代码行数:7,代码来源:Extensions.cs

示例4: Bullet

 public Bullet(Vector2d From, Vector2d To, DateTime st)
 {
     ShootTime = DateTime.Now;
     this.From = From;
     this.To = To;
     this.dir = Vector2d.Normalize(To - From);
 }
开发者ID:hmira,项目名称:gametd,代码行数:7,代码来源:Bullet.cs

示例5: LightWeightPolylineVertex

 /// <summary>
 /// Initializes a new instance of the <c>LightWeightPolylineVertex</c> class.
 /// </summary>
 /// <param name="location">Lightweight polyline <see cref="netDxf.Vector2d">vertex</see> coordinates.</param>
 public LightWeightPolylineVertex(Vector2d location)
 {
     this.location = location;
     this.bulge = 0.0;
     this.beginThickness = 0.0f;
     this.endThickness = 0.0f;
 }
开发者ID:steve-stanton,项目名称:backsight,代码行数:11,代码来源:LightWeightPolylineVertex.cs

示例6: Vertex

 public Vertex(double px, double py, double pz, /*double nx, double ny, double nz,*/ double tcx, double tcy)
 {
     Position = new Vector3d(px, py, pz);
     //Normal = new Vector3d(nx, ny, nz);
     TexCoord = new Vector2d(tcx, tcy);
     Color = Vector4.One;
 }
开发者ID:qwook,项目名称:hungry,代码行数:7,代码来源:VertexBuffer.cs

示例7: TransformToRelative

        public Vector2d TransformToRelative(Vector2d absoluteCoordinate)
        {
            var x = absoluteCoordinate.X / Control.Width * 2 - 1;
            var y = (Control.Height - absoluteCoordinate.Y) / Control.Height * 2 - 1;

            return new Vector2d(x, y);
        }
开发者ID:ChrisJansson,项目名称:ObjLoader,代码行数:7,代码来源:GuiToRelativeCoordinateTransformer.cs

示例8: Loop

        public void Loop(TimeSpan loopTime)
        {
            foreach (var connection in Graph.Connectivities)
            {
                var node1 = connection.Node1;
                var node2 = connection.Node2;

                var distance = Vector2d.GetDistance(node1.Position, node2.Position);
                if (distance < 0.1)
                {
                    // Jitter
                    distance = 0.1;
                }

                var forceS = Settings.DistanceToForceFct(distance);
                forceS *= Settings.ForceFactor;
                forceS *= connection.Connectivity;

                var dX = Math.Max(0.1, node1.Position.X - node2.Position.X);
                var dY = Math.Max(0.1, node1.Position.Y - node2.Position.Y);

                Vector2d force = new Vector2d(forceS * dX / distance, forceS * dY / distance);
                node1.ForceN.AddTo(force.Negate());
                node2.ForceN.AddTo(force);
            }
        }
开发者ID:mbrenn,项目名称:burnsystems.evolutionary,代码行数:26,代码来源:ConnectionForceSimulation.cs

示例9: LineDistSq

	/*
     * Returns the square distance between the given point and the line
     * defined by this segment.
     *
     * @param p a point.
     */
	public double LineDistSq(Vector2d p) 
	{
		Vector2d ap = p - a;
		double dotprod = ab.Dot(ap);
		double projLenSq = dotprod * dotprod / ab.SqrMagnitude();
		return ap.SqrMagnitude() - projLenSq;
	}
开发者ID:kharbechteinn,项目名称:Scatterer,代码行数:13,代码来源:Seg2d.cs

示例10: IsReal

 public static bool IsReal(Vector2d v)
 {
     return !IsNaN(v) && !double.IsPositiveInfinity(v.X) &&
         !double.IsNegativeInfinity(v.X) &&
         !double.IsPositiveInfinity(v.Y) &&
         !double.IsNegativeInfinity(v.Y);
 }
开发者ID:AyyTee,项目名称:Aventyr,代码行数:7,代码来源:Vector2Ext.cs

示例11: Update

 public void Update()
 {
     double elapsed = (DateTime.Now - st).TotalMilliseconds;
     //dir = Vector2d.Normalize(To - From);
     //position = From + ((elapsed * Speed) * dir);
     position = P.GetPosition(elapsed, Speed);
 }
开发者ID:hmira,项目名称:gametd,代码行数:7,代码来源:Enemy.cs

示例12: TransformToRelative

        public Vector2d TransformToRelative(Vector2d absoluteCoordinate)
        {
            var x = absoluteCoordinate.X / Interface.Width * 2 - 1;
            var y = (Interface.Height - absoluteCoordinate.Y) / Interface.Height * 2 - 1;

            return new Vector2d(x, y);
        }
开发者ID:smoothdeveloper,项目名称:ProceduralGeneration,代码行数:7,代码来源:GuiToRelativeCoordinateTransformer.cs

示例13: Vector4d

	public Vector4d(Vector2d v, double z, double w) 
	{ 
		x = v.x; 
		y = v.y; 
		this.z = z;
		this.w = w;
	}
开发者ID:kharbechteinn,项目名称:Scatterer,代码行数:7,代码来源:Vector4d.cs

示例14: Rotate

        public void Rotate(Vector2d startPoint, Vector2d endPoint)
        {
            var rotation = CalculateRotation(startPoint, endPoint);

            var result = Vector3d.Transform(_camera.Position, rotation);
            _camera.Position = result;
        }
开发者ID:HaKDMoDz,项目名称:ProceduralGeneration,代码行数:7,代码来源:TrackballCamera.cs

示例15: Circle

 public static void Circle(Vector2d origin, double radius, double currentZoom = 1, int sides = 0, bool loop = false)
 {
     if (sides < 3)
     {
         if (radius < 20) sides = 16;
         else if (radius < 50) sides = 24;
         else if (radius < 100) sides = 42;
         else if (radius < 300) sides = 64;
         else sides = 128;
     }
     radius /= currentZoom;
     var diff = (2 * Math.PI) / sides;
     var last = new Vector2d(0, 0);
     for (var i = 0; i < sides; i++)
     {
         var deg = diff * i;
         var point = new Vector2d(origin.X + Math.Cos(deg) * radius, origin.Y + Math.Sin(deg) * radius);
         if (i > 0 || loop)
         {
             if (!loop) GL.Vertex2(last);
             GL.Vertex2(point);
         }
         last = point;
     }
     if (loop) return;
     GL.Vertex2(last);
     GL.Vertex2(origin.X + radius, origin.Y);
 }
开发者ID:silky,项目名称:sledge,代码行数:28,代码来源:GLX.cs


注:本文中的Vector2d类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。