Package toxi.physics2d

Examples of toxi.physics2d.VerletParticle2D


    private Vec2D mousePos;

    private AttractionBehavior2D mouseAttractor;

    private void addParticle() {
        VerletParticle2D p = new VerletParticle2D(Vec2D.randomVector().scale(5)
                .addSelf(width * 0.5f, 0));
        physics.addParticle(p);
        // add a negative attraction force field around the new particle
        physics.addBehavior(new AttractionBehavior2D(p, 30, -1.2f, 0.01f));
    }
View Full Code Here

TOP

Related Classes of toxi.physics2d.VerletParticle2D

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.