Examples of Body


Examples of eas.simulation.spatial.sim2D.physicalSimulation.physicsEngine.net.phys2d.raw.Body

    spaces.clear();
   
    Space space = new Space(0,0,0,0);
   
    for (int i=0;i<bodies.size();i++) {
      Body body = bodies.get(i);
     
      space.addAABox(body.getShape().getBounds(),
               body.getPosition().getX(),
               body.getPosition().getY());
      space.addBody(body);
    }
   
    splitSpace(space, 0, maxInSpace, spaces);
   
View Full Code Here

Examples of global.Message.Body

  }

  private void btnSendActionPerformed(java.awt.event.ActionEvent evt)
  {
    String desc    = txtContent.getText();
    byte[][] bufs  = Message.toByteArray2(new Header(), new Body("伤神小怪兽", 23, desc));
    long connID    = client.getConnectionID().longValue();

    if(client.sendPackets(bufs))
      logSend(connID, desc);
    else
View Full Code Here

Examples of info.textgrid.lab.noteeditor.mei2013.Body

    sourceDesc.getSources().add(source);
    fileDesc.setSourceDesc(sourceDesc);   
    meiHead.setFileDesc(fileDesc)
    mei.setMeiHead(meiHead);
    Music music = new Music();
    Body body = new Body();
    Mdiv mdiv = new Mdiv();
    Score score = new Score();
    ScoreDef scoreDef = createScoreDef(stavesCount);
    score.getGapsAndSbsAndCorrs().add(scoreDef);
    Section section = new Section();
    Measure measureFirst = new Measure();
    Staff staffFirst = new Staff();
    Layer layerFirst = new Layer();
    staffFirst.getSbsAndSymbolsAndOrigs().add(layerFirst);
    measureFirst.getAnnotsAndSlursAndTupletSpen().add(staffFirst);
    for (int stavesIter = 1; stavesIter < stavesCount; stavesIter++) {
      Staff staff = new Staff();
      Layer layer = new Layer();
      staff.getSbsAndSymbolsAndOrigs().add(layer);
      measureFirst.getAnnotsAndSlursAndTupletSpen().add(staff);
    }
    section.getUnclearsAndSbsAndApps().add(measureFirst);

    for (int measureIter = 1; measureIter < measureCount; measureIter++) {
      Measure measure = new Measure();
      for (int stavesIter = 0; stavesIter < stavesCount; stavesIter++) {
        Staff staff = new Staff();
        Layer layer = new Layer();
        staff.getSbsAndSymbolsAndOrigs().add(layer);
        measure.getAnnotsAndSlursAndTupletSpen().add(staff);
      }
      section.getUnclearsAndSbsAndApps().add(measure);
    }
    score.getGapsAndSbsAndCorrs().add(section);
    mdiv.setScore(score);
    body.getMdivs().add(mdiv);
    music.setBody(body);
    mei.setMusic(music);
    mei.setId(DEFAULT_MEI_TREE);
    return mei;
  }
View Full Code Here

Examples of jabber.client.Body

        answer.setTo(to);

        // answer.setType(message.getType());
        if (message instanceof ActiveMQTextMessage) {
            ActiveMQTextMessage activeMQTextMessage = (ActiveMQTextMessage)message;
            Body body = new Body();
            String text = activeMQTextMessage.getText();
            LOG.info("Setting the body text to be: " + text);
            body.setValue(text);
            answer.getAny().add(body);
        } else {
            // TODO support other message types
            LOG.warn("Could not convert the message to a complete Jabber message: " + message);
        }
View Full Code Here

Examples of jinngine.physics.Body

    interacting = false;
    double parameter = Double.POSITIVE_INFINITY;
    Iterator<Body> bodies = scene.getBodies();
    // go thru each body
    while (bodies.hasNext()) {
      Body bi = bodies.next();

      // only shoot at non-fixed bodies
      if ( !bi.isFixed()) {
        Iterator<Geometry> geometries = bi.getGeometries();
        Geometry gi = geometries.next();

        // if geometry is usable
        if ( gi instanceof SupportMap3) {
View Full Code Here

Examples of my.home.dsl.deepClone.Body

      _builder.newLine();
      _builder.append("}");
      final String code = _builder.toString();
      final Model model = this.parser.parse(code);
      this.validationHelper.assertNoErrors(model);
      final Body body = ((Body) model);
      EList<ClassCloner> _cloners = body.getCloners();
      int _size = _cloners.size();
      Assert.assertEquals(1, _size);
      EList<ClassCloner> _cloners_1 = body.getCloners();
      ClassCloner _head = IterableExtensions.<ClassCloner>head(_cloners_1);
      JvmTypeReference _classToClone = _head.getClassToClone();
      String _qualifiedName = _classToClone.getQualifiedName();
      Assert.assertEquals("a.b.c.WeekdayOpeningHours", _qualifiedName);
      EList<ClassCloner> _cloners_2 = body.getCloners();
      ClassCloner _head_1 = IterableExtensions.<ClassCloner>head(_cloners_2);
      EList<FieldClonerType> _fields = _head_1.getFields();
      int _size_1 = _fields.size();
      Assert.assertEquals(2, _size_1);
      EList<ClassCloner> _cloners_3 = body.getCloners();
      ClassCloner _head_2 = IterableExtensions.<ClassCloner>head(_cloners_3);
      EList<FieldClonerType> _fields_1 = _head_2.getFields();
      FieldClonerType _get = _fields_1.get(0);
      String _fieldName = ((SimpleExcludedField) _get).getFieldName();
      Assert.assertEquals("weekDay", _fieldName);
      EList<ClassCloner> _cloners_4 = body.getCloners();
      ClassCloner _head_3 = IterableExtensions.<ClassCloner>head(_cloners_4);
      EList<FieldClonerType> _fields_2 = _head_3.getFields();
      FieldClonerType _get_1 = _fields_2.get(1);
      String _fieldName_1 = ((SimpleField) _get_1).getFieldName();
      Assert.assertEquals("hours", _fieldName_1);
View Full Code Here

Examples of net.javlov.world.Body

  }
 
  protected void makeWorld() {
    world = new GridLimitedOptionsWorld(15, 18, cellwidth, cellheight);
   
    Body landmark = new Phys2DBody( new StaticBox(cellwidth, cellheight), 10, true );
    landmark.setLocation(4.5*cellwidth, 14.5*cellheight);
    landmark.setType(Body.UNDEFINED);
    world.addFixedBody(landmark);
   
    landmark = new Phys2DBody( new StaticBox(cellwidth, cellheight), 10, true );
    landmark.setLocation(4.5*cellwidth, 8.5*cellheight);
    landmark.setType(Body.UNDEFINED);
    world.addFixedBody(landmark);
   
    landmark = new Phys2DBody( new StaticBox(cellwidth, cellheight), 10, true );
    landmark.setLocation(10.5*cellwidth, 8.5*cellheight);
    landmark.setType(Body.UNDEFINED);
    world.addFixedBody(landmark);
   
    landmark = new Phys2DBody( new StaticBox(cellwidth, cellheight), 10, true );
    landmark.setLocation(10.5*cellwidth, 2.5*cellheight);
    landmark.setType(Body.UNDEFINED);
    world.addFixedBody(landmark);
   
    rf = new GridRewardFunction();
    world.setRewardFunction(rf);
    world.addCollisionListener(rf);
View Full Code Here

Examples of net.phys2d.raw.Body

      g.drawLine((int) x1,(int) y1,(int) x2,(int) y2);
    }
    if(j instanceof SlideJoint){
      SlideJoint joint = (SlideJoint) j;
     
      Body b1 = joint.getBody1();
      Body b2 = joint.getBody2();
 
      Matrix2f R1 = new Matrix2f(b1.getRotation());
      Matrix2f R2 = new Matrix2f(b2.getRotation());
 
      ROVector2f x1 = b1.getPosition();
      Vector2f p1 = MathUtil.mul(R1,joint.getAnchor1());
      p1.add(x1);
 
      ROVector2f x2 = b2.getPosition();
      Vector2f p2 = MathUtil.mul(R2,joint.getAnchor2());
      p2.add(x2);
     
      Vector2f im = new Vector2f(p2);
      im.sub(p1);
      im.normalise();
     
     
     
      g.setColor(Color.red);
      g.drawLine((int)p1.x,(int)p1.y,(int)(p1.x+im.x*joint.getMinDistance()),(int)(p1.y+im.y*joint.getMinDistance()));
      g.setColor(Color.blue);
      g.drawLine((int)(p1.x+im.x*joint.getMinDistance()),(int)(p1.y+im.y*joint.getMinDistance()),(int)(p1.x+im.x*joint.getMaxDistance()),(int)(p1.y+im.y*joint.getMaxDistance()));
    }
    if(j instanceof AngleJoint){
      AngleJoint angleJoint = (AngleJoint)j;
      Body b1 = angleJoint.getBody1();
      Body b2 = angleJoint.getBody2();
      float RA = j.getBody1().getRotation() + angleJoint.getRotateA();
      float RB = j.getBody1().getRotation() + angleJoint.getRotateB();
     
      Vector2f VA = new Vector2f((float) Math.cos(RA), (float) Math.sin(RA));
      Vector2f VB = new Vector2f((float) Math.cos(RB), (float) Math.sin(RB));
     
      Matrix2f R1 = new Matrix2f(b1.getRotation());
      Matrix2f R2 = new Matrix2f(b2.getRotation());
     
      ROVector2f x1 = b1.getPosition();
      Vector2f p1 = MathUtil.mul(R1,angleJoint.getAnchor1());
      p1.add(x1);
 
      ROVector2f x2 = b2.getPosition();
      Vector2f p2 = MathUtil.mul(R2,angleJoint.getAnchor2());
      p2.add(x2);
     
      g.setColor(Color.red);
      g.drawLine((int)p1.x,(int)p1.y,(int)(p1.x+VA.x*20),(int)(p1.y+VA.y*20));
      g.drawLine((int)p1.x,(int)p1.y,(int)(p1.x+VB.x*20),(int)(p1.y+VB.y*20));
    }
    if (j instanceof BasicJoint) {
      BasicJoint joint = (BasicJoint) j;
     
      Body b1 = joint.getBody1();
      Body b2 = joint.getBody2();
 
      Matrix2f R1 = new Matrix2f(b1.getRotation());
      Matrix2f R2 = new Matrix2f(b2.getRotation());
 
      ROVector2f x1 = b1.getPosition();
      Vector2f p1 = MathUtil.mul(R1,joint.getLocalAnchor1());
      p1.add(x1);
 
      ROVector2f x2 = b2.getPosition();
      Vector2f p2 = MathUtil.mul(R2,joint.getLocalAnchor2());
      p2.add(x2);
 
      g.setColor(Color.red);
      g.drawLine((int) x1.getX(), (int) x1.getY(), (int) p1.x, (int) p1.y);
      g.drawLine((int) p1.x, (int) p1.y, (int) x2.getX(), (int) x2.getY());
      g.drawLine((int) x2.getX(), (int) x2.getY(), (int) p2.x, (int) p2.y);
      g.drawLine((int) p2.x, (int) p2.y, (int) x1.getX(), (int) x1.getY());
    }
    if(j instanceof DistanceJoint){
      DistanceJoint joint = (DistanceJoint) j;
     
      Body b1 = joint.getBody1();
      Body b2 = joint.getBody2();
 
      Matrix2f R1 = new Matrix2f(b1.getRotation());
      Matrix2f R2 = new Matrix2f(b2.getRotation());
 
      ROVector2f x1 = b1.getPosition();
      Vector2f p1 = MathUtil.mul(R1,joint.getAnchor1());
      p1.add(x1);
 
      ROVector2f x2 = b2.getPosition();
      Vector2f p2 = MathUtil.mul(R2,joint.getAnchor2());
      p2.add(x2);
     
      g.setColor(Color.red);
      g.drawLine((int) p1.getX(), (int) p1.getY(), (int) p2.x, (int) p2.y);
    }
    if (j instanceof SpringJoint) {
      SpringJoint joint = (SpringJoint) j;
     
      Body b1 = joint.getBody1();
      Body b2 = joint.getBody2();
 
      Matrix2f R1 = new Matrix2f(b1.getRotation());
      Matrix2f R2 = new Matrix2f(b2.getRotation());
 
      ROVector2f x1 = b1.getPosition();
      Vector2f p1 = MathUtil.mul(R1,joint.getLocalAnchor1());
      p1.add(x1);
 
      ROVector2f x2 = b2.getPosition();
      Vector2f p2 = MathUtil.mul(R2,joint.getLocalAnchor2());
      p2.add(x2);
     
      g.setColor(Color.red);
      g.drawLine((int) x1.getX(), (int) x1.getY(), (int) p1.x, (int) p1.y);
View Full Code Here

Examples of net.phys2d.raw.Body

   */
  protected void draw(Graphics2D g) {
    BodyList bodies = world.getBodies();
   
    for (int i=0;i<bodies.size();i++) {
      Body body = bodies.get(i);
     
      drawBody(g, body);
    }
   
    JointList joints = world.getJoints();
View Full Code Here

Examples of net.phys2d.raw.Body

   */
  protected void keyHit(char c) {
    super.keyHit(c);
   
    if (c == ' ') {
      Body body2 = new Body("Mover1", new Box(40.0f, 40.0f), 300.0f);
      body2.setPosition(-50, (float) (((Math.random() * 50) + 150)));
      world.add(body2);
      body2.adjustAngularVelocity(1);
      body2.adjustVelocity(new Vector2f(200,(float) (Math.random() * 200)));
    }
  }
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.