/// <summary> /// 创建跟随单位的跨肩视角或其它第三人称视角的相机 /// </summary> /// <param name="aunit">得到跟随的单位</param> /// <param name="unitTranslation">相对于单位原位置的平移</param> //public void follow(Unit aunit,Vector3 unitTranslation) //{ // chasingUnit = aunit; // ARCameraObjOffset = unitTranslation; // chasing = true; //} public void follow(AR3DObject aunit) { targetObject = aunit; UpdateCameraTarget(targetObject.Position, targetObject.Face, targetObject.Up); Reset(); }
public ARComplexCamera(GraphicsDevice device, Vector3 position, AR3DObject target, Vector3 Up) : this(device) { this.cameraType = CameraType.Observer; this.position = position; this.ObjUp = Up; this.observedUnit = target; this.observedPoint = target.Position; }
public static ARComplexCamera CreateAODChaseCamera(GraphicsDevice device, AR3DObject unit) { ARComplexCamera c = new ARComplexCamera(device); c.cameraType = CameraType.AODChaseCamera; c.cameraObjOffset = new Vector3(0, 10, 40); c.lookAtOffset = new Vector3(0, 0, -1000); c.follow(unit); return(c); }
public static ARComplexCamera CreateNormalFollowCamera(GraphicsDevice device, AR3DObject unit) { ARComplexCamera c = new ARComplexCamera(device); c.cameraType = CameraType.NormalCamera; c.cameraObjOffset = new Vector3(6, 5, 20); c.lookAtOffset = new Vector3(0, 0, -1000); c.follow(unit); return(c); }
public static ARComplexCamera CreateSpringFollowCamera(GraphicsDevice device, AR3DObject unit) { ARComplexCamera c = new ARComplexCamera(device); c.cameraType = CameraType.SpringCamera; c.cameraObjOffset = new Vector3(0, 10, 40); c.lookAtOffset = new Vector3(0, 4, -8); c.follow(unit); return(c); }