예제 #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)
 {
 }