flyCam direction

Is it possible to set the starting direction of the flyCam in a SimpleApplication, or do I need to set it to false and just create my own chase cam?

i.e: cam.lookAtDirection(new Vector3f(0, -1.5f, 0).normalizeLocal(), Vector3f.UNIT_Y);

If you are creating a chase cam then you do need to disable the fly cam and create your own chase camera, if you are just trying to change the initial direction then throwing what makeshift posted in your simpleinit() should be sufficient.

If you are trying to set up a chase cam here is a little utility file i made for my game:

[java]

import com.jme3.input.ChaseCamera;

import com.jme3.input.FlyByCamera;

import com.jme3.input.InputManager;

import com.jme3.renderer.Camera;

import com.jme3.scene.Spatial;

import com.jme3.math.*;



public class DefaultCamSystem {



private FlyByCamera flyCam;

private ChaseCamera chaser;

private Camera cam;

private InputManager inputManager;

public DefaultCamSystem(FlyByCamera flyCam, Camera cam){

this.flyCam = flyCam;

this.cam = cam;

initDefaults();



}

public void setupChaseCam(Spatial chasee, InputManager inputManager){

flyCam.setEnabled(false);

chaser = new ChaseCamera(cam, chasee, inputManager);

chaser.setLookAtOffset(Vector3f.UNIT_Y.mult(5));





}

public void EnableChaseCam(){

flyCam.setEnabled(false);

chaser.setEnabled(true);

}

public void EnableflyCam(){

chaser.setEnabled(false);

flyCam.setEnabled(true);

}

public String currentCamera(){

if(flyCam.isEnabled())

return "FlyCam";

else

return "ChaseCam";

}

private void initDefaults(){

flyCam.setDragToRotate(true);

flyCam.setMoveSpeed(200);

}



public Vector3f getCamDir(){

return cam.getDirection().clone().multLocal(0.6f);

}



public Vector3f getCamLeft(){

return cam.getLeft().clone().multLocal(0.4f);

}



public Vector3f getLocation()

{

return cam.getLocation();

}



public Vector3f getDirection()

{

return cam.getDirection();

}

}

[/java]

my initDefaults() method is just because i am using my game canvas within a jframe you can omit this :slight_smile:

Cheers

-Allman