Package org.xith3d.physics.collision

Examples of org.xith3d.physics.collision.Collision


           
            ArrayList<Collision> collisions = collisionEngine.checkCollisions(collisionSpace, false);
           
            for (int i = 0; i < collisions.size(); i++) {
               
                final Collision collision = collisions.get(i);
               
                /*
                 *  Fix position of both digibots
                 *  Note : obese digibots are less displaced
                 *  in case of collision : hey, they must have
                 *  at least one advantage, isn't it ?
                 */
               
                Digibot d1 = collideableMap.get(collision.getCollideable1());
                reaction1.set(collision.getNormal());
                reaction1.scale(collision.getDepth() * frameTime / 55f * REACTIVITY
                        * (d1.getGenome().getDominance().alleleB ? .5f : 1f));
                pos1.set(d1.getPos());
                pos1.add(reaction1);
                d1.setPos(pos1);
               
                Digibot d2 = collideableMap.get(collision.getCollideable2());
                reaction2.set(collision.getNormal());
                reaction2.negate();
                reaction2.scale(collision.getDepth() * frameTime / 55f * REACTIVITY
                        * (d2.getGenome().getDominance().alleleB ? .5f : 1f));
                pos2.set(d2.getPos());
                pos2.add(reaction2);
                d2.setPos(pos2);
               
View Full Code Here

TOP

Related Classes of org.xith3d.physics.collision.Collision

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.