Package advanced.physics.physicsShapes

Examples of advanced.physics.physicsShapes.PhysicsRectangle


      PhysicsHelper.addDragJoint(world, c, c.getBody().isDynamic(), scale);
      physicsContainer.addChild(c);
    }
   
    //Create rectangle
    PhysicsRectangle physRect = new PhysicsRectangle(new Vector3D(100,300), 100, 50, app, world, 1f, 0.4f, 0.4f, scale);
    MTColor col = new MTColor(ToolsMath.getRandom(60, 255),ToolsMath.getRandom(60, 255),ToolsMath.getRandom(60, 255));
    physRect.setFillColor(col);
    physRect.setStrokeColor(col);
    PhysicsHelper.addDragJoint(world, physRect, physRect.getBody().isDynamic(), scale);
    physicsContainer.addChild(physRect);
   
    //Create polygon
    Vertex[] polyVertices = new Vertex[]{
        new Vertex(-10,0,0),
View Full Code Here


    // CREATE SCREEN BORDERS \\
    //Left border
    float borderWidth = 50f;
    float borderHeight = app.height;
    Vector3D pos = new Vector3D(-(borderWidth/2f) , app.height/2f);
    PhysicsRectangle borderLeft = new PhysicsRectangle(pos, borderWidth, borderHeight, app, world, 0,0,0, scale);
    borderLeft.setName("borderLeft");
    futureParent.addChild(borderLeft);
    //Right border
    pos = new Vector3D(app.width + (borderWidth/2), app.height/2);
    PhysicsRectangle borderRight = new PhysicsRectangle(pos, borderWidth, borderHeight, app, world, 0,0,0, scale);
    borderRight.setName("borderRight");
    futureParent.addChild(borderRight);
    //Top border
    borderWidth = app.width;
    borderHeight = 50f;
    pos = new Vector3D(app.width/2, -(borderHeight/2));
    PhysicsRectangle borderTop = new PhysicsRectangle(pos, borderWidth, borderHeight, app, world, 0,0,0, scale);
    borderTop.setName("borderTop");
    futureParent.addChild(borderTop);
    //Bottom border
    pos = new Vector3D(app.width/2 , app.height + (borderHeight/2));
    PhysicsRectangle borderBottom = new PhysicsRectangle(pos, borderWidth, borderHeight, app, world, 0,0,0, scale);
    borderBottom.setName("borderBottom");
    futureParent.addChild(borderBottom);
  }
View Full Code Here

  private void createScreenBorders(MTComponent parent){
    //Left border
    float borderWidth = 50f;
    float borderHeight = app.height;
    Vector3D pos = new Vector3D(-(borderWidth/2f) , app.height/2f);
    PhysicsRectangle borderLeft = new PhysicsRectangle(pos, borderWidth, borderHeight, app, world, 0,0,0, scale);
    borderLeft.setName("borderLeft");
    parent.addChild(borderLeft);
    //Right border
    pos = new Vector3D(app.width + (borderWidth/2), app.height/2);
    PhysicsRectangle borderRight = new PhysicsRectangle(pos, borderWidth, borderHeight, app, world, 0,0,0, scale);
    borderRight.setName("borderRight");
    parent.addChild(borderRight);
    //Top border
    borderWidth = app.width;
    borderHeight = 50f;
    pos = new Vector3D(app.width/2, -(borderHeight/2));
    PhysicsRectangle borderTop = new PhysicsRectangle(pos, borderWidth, borderHeight, app, world, 0,0,0, scale);
    borderTop.setName("borderTop");
    parent.addChild(borderTop);
    //Bottom border
    pos = new Vector3D(app.width/2 , app.height + (borderHeight/2));
    PhysicsRectangle borderBottom = new PhysicsRectangle(pos, borderWidth, borderHeight, app, world, 0,0,0, scale);
    borderBottom.setName("borderBottom");
    parent.addChild(borderBottom);
  }
View Full Code Here

  private void createScreenBorders(MTComponent parent){
    //Left border
    float borderWidth = 50f;
    float borderHeight = app.height;
    Vector3D pos = new Vector3D(-(borderWidth/2f) , app.height/2f);
    PhysicsRectangle borderLeft = new PhysicsRectangle(pos, borderWidth, borderHeight, app, world, 0,0,0, scale);
    borderLeft.setName("borderLeft");
    parent.addChild(borderLeft);
    //Right border
    pos = new Vector3D(app.width + (borderWidth/2), app.height/2);
    PhysicsRectangle borderRight = new PhysicsRectangle(pos, borderWidth, borderHeight, app, world, 0,0,0, scale);
    borderRight.setName("borderRight");
    parent.addChild(borderRight);
    //Top border
    borderWidth = app.width;
    borderHeight = 50f;
    pos = new Vector3D(app.width/2, -(borderHeight/2));
    PhysicsRectangle borderTop = new PhysicsRectangle(pos, borderWidth, borderHeight, app, world, 0,0,0, scale);
    borderTop.setName("borderTop");
    parent.addChild(borderTop);
    //Bottom border
    pos = new Vector3D(app.width/2 , app.height + (borderHeight/2));
    PhysicsRectangle borderBottom = new PhysicsRectangle(pos, borderWidth, borderHeight, app, world, 0,0,0, scale);
    borderBottom.setName("borderBottom");
    parent.addChild(borderBottom);
  }
View Full Code Here

TOP

Related Classes of advanced.physics.physicsShapes.PhysicsRectangle

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.