Package com.jme3.math

Examples of com.jme3.math.Vector3f


        TangentBinormalGenerator.generate(atmosphere);
        atmosphere.updateModelBound();
       
        //create the material
        mAtmosphere = new Material(assetManager, "MatDefs/Atmosphere.j3md");
        mAtmosphere.setVector3("v3LightPos", new Vector3f(1,0,0));
        mAtmosphere.setVector3("v3Center", position);
        mAtmosphere.setVector3("v3InvWavelength", this.getInvWavelength4());
        mAtmosphere.setFloat("fKrESun", this.getKrESun());
        mAtmosphere.setFloat("fKmESun", this.getKmESun());
        mAtmosphere.setFloat("fOuterRadius", this.getOuterRadius());
View Full Code Here


        return sphere;
    }
   
    public void update(float tpf, Vector3f cameraLocation, Vector3f sunLocation) {
             
        Vector3f lightPosNormalized = sunLocation.subtract(getPosition()).normalize();
        Vector3f planetToCamera = cameraLocation.subtract(getPosition());
        float cameraHeight = planetToCamera.length();
       
        // rotate the clouds
        if (clouds != null)
          clouds.rotate(0, rotationSpeed, 0);
       
View Full Code Here

        flame.setGravity(-5f);
        flame.setLowLife(1f);
        flame.setHighLife(1.5f);
        //flame.setInitialVelocity(new Vector3f(0, 7, 0));
        flame.setRandomAngle(true);
        flame.setInitialVelocity(new Vector3f(0, 3, 0));
        //flame.setVelocityVariation(1f);
        flame.setVelocityVariation(1.5f);
        flame.setImagesX(8);
        flame.setImagesY(1);
        Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
View Full Code Here

    @Override
    protected void controlUpdate(float tpf) {
        spatial.setLocalTranslation(location.add(0, 0, -4));

        Vector3f vectorDifference = new Vector3f(cam.getLocation().subtract(spatial.getWorldTranslation()));
        spatial.setLocalTranslation(vectorDifference.addLocal(spatial.getLocalTranslation()));

        Quaternion worldDiff = new Quaternion(cam.getRotation().subtract(spatial.getWorldRotation()));
        spatial.setLocalRotation(worldDiff.addLocal(spatial.getLocalRotation()));

        if (spatial.getName().equals("gun")) {
View Full Code Here

        if (player == null) {
            return;
        }

        Vector3f camDir = cam.getDirection().clone();
        Vector3f camLeft = cam.getLeft().clone();
        walkDirection.set(0, 0, 0);

        if (left) {
            walkDirection.addLocal(camLeft);
        }
        if (right) {
            walkDirection.addLocal(camLeft.negate());
        }
        if (up) {
            walkDirection.addLocal(camDir);
        }
        if (down) {
View Full Code Here

testarea:

-9916.567f, 33.88786f, 8376.85f

       * */
      cam.setLocation(new Vector3f(-9856.284f, 17.075874f, 8463.943f));//ServerValues.getClientCoords(-71453,258305,-3104));//
      cam.setFrustumFar(1000f);
      cam.setFrustumNear(1f);
      cam.lookAt(new Vector3f(-9902.244f, 19.241596f, 8288.143f), Vector3f.UNIT_Y);
      flyCam.setMoveSpeed(50f);
     
    assetManager = sin.getAssetManager().getJmeAssetMan();
      enm = sin.getNavManager();
      enm.USE_OPTIMZED_PATH = true;
View Full Code Here

   
    private void dropBox() {
      Geometry g = new Geometry("Box",new Box());
      g.setMaterial(matWireframe);
      Vector3f pos = cam.getLocation().clone();
      sin.getNavManager().snapToGround(pos);
      sin.getSceneManager().changeAnyNode(rootNode, g, Action.ADD);
     
  }
View Full Code Here

    @Override
    public void simpleInitApp() {
     
      cacheFileNames(new File(LOAD_URL));

      cam.setLocation(new Vector3f(30f, 50f,-30f));//ServerValues.getClientCoords(-71453,258305,-3104));//
      cam.setFrustumFar(1000f);
      cam.setFrustumNear(1f);
//      cam.lookAt(new Vector3f(-9902.244f, 19.241596f, 8288.143f), Vector3f.UNIT_Y);
      flyCam.setMoveSpeed(50f);
     
        matWireframe = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        matWireframe.setColor("Color", ColorRGBA.Green);
        matWireframe.getAdditionalRenderState().setWireframe(true);

        DirectionalLight light = new DirectionalLight();
        light.setDirection((new Vector3f(-0.5f, -1f, -0.5f)).normalize());
        light.setColor(new ColorRGBA(0.8f,0.8f,0.8f,1f));
        rootNode.addLight(light);

        AmbientLight ambLight = new AmbientLight();
        ambLight.setColor(new ColorRGBA(0.1f, 0.1f, 0.1f, 1f));
View Full Code Here

        if(navMesh != null) {
            Material mat = matWireframe.clone();
                mat.setColor("Color", ColorRGBA.Blue);
          Geometry db = navMesh.getDebugBorderMesh();
          //we just put it slightly off to beter see the border
          db.setLocalTranslation(new Vector3f(0f, 0.5f, 0f).addLocal(db.getLocalTranslation()));
          System.out.println("Border has "+db.getVertexCount()+" vertices");
          db.setMaterial(mat);
          border.attachChild(db)
        }
      }
View Full Code Here

          System.out.println("attached:"+f);
          toggelNavBorderMeshes();
          System.out.println("border added:"+f);
         
        }
        cam.setLocation(new Vector3f(-100f,300f,-100f).add(navMesh.getPosition()));
        cam.lookAt(navMesh.getPosition(), Vector3f.UNIT_Y);

    } catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here

TOP

Related Classes of com.jme3.math.Vector3f

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.