Package org.cmj.flowy.simulation.math

Examples of org.cmj.flowy.simulation.math.Vector2.normalize()


    private Vector2 getEmittedParticleVelocity() {
        float dist = (float) RAND.nextDouble() * theDistribution - theDistribution * 0.5f;
        Vector2 normal = theDirection.PerpendicularRight();
        normal = Vector2.Mult(normal, dist);
        Vector2 particleVelocity = Vector2.Add(theDirection, normal);
        particleVelocity.normalize();
        float velLen = (float) RAND.nextDouble() * (theMaxVelocity - theMinVelocity) + theMinVelocity;
        particleVelocity.multiply(velLen);
        return particleVelocity;
    }

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.