Ejemplo n.º 1
0
 public CollisionPoint(
     VertexProperties collisionPointA,
     VertexProperties collisionPointB)
 {
     CollisionPointA = collisionPointA;
     CollisionPointB = collisionPointB;
 }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            var collisionEngine = new GJK(3, 1E-6, 0.09);

            var obj1 = new VertexProperties[8];

            obj1[0] = new VertexProperties(new Vector3d(-1.0, -2.0, 1.0));
            obj1[1] = new VertexProperties(new Vector3d(-1.0, 2.0, 1.0));
            obj1[2] = new VertexProperties(new Vector3d(1.0, 2.0, 1.0));
            obj1[3] = new VertexProperties(new Vector3d(1.0, -2.0, 1.0));
            obj1[4] = new VertexProperties(new Vector3d(-1.0, -2.0, -1.0));
            obj1[5] = new VertexProperties(new Vector3d(-1.0, 2.0, -1.0));
            obj1[6] = new VertexProperties(new Vector3d(1.0, 2.0, -1.0));
            obj1[7] = new VertexProperties(new Vector3d(1.0, -2.0, -1.0));

            var obj2 = new VertexProperties[8];

            obj2[0] = new VertexProperties(new Vector3d(3.0, -2.0, 1.0));
            obj2[1] = new VertexProperties(new Vector3d(3.0, 2.0, 1.0));
            obj2[2] = new VertexProperties(new Vector3d(5.0, 2.0, 1.0));
            obj2[3] = new VertexProperties(new Vector3d(5.0, -2.0, 1.0));
            obj2[4] = new VertexProperties(new Vector3d(3.0, -2.0, -1.0));
            obj2[5] = new VertexProperties(new Vector3d(3.0, 2.0, -1.0));
            obj2[6] = new VertexProperties(new Vector3d(5.0, 2.0, -1.0));
            obj2[7] = new VertexProperties(new Vector3d(5.0, -2.0, -1.0));

            var res = collisionEngine.Execute(obj1, obj2);
        }
Ejemplo n.º 3
0
 public CollisionPointOutput(
     Vector3d dist,
     VertexProperties a,
     VertexProperties b,
     Vector3d normal)
 {
     this.Dist   = dist;
     this.A      = a;
     this.B      = b;
     this.Normal = normal;
 }
Ejemplo n.º 4
0
 public void SetB(VertexProperties b)
 {
     this.B = b;
 }
Ejemplo n.º 5
0
 public void SetA(VertexProperties a)
 {
     this.A = a;
 }