Package toxi.physics2d.behaviors

Examples of toxi.physics2d.behaviors.AttractionBehavior2D


    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


        mousePos.set(mouseX, mouseY);
    }

    public void mousePressed() {
        mousePos = new Vec2D(mouseX, mouseY);
        mouseAttractor = new AttractionBehavior2D(mousePos, 400, 1.2f);
        physics.addBehavior(mouseAttractor);
    }
View Full Code Here

TOP

Related Classes of toxi.physics2d.behaviors.AttractionBehavior2D

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.