Package org.jbox2d.collision.shapes

Examples of org.jbox2d.collision.shapes.EdgeChainDef


    BodyDef dymBodyDef = new BodyDef();
    dymBodyDef.position = new Vec2(0 , 0 );
//    dymBodyDef.position = new Vec2(worldWidth*0.5f , worldHeight*0.5f);
    Body theBody = world.createBody(dymBodyDef);

    EdgeChainDef myEdges = new EdgeChainDef();
    //CCW so edge points inwards
    myEdges.addVertex(new Vec2(l.x + offset , l.y + worldHeight - offset*2));
   
    myEdges.addVertex(new Vec2(l.x + worldWidth  - offset*2, l.y + worldHeight - offset*2));
   
    myEdges.addVertex(new Vec2(l.x + worldWidth - offset*2, l.y + offset));
   
    myEdges.addVertex(new Vec2(l.x + offset , l.y + offset));

    myEdges.setIsLoop(true);
    myEdges.friction = 2.0f;
//    myEdges.density = 1.0f;
    myEdges.density = 0.0f;
   
    myEdges.isSensor = true;
View Full Code Here

TOP

Related Classes of org.jbox2d.collision.shapes.EdgeChainDef

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.