Package org.jbox2d.dynamics

Examples of org.jbox2d.dynamics.FixtureDef


     
      double rSin15=radius*Math.sin(Math.PI/12);
      double rCos15=radius*Math.cos(Math.PI/12);
      double hw=(radius*0.8+rSin15)/2;
     
      FixtureDef triFixD=new FixtureDef();
      FixtureDef recFixD=new FixtureDef();
      PolygonShape triShape=new PolygonShape();
      PolygonShape recShape=new PolygonShape();
     
      Vector[] verticesP=new Vector[]{new Vector(rSin15,rCos15),new Vector(radius,0),new Vector(rSin15,-rCos15)};
      Vec2[] verticesW=new Vec2[3];
View Full Code Here


      this.vertices=vertices;
     
      this.body.setType(BodyType.DYNAMIC);
      this.body.setUserData(this);
      PolygonShape shape=new PolygonShape();
      FixtureDef fixtureDef=new FixtureDef();
     
      Vec2[] vs=new Vec2[vertices.length];
      for(int i=0;i<3;i++){
        vs[i]=CoordinateConverter.vectorPixelToWorld(vertices[i]);
      }
View Full Code Here

        force.mulLocal(FORCE_MAGNITUDE);//force length
      }
     
      float radius=CoordinateConverter.scalerPixelsToWorld(MAGNETIC_FIELD_BOUNDS);
     
      FixtureDef recFixD=new FixtureDef();
      FixtureDef cirFixDA=new FixtureDef();
      FixtureDef cirFixDB=new FixtureDef();
     
      CircleShape cirShapeA=new CircleShape();
      CircleShape cirShapeB=new CircleShape();
      PolygonShape recShape=new PolygonShape();
     
View Full Code Here

    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;
      fixtureDef.restitution=0.4f;
View Full Code Here

    if(isVerified()){ 
      body.setType(BodyType.DYNAMIC);
      this.body.setUserData(this);
      body.setBullet(true);
     
      FixtureDef fixD=new FixtureDef();
       
      PolygonShape lineP=new PolygonShape();
     
      this.hL=getWidth()/2;
       
View Full Code Here

    super(contentPower,controller, p, 0, 0, angle, color);
    if(this.isVerified()){
      this.vertices=vertices;
     
      PolygonShape shape=new PolygonShape();
      FixtureDef fixtureDef=new FixtureDef();
     
      Vec2[] vs=new Vec2[vertices.length];
      for(int i=0;i<vs.length;i++){
        vs[i]=CoordinateConverter.vectorPixelToWorld(vertices[i]);
      }
View Full Code Here

      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;
      fixtureDef.restitution=0.6f;
View Full Code Here

  private GravitationalArea(int contentPower,boolean beControlled ,Point p, double radius) {
    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();
     
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

 
  /**
   * Create a new primitive shape
   */
  protected PrimitiveShape() {
    this.def = new FixtureDef();
  }
View Full Code Here

TOP

Related Classes of org.jbox2d.dynamics.FixtureDef

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.