示例#1
0
文件: MainClass.cs 项目: jbowwww/JGL
        internal static void TestVector3dClass()
        {
            Vector3d[] v = new Vector3d[8];

            v[0] = new Vector3d(0, 0, 0);
            v[1] = new Vector3d(2, 2, 2);
            v[2] = new Vector3d(new double[] { 3, 3, 3 });
            v[3] = new Vector3d(v[2] * 2);
            v[4] = new[] { 4.4d, 4.4, 4.4 };
            v[5] = new[] { 5.5 , 5.5, 5.5 };
            Write(v);

            v[0].Set(10, 10, 10);
            double[] cmps = v[1].Components;
            cmps = new[] { 20d , 20d, 20d };				// confirms the array that Components property is indeed a value type
            v[2] += new Vector3d(30, 30, 30);
            v[3] = v[0] * 5.5;
            v[5] = (v[4] = v[3] / 5);
            Write(v);
        }
示例#2
0
文件: Vector3d.cs 项目: jbowwww/JGL
 public Vector3d(Vector3d source)
 {
     Set(source);
 }
示例#3
0
文件: Vector3d.cs 项目: jbowwww/JGL
 public Vector3d Set(Vector3d source)
 {
     _components = source._components;
     return this;
 }
示例#4
0
文件: Position.cs 项目: jbowwww/JGL
 /// <summary>
 /// Move Position vector a distance in the given direction
 /// </summary>
 /// <param name="direction">Orientation</param>
 /// <param name="distance">Distance</param>
 /// <remarks>
 /// TODO:
 /// Implement/find your own Vector3d class, use that, move this method into that class. Could leave it here as well and
 /// call the Vector3d member. V3d class will need explicit (and implicit if possible?) conversion operator to OpenTK.Vector3d
 /// </remarks>
 public void Move(Vector3d direction, double distance = 1.0)
 {
     Position += direction * distance;
 }
示例#5
0
文件: Vertex.cs 项目: jbowwww/JGL
 public Vertex(Vector3d source)
     : base(source)
 {
 }
示例#6
0
文件: Normal.cs 项目: jbowwww/JGL
 public Normal(Vector3d source)
     : base(source)
 {
 }