Package engine.geometry

Examples of engine.geometry.Vector.flip()


       
        // SAT axes for static shape
        int sSize = s.getSize();
        for (int i=0; i<sSize; i++) {
            s.getNormal(i, normal);
            normal.flip();
            double distance = Physics.minProjection(s, normal) - Physics.maxProjection(d, normal);
            collisions.add(axisCollision (normal, distance, velocity));
        }
       
        return Collision.merge(collisions, false); // collision if overlapping all axes
View Full Code Here


        final int size2 = relDynamic.getSize();
        for (int i = 0; i < size2; i++) {
            n = relDynamic.getNormal(i);

            double nDistance = relDynamic.getMaxProjection(i) - Physics.minProjection(relStatic, n);
            n.flip();
            double nVelocity = relVelocity.dot(n);
            double nTime = nDistance / nVelocity;

            if (Rough.equal(nDistance, 0) && Rough.equal(nVelocity, 0)) {
                // Sliding along this face
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.