当前位置: 首页>>代码示例>>Java>>正文


Java ChaseCamera.setMinDistance方法代码示例

本文整理汇总了Java中com.jme3.input.ChaseCamera.setMinDistance方法的典型用法代码示例。如果您正苦于以下问题:Java ChaseCamera.setMinDistance方法的具体用法?Java ChaseCamera.setMinDistance怎么用?Java ChaseCamera.setMinDistance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jme3.input.ChaseCamera的用法示例。


在下文中一共展示了ChaseCamera.setMinDistance方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
    }
 
开发者ID:huliqing,项目名称:LuoYing,代码行数:24,代码来源:SceneTools.java

示例2: initCam

import com.jme3.input.ChaseCamera; //导入方法依赖的package包/类
public void initCam() {
    app.getFlyByCamera().setEnabled(false);
    rootNode.attachChild(camObject);
    chaseCam = new ChaseCamera(app.getCamera(), camObject,
            app.getInputManager()) {
        @Override
        public void update(float tpf) {
            super.update(tpf);
            // custom update code
            if (labelState == null && stateManager != null) {
                labelState = stateManager.getState(LabelAppState.class);
            }
            if (labelState != null) {
                labelState.updateLabels();
            }
        }
    };

    chaseCam.setInvertVerticalAxis(true);
    chaseCam.setMinVerticalRotation(-90f);
    chaseCam.setDefaultDistance(20f);
    chaseCam.setMinDistance(2f);
    chaseCam.setMaxDistance(40f);
    chaseCam.setZoomSensitivity(1f);
}
 
开发者ID:matthewseal,项目名称:MoleculeViewer,代码行数:26,代码来源:MVAppState.java

示例3: 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);
    }
 
开发者ID:mifth,项目名称:JME-Simple-Examples,代码行数:21,代码来源:SpaceShip.java

示例4: setUpCammera

import com.jme3.input.ChaseCamera; //导入方法依赖的package包/类
private void setUpCammera() {
    // Disable the default first-person cam!
    app.getFlyByCamera().setEnabled(false);
    cam.setRotation(new Quaternion(new float[]{0, (float) Math.PI / 2, 0}));
    // Enable a chase cam
    chaseCam = new ChaseCamera(cam, sa, inputManager);
    chaseCam.setDefaultDistance(70f);
    chaseCam.setMaxDistance(150f);
    chaseCam.setMinDistance(50f);
    chaseCam.setDefaultHorizontalRotation(-FastMath.PI / 2);
    chaseCam.setDefaultVerticalRotation(FastMath.PI / 4);
    chaseCam.setInvertVerticalAxis(true);
    chaseCam.setTrailingEnabled(false);
}
 
开发者ID:damhonglinh,项目名称:Fruity-Bang,代码行数:15,代码来源:Scene.java

示例5: 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();
}
 
开发者ID:GSam,项目名称:Game-Project,代码行数:47,代码来源:ClientMain.java


注:本文中的com.jme3.input.ChaseCamera.setMinDistance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。