Package toxi.physics2d.behaviors

Examples of toxi.physics2d.behaviors.GravityBehavior2D


        frameRate(999);
        gfx = new ToxiclibsSupport(this);
        physics = new VerletPhysics2D();
        physics.setDrag(0.1f);
        physics.setWorldBounds(new Rect(0, 0, width, height));
        physics.addBehavior(new GravityBehavior2D(new Vec2D(0, 0.15f)));
        physics.setIndex(new PointQuadtree(null, 0, 0, width + 1, height + 1));
        // physics.setIndex(new SpatialBins<Vec2D>(0, width, 80,
        // new CoordinateExtractor<Vec2D>() {
        //
        // public final float coordinate(Vec2D p) {
View Full Code Here


        springs = new ArrayList<VerletSpring2D>();
        this.numIterations = numIterations;
        this.timeStep = timeStep;
        setDrag(drag);
        if (gravity != null) {
            addBehavior(new GravityBehavior2D(gravity));
        }
    }
View Full Code Here

TOP

Related Classes of toxi.physics2d.behaviors.GravityBehavior2D

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.