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


Java ChaseCamera.setDefaultHorizontalRotation方法代码示例

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


在下文中一共展示了ChaseCamera.setDefaultHorizontalRotation方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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

示例2: OSRBridge

import com.jme3.input.ChaseCamera; //导入方法依赖的package包/类
public OSRBridge(RenderManager rm, int width, int height, Node root) {
	this.rm = rm;
	this.root = root;

	cam = new Camera(width, height);

	vp = rm.createPreView("Offscreen View", cam);
	if (!ToolKit.isAndroid())
		vp.setClearFlags(true, true, true);
	else
		vp.setClearFlags(true, false, false);

	FrameBuffer offBuffer = new FrameBuffer(width, height, 1);

	tex = new Texture2D(width, height, Image.Format.RGBA8);
	tex.setMinFilter(Texture.MinFilter.BilinearNoMipMaps);
	tex.setMagFilter(Texture.MagFilter.Bilinear);

	if (!ToolKit.isAndroid())
		offBuffer.setDepthBuffer(Image.Format.Depth);

	offBuffer.setColorTexture(tex);

	vp.setOutputFrameBuffer(offBuffer);

	setSpatial(root);
	vp.attachScene(root);

	chaseCam = new ChaseCamera(cam, root) {
		@Override
		public void setDragToRotate(boolean dragToRotate) {
			this.dragToRotate = dragToRotate;
			this.canRotate = !dragToRotate;
		}
	};
	chaseCam.setDefaultDistance(5f);
	chaseCam.setMaxDistance(340f);
	chaseCam.setDefaultHorizontalRotation(90 * FastMath.DEG_TO_RAD);
	chaseCam.setDefaultVerticalRotation(0f);
	cam.setFrustumFar(36000f);
	float aspect = (float) cam.getWidth() / (float) cam.getHeight();
	cam.setFrustumPerspective(45f, aspect, 0.1f, cam.getFrustumFar());
	chaseCam.setUpVector(Vector3f.UNIT_Y);
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:45,代码来源:OSRBridge.java

示例3: OSRBridge

import com.jme3.input.ChaseCamera; //导入方法依赖的package包/类
public OSRBridge(RenderManager rm, int width, int height, Node root) {
	this.rm = rm;
	this.root = root;

	cam = new Camera(width, height);
	
	vp = rm.createPreView("Offscreen View", cam);
	if (!Screen.isAndroid())	vp.setClearFlags(true, true, true);
	else						vp.setClearFlags(true, false, false);
	
	FrameBuffer offBuffer = new FrameBuffer(width, height, 1);
	
	tex = new Texture2D(width, height, Image.Format.RGBA8);
	tex.setMinFilter(Texture.MinFilter.BilinearNoMipMaps);
	tex.setMagFilter(Texture.MagFilter.Bilinear);

	if (!Screen.isAndroid())
		offBuffer.setDepthBuffer(Image.Format.Depth);
	
	offBuffer.setColorTexture(tex);

	vp.setOutputFrameBuffer(offBuffer);
	
	setSpatial(root);
	vp.attachScene(root);
	
	chaseCam = new ChaseCamera(cam, root) {
		@Override
		 public void setDragToRotate(boolean dragToRotate) {
			this.dragToRotate = dragToRotate;
			this.canRotate = !dragToRotate;
		}
	};
	chaseCam.setDefaultDistance(5f);
	chaseCam.setMaxDistance(340f);
	chaseCam.setDefaultHorizontalRotation(90*FastMath.DEG_TO_RAD);
	chaseCam.setDefaultVerticalRotation(0f);
	cam.setFrustumFar(36000f);
	float aspect = (float)cam.getWidth() / (float)cam.getHeight();
	cam.setFrustumPerspective( 45f, aspect, 0.1f, cam.getFrustumFar() );
	chaseCam.setUpVector(Vector3f.UNIT_Y);
}
 
开发者ID:meltzow,项目名称:tonegodgui,代码行数:43,代码来源:OSRBridge.java

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