本文整理汇总了Java中com.jme3.input.ChaseCamera.setMaxVerticalRotation方法的典型用法代码示例。如果您正苦于以下问题:Java ChaseCamera.setMaxVerticalRotation方法的具体用法?Java ChaseCamera.setMaxVerticalRotation怎么用?Java ChaseCamera.setMaxVerticalRotation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.input.ChaseCamera
的用法示例。
在下文中一共展示了ChaseCamera.setMaxVerticalRotation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setCam
import com.jme3.input.ChaseCamera; //导入方法依赖的package包/类
void setCam() {
chaseCam = new ChaseCamera(cam, ship, inputManager);
chaseCam.setDragToRotate(true);
chaseCam.setTrailingEnabled(false);
chaseCam.setInvertVerticalAxis(true);
chaseCam.setMinVerticalRotation(-FastMath.PI * 0.45f);
chaseCam.setMaxVerticalRotation(FastMath.PI * 0.45f);
chaseCam.setMinDistance(10f);
chaseCam.setMaxDistance(20f);
chaseCam.setRotationSpeed(0.3f);
// chaseCam.setDownRotateOnCloseViewOnly(false);
// chaseCam.setHideCursorOnRotate(false);
chaseCam.setToggleRotationTrigger(new MouseButtonTrigger(MouseInput.BUTTON_MIDDLE));
chaseCam.setEnabled(true);
}
示例2: 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();
}