Package eas.simulation.spatial.sim2D.physicalSimulation.physicsEngine.net.phys2d.raw.collide

Examples of eas.simulation.spatial.sim2D.physicalSimulation.physicsEngine.net.phys2d.raw.collide.EdgeSweep$CurrentEdges


  protected int[][] getCollisionCandidates(Vector2f[] vertsA, ROVector2f centroid, float radius, ROVector2f circlePos) {
    Vector2f sweepDir = new Vector2f(centroid);
    sweepDir.sub(circlePos);
    sweepDir.normalise(); //TODO: this normalization might not be necessary
   
    EdgeSweep sweep = new EdgeSweep(sweepDir);//vertsA[0], true, true, dist);
   
    sweep.addVerticesToSweep(true, vertsA);
   
    float circProj = circlePos.dot(sweepDir);
   
    sweep.insert(0, false, -radius + circProj);
    sweep.insert(0, false, radius + circProj);

    return sweep.getOverlappingEdges();
  }
View Full Code Here


    // TODO: use a sweepline that has the smallest projection of the box
    // now we use just an arbitrary one
    Vector2f sweepline = new Vector2f(vertsB[1]);
    sweepline.sub(vertsB[2]);
   
    EdgeSweep sweep = new EdgeSweep(sweepline);
   
    sweep.addVerticesToSweep(true, vertsA);
    sweep.addVerticesToSweep(false, vertsB);

    int[][] collEdgeCands = sweep.getOverlappingEdges();
//    FeaturePair[] featurePairs = getFeaturePairs(contacts.length, vertsA, vertsB, collEdgeCands);
//    return populateContacts(contacts, vertsA, vertsB, featurePairs);
   
    Intersection[][] intersections = getIntersectionPairs(vertsA, vertsB, collEdgeCands);   
    return populateContacts(contacts, vertsA, vertsB, intersections);
View Full Code Here

   
    // we use the line's normal for our sweepline projection
    Vector2f normal = new Vector2f(vertsA[1]);
    normal.sub(vertsA[0]);
    normal.set(normal.y, -normal.x);
    EdgeSweep sweep = new EdgeSweep(normal);
    sweep.insert(0, true, vertsA[0].dot(normal));
    sweep.insert(0, true, vertsA[1].dot(normal));
    sweep.addVerticesToSweep(false, vertsB);
    int[][] collEdgeCands = sweep.getOverlappingEdges();
   
    IntersectionGatherer intGath = new IntersectionGatherer(vertsA, vertsB);
    for ( int i = 0; i < collEdgeCands.length; i++ )
      intGath.intersect(collEdgeCands[i][0], collEdgeCands[i][1]);
   
View Full Code Here

    public int[][] getCollisionCandidates(Vector2f[] vertsA, Vector2f[] vertsB,
            Vector2f sweepDirStart, Vector2f sweepDirEnd) {
        Vector2f sweepDir = new Vector2f(sweepDirEnd);
        sweepDir.sub(sweepDirStart);

        return getCollisionCandidates(new EdgeSweep(sweepDir), vertsA, vertsB);
    }
View Full Code Here

TOP

Related Classes of eas.simulation.spatial.sim2D.physicalSimulation.physicsEngine.net.phys2d.raw.collide.EdgeSweep$CurrentEdges

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.