本文整理汇总了Java中com.jme3.input.ChaseCamera.setLookAtOffset方法的典型用法代码示例。如果您正苦于以下问题:Java ChaseCamera.setLookAtOffset方法的具体用法?Java ChaseCamera.setLookAtOffset怎么用?Java ChaseCamera.setLookAtOffset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.input.ChaseCamera
的用法示例。
在下文中一共展示了ChaseCamera.setLookAtOffset方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createSimpleChaseCamera
import com.jme3.input.ChaseCamera; //导入方法依赖的package包/类
public static ChaseCamera createSimpleChaseCamera(Camera camera
, InputManager inputManager) {
ChaseCamera chaseCam = new ChaseCamera(camera, inputManager);
// 开启镜头跟随可能让部分人容易犯头晕
// chaseCam.setSmoothMotion(true);
// chaseCam.setTrailingEnabled(false);
chaseCam.setInvertVerticalAxis(true);
chaseCam.setLookAtOffset(Vector3f.UNIT_Y.mult(2f));
chaseCam.setZoomSensitivity(0.5f);
chaseCam.setRotationSpeed(5f);
chaseCam.setRotationSensitivity(5);
chaseCam.setMaxDistance(15);
chaseCam.setMinDistance(2f);
chaseCam.setDefaultDistance(15);
chaseCam.setChasingSensitivity(5);
chaseCam.setDownRotateOnCloseViewOnly(true);
chaseCam.setUpVector(Vector3f.UNIT_Y);
// 不要隐藏光标,否则在MAC系统下鼠标点击后会上下错位
chaseCam.setHideCursorOnRotate(false);
return chaseCam;
}
示例2: simpleInitApp
import com.jme3.input.ChaseCamera; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
final Node buggy = (Node) assetManager.loadModel("Models/Buggy/Buggy.j3o");
TextureKey key = new TextureKey("Textures/Sky/Bright/BrightSky.dds", true);
key.setGenerateMips(true);
key.setAsCube(true);
final Texture tex = assetManager.loadTexture(key);
for (Spatial geom : buggy.getChildren()) {
if (geom instanceof Geometry) {
Material m = ((Geometry) geom).getMaterial();
m.setTexture("EnvMap", tex);
m.setVector3("FresnelParams", new Vector3f(0.05f, 0.18f, 0.11f));
}
}
flyCam.setEnabled(false);
ChaseCamera chaseCam = new ChaseCamera(cam, inputManager);
chaseCam.setLookAtOffset(new Vector3f(0,0.5f,-1.0f));
buggy.addControl(chaseCam);
rootNode.attachChild(buggy);
rootNode.attachChild(SkyFactory.createSky(assetManager, tex, false));
FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
BloomFilter bf = new BloomFilter(BloomFilter.GlowMode.Objects);
bf.setBloomIntensity(2.3f);
bf.setExposurePower(0.6f);
fpp.addFilter(bf);
viewPort.addProcessor(fpp);
}
示例3: setUpCamera
import com.jme3.input.ChaseCamera; //导入方法依赖的package包/类
/**
* Setup the camera.
*/
public void setUpCamera() {
cam.setFrustumFar(10000f);
flyCam.setEnabled(false);
// for the camera node way
/*
* CameraNode camNode = new CameraNode("CamNode", cam);
* camNode.setControlDir(ControlDirection.SpatialToCamera);
* camNode.setLocalTranslation(new Vector3f(0, 3, -20)); Quaternion quat
* = new Quaternion(); // These coordinates are local, the camNode is
* attached to the character node! quat.lookAt(Vector3f.UNIT_Z,
* Vector3f.UNIT_Y); camNode.setLocalRotation(quat);
* world.getPlayer().getPlayerNode().attachChild(camNode);
* camNode.setEnabled(true);
*/
chaseCam = new ChaseCamera(cam, world.getPlayer().getMesh(), inputManager);
world.getPlayer().setChaseCam(chaseCam);
chaseCam.setDefaultHorizontalRotation(FastMath.DEG_TO_RAD * -90);
flyCam.setEnabled(false);
chaseCam.setDefaultHorizontalRotation(FastMath.DEG_TO_RAD * -90);
chaseCam.setMinDistance(5f);
// chaseCam.setLookAtOffset(Vector3f.UNIT_Y.mult(3f));
// chaseCam.setInvertVerticalAxis(true);
// chaseCam.setRotationSpeed(5f);
chaseCam.setChasingSensitivity(5f);
chaseCam.setRotationSensitivity(15f);
chaseCam.setTrailingRotationInertia(0.5f);
chaseCam.setTrailingSensitivity(25f); // this is the one you really want
// to change to change the speed
// the camera trails behind at
chaseCam.setMaxDistance(45f);
chaseCam.setSmoothMotion(true);
chaseCam.setLookAtOffset(new Vector3f(0, 2.5f, 0));
chaseCam.setTrailingEnabled(true);
chaseCam.setMinVerticalRotation(0.05f);
chaseCam.setMaxVerticalRotation(0.6f);
// chaseCam.setZoomSensitivity(200);
world.getPlayer().setFirstPersonCam();
}