Package org.jbox2d.collision.shapes

Examples of org.jbox2d.collision.shapes.CircleShape


  private Circle(int contentPower,ShapesController controller,Point p,double radius,CssColor color){
    super(contentPower,controller, p, radius*2, radius*2, 0, color);
    if(this.isVerified()){
      this.radius=radius;
      body.setBullet(true);
      CircleShape shape=new CircleShape();
      FixtureDef fixtureDef=new FixtureDef();
     
      shape.m_radius=CoordinateConverter.scalerPixelsToWorld(this.radius);
      fixtureDef.shape=shape;
      fixtureDef.density=1f;
View Full Code Here


      initPos.setPosition(p);
      portion=creator.getMaxPower()/4;
      updatePower(creator.getPower());
      creator.addPropertiesChangeListener(this);
     
      CircleShape shape=new CircleShape();
      FixtureDef fixtureDef=new FixtureDef();
     
      shape.m_radius=CoordinateConverter.scalerPixelsToWorld(CORE_RADIUS);
      fixtureDef.shape=shape;
      fixtureDef.density=1f;
View Full Code Here

     
      FixtureDef recFixD=new FixtureDef();
      FixtureDef cirFixDA=new FixtureDef();
      FixtureDef cirFixDB=new FixtureDef();
     
      CircleShape cirShapeA=new CircleShape();
      CircleShape cirShapeB=new CircleShape();
      PolygonShape recShape=new PolygonShape();
     
      cirShapeA.m_radius=radius;
      cirShapeB.m_radius=radius;
      cirShapeA.m_p.set(CoordinateConverter.vectorPixelToWorld(position.delta(pointA)));
View Full Code Here

    super(contentPower,beControlled ,p, 2*radius, 2*radius, 0);
    if(isVerified()){
      body.setType(BodyType.STATIC);
     
      FixtureDef fixtureDef=new FixtureDef();
      CircleShape shape=new CircleShape();
     
      this.radius = radius;
      this.center=body.getPosition();
     
      shape.m_radius=CoordinateConverter.scalerPixelsToWorld(radius);
View Full Code Here

   
   
    aabb=new PixelAABB(this.position,width,height);
   
    BodyDef bodyDef=new BodyDef();
    CircleShape shape=new CircleShape();
    FixtureDef fixtureDef=new FixtureDef();
    Vec2 impulse=CoordinateConverter.vectorPixelsToWorld(new Vector(-30+60*Random.nextDouble(),-(175+50*Random.nextDouble())));
   
    bodyDef.type=BodyType.DYNAMIC;
    bodyDef.position.set(CoordinateConverter.coordPixelsToWorld(position));
 
View Full Code Here

   * @param restitution The resitution of the circle
   * @param friction The friction applied to the circle
   */
  public Circle(float radius, float density, float restitution, float friction) {
    super();
    def.shape = shape = new CircleShape();
    def.shape.m_radius = radius;
    def.density = density;
    def.restitution = restitution;
    def.friction = friction;
  }
View Full Code Here

      m_polygons[3] = new PolygonShape();
      m_polygons[3].setAsBox(0.5f, 0.5f);
    }

    {
      m_circle = new CircleShape();
      m_circle.m_radius = 0.5f;
    }

    m_bodyIndex = 0;
View Full Code Here

      bd.position.set(new Vec2(x, y));
      bd.type = BodyType.DYNAMIC;
      Body body = getWorld().createBody(bd);

      FixtureDef fd = new FixtureDef();
      CircleShape cd = new CircleShape();
      cd.m_radius = bodyRadius;
      fd.shape = cd;
      fd.density = 1.0f;
      body.createFixture(fd);
      cvjd.addBody(body);
View Full Code Here

      ground.createFixture(shape, 0);

      shape.setAsBox(2.0f, 0.1f, new Vec2(-6.0f, -2.8f), 0.1f);
      ground.createFixture(shape, 0);

      CircleShape cd = new CircleShape();
      cd.m_radius = 0.5f;
      cd.m_p.set(-0.5f, -4.0f);
      ground.createFixture(cd, 0);

    }

    liquid = new Body[nParticles];
    float massPerParticle = totalMass / nParticles;
    // PointDef pd = new PointDef();
    // pd.mass = massPerParticle;
    // pd.restitution = 0.0f;
    // pd.filter.groupIndex = -10;
    CircleShape pd = new CircleShape();
    FixtureDef fd = new FixtureDef();
    fd.shape = pd;
    fd.density = 1f;
    fd.filter.groupIndex = -10;
    pd.m_radius = .05f;
View Full Code Here

    for (int i = 0; i < liquid.length; ++i) {
      if (liquid[i].getWorldCenter().y < -10.0f) {
        getWorld().destroyBody(liquid[i]);
        float massPerParticle = totalMass / nParticles;

        CircleShape pd = new CircleShape();
        FixtureDef fd = new FixtureDef();
        fd.shape = pd;
        fd.density = 1.0f;
        fd.filter.groupIndex = -10;
        pd.m_radius = .05f;
View Full Code Here

TOP

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

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.