Package edu.cmu.cs.stage3.math

Examples of edu.cmu.cs.stage3.math.Quaternion


    if(e.getCharId() > 0)
      l2j.isPlayer = true;
    l2j.l2jEntity = e;
   
    ent.setLocalTranslation(pos.position);
    ent.setLocalRotation(new Quaternion().fromAngleAxis(e.getHeading(), Vector3f.UNIT_Y));
   
    pos.position.set(e.getX(), e.getY(), e.getZ());
    pos.startPos.set(pos.position);
    pos.goalPos.set(pos.startPos);
    pos.walkSpeed = e.getWalkSpeed();
View Full Code Here


      //this is the same as in GotoClickedInputAction
      Geometry n = new Geometry(IArea.TILE_PREFIX + x + " " + y,q);
      n.setMaterial(material);
      n.setLocalTranslation(x * IArea.TERRAIN_SIZE, 0f,y * IArea.TERRAIN_SIZE);
      ret.patch = n;
      n.setLocalRotation(new Quaternion().fromAngleAxis(-FastMath.HALF_PI, Vector3f.UNIT_X));
    } catch (Exception e) {
      //TODO use logger & error handling on failed load of a tile (in which case is this ok?)
      e.printStackTrace();
    }

View Full Code Here

  }
 
  private void replaceModel() {
    Node n = assembler.getModel();
    // the models are rotated so z is up
    n.setLocalRotation(new Quaternion().fromAngleAxis(-FastMath.HALF_PI, Vector3f.UNIT_X));
//    // FIXME modelconverter should already have set this one, this is
//    // not the case -> NPE
//    n.setModelBound(new BoundingBox());
//    n.updateModelBound();
//    if (vis != null && vis.getParent() != null) {
View Full Code Here

   * @param template  name of the model template from the partset configuration
   * @return a @see Node below which the 3d model and the animation controller is present
   */
  public static Node getModel3(String template){
    Node n = getModelInternal(JMEAnimationController.class, template, false, false);
    n.setLocalRotation(new Quaternion().fromAngleAxis(-FastMath.HALF_PI, Vector3f.UNIT_X));
    n.updateGeometricState();
   
    return n;
  }
View Full Code Here

   * @param hwSkinning hwSkinning desired or not
   * @return a @see Node below which the 3d model and the animation controller is present
   */
  public static Node getModel4(String template, boolean optimized, boolean hwSkinning){
    Node n = getModelInternal(JMEAnimationController.class, template, optimized, hwSkinning);
    n.setLocalRotation(new Quaternion().fromAngleAxis(-FastMath.HALF_PI, Vector3f.UNIT_X));
    n.updateGeometricState();
   
    return n;
  }
View Full Code Here

          NewCharacterModel v = new NewCharacterModel(clientInfo.getCharHandler().getCharSummary(i));
          v.attachVisuals();
          pos = scene.getChild("pos"+(i+1)).getLocalTranslation().clone();
          pos.y -= 1.0f;
          v.setLocalTranslation(pos);
          v.setLocalRotation(new Quaternion().fromAngleNormalAxis((float) Math.PI, Vector3f.UNIT_Y.negate()));
          Singleton.get().getSceneManager().changeCharNode(v,Action.ADD);
        }       
      }
    } catch (Exception e1) {
      logger.log(Level.SEVERE, "Failed to load select scene file "+SCENES_SELECT, e1);
View Full Code Here

    Geometry face1 = new Geometry("face1", faceShape);
    face1.move(-(patchWidth * selectedSizeVariation) / 2, 0, 0);
    grassPatch.attachChild(face1);

    Geometry face2 = new Geometry("face2", faceShape);
    face2.rotate(new Quaternion().fromAngleAxis(-FastMath.PI / 2,
        new Vector3f(0, 1, 0)));
    face2.move(0, 0, -(patchWidth * selectedSizeVariation) / 2);
    grassPatch.attachChild(face2);

    grassPatch.setCullHint(Spatial.CullHint.Dynamic);
    grassPatch.setQueueBucket(RenderQueue.Bucket.Transparent);

    face1.setMaterial(faceMat);
    face2.setMaterial(faceMat);

    grassPatch.rotate(new Quaternion().fromAngleAxis(
        (((int) (Math.random() * 359)) + 1) * (FastMath.PI / 190),
        new Vector3f(0, 1, 0)));
    grassPatch.setLocalTranslation(location);

    return grassPatch;
View Full Code Here

 
  private Geometry createSelectionMarker(){
    float size = 2f;
    Geometry selectionMarker = new Geometry("selection", new Quad(size, size));
    selectionMarker.setLocalTranslation(-0.5f*size, 0.2f, 0.5f*size);
    selectionMarker.setLocalRotation(new Quaternion().fromAngleAxis(-FastMath.HALF_PI, Vector3f.UNIT_X));

      com.jme3.asset.AssetManager am = Singleton.get().getAssetManager().getJmeAssetMan();
      Material mat = new Material(am, "Common/MatDefs/Light/Lighting.j3md");
      Texture sel = am.loadTexture("models/textures/flare4.png");
      sel.setWrap(WrapMode.Repeat);
View Full Code Here

//        com.l2client.asset.Singleton.get().getAssetManager().loadAsset(a,true);
        Spatial s = Singleton.get().getAssetManager().getJmeAssetMan().loadModel("models/troll2/troll.xml.mesh.xml");
//        baseNode = (Node) a.getBaseAsset();
        if(s instanceof Node ){
        baseNode = (Node) s;
        baseNode.setLocalRotation(new Quaternion().fromAngleAxis(-FastMath.HALF_PI, Vector3f.UNIT_X));
        baseNode.setName(name);
        }
      }
      if (baseNode != null) {
//        //TODO check if still needed
View Full Code Here

    private AudioRenderer renderer;

    public Listener(){
        location = new Vector3f();
        velocity = new Vector3f();
        rotation = new Quaternion();
    }
View Full Code Here

TOP

Related Classes of edu.cmu.cs.stage3.math.Quaternion

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.