Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public Vector3d(Vector3d source)
 {
     Set(source);
 }
Exemplo n.º 3
0
 public Vector3d Set(Vector3d source)
 {
     _components = source._components;
     return this;
 }
Exemplo n.º 4
0
 /// <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;
 }
Exemplo n.º 5
0
 public Vertex(Vector3d source)
     : base(source)
 {
 }
Exemplo n.º 6
0
 public Normal(Vector3d source)
     : base(source)
 {
 }