Package engine.geometry

Examples of engine.geometry.Vector.divide()


        this.velocity = new Vector(0, 0);
    }

    public final void applyImpulse(final Vector impulse) {
        Vector deltaVelocity = new Vector(impulse);
        deltaVelocity.divide(mass);
        velocity.add(deltaVelocity);
    }
   
    public final void addVelocity(final Vector deltaVelocity) {
        velocity.add(deltaVelocity);
View Full Code Here


        // find first intersect with axis clockwise of normal
        Vector end = new Vector (-b*normal.getX() - a*normal.getY(), -b*normal.getY() + a*normal.getX());
       
        // normalise
        start.divide(c);
        end.divide(c);
       
        return new Collision(start, end, distance < 0);
    }
   
    /* Collision with single shape */
 
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.