more js changes for changes to camera interface

This commit is contained in:
Stephen Birarda 2014-11-04 10:41:36 -08:00
parent fe0d593ac4
commit 303e8f6da9
4 changed files with 19 additions and 19 deletions

View file

@ -23,7 +23,7 @@ var THRUST_CONTROLLER = 0;
var VIEW_CONTROLLER = 1;
function checkCamera(deltaTime) {
if (Camera.getModeString() == "independent") {
if (Camera.mode == "independent") {
var THRUST_MAG_UP = 800.0;
var THRUST_MAG_DOWN = 300.0;
var THRUST_MAG_FWD = 500.0;
@ -102,19 +102,19 @@ function keyPressEvent(event) {
}
if (event.text == "1") {
Camera.setMode("first person");
Camera.mode = "first person";
}
if (event.text == "2") {
Camera.setMode("mirror");
Camera.mode = "mirror";
}
if (event.text == "3") {
Camera.setMode("third person");
Camera.mode = "third person";
}
if (event.text == "4") {
Camera.setMode("independent");
Camera.mode = "independent";
joysticksCaptured = true;
Controller.captureJoystick(THRUST_CONTROLLER);
Controller.captureJoystick(VIEW_CONTROLLER);

View file

@ -20,15 +20,15 @@ var cameraLocations = [ {x: 7971.9, y: 241.3, z: 7304.1}, {x: 7973.0, y: 241.3,
var cameraLookAts = [ {x: 7971.1, y: 241.3, z: 7304.1}, {x: 7972.1, y: 241.3, z: 7304.1}, {x: 7972.1, y: 241.3, z: 7304.1}, {x: 7972.1, y: 241.3, z: 7304.1}, {x: 7972.1, y: 241.3, z: 7304.1}, {x: 7971.3, y: 241.3, z: 7304.2} ];
function saveCameraState() {
oldMode = Camera.getModeString();
oldMode = Camera.mode;
avatarPosition = MyAvatar.position;
Camera.setModeShiftPeriod(0.0);
Camera.setMode("independent");
Camera.mode = "independent";
}
function restoreCameraState() {
Camera.stopLooking();
Camera.setMode(oldMode);
Camera.mode = oldMode;
}
function update(deltaTime) {
@ -52,7 +52,7 @@ function keyPressEvent(event) {
saveCameraState();
freeCamera = true;
}
Camera.setMode("independent");
Camera.mode = "independent";
Camera.setPosition(cameraLocations[choice - 1]);
Camera.keepLookingAt(cameraLookAts[choice - 1]);
}

View file

@ -20,15 +20,15 @@ var cameraLocations = [ {x: 8027.5, y: 237.5, z: 7305.7}, {x: 8027.5, y: 237.5,
var cameraLookAts = [ {x: 8027.5, y: 237.5, z: 7304.0}, {x: 8027.5, y: 237.5, z: 7305.7}, {x: 8027.5, y: 237.5, z: 7304.0}, {x: 8027.5, y: 237.5, z: 7304.0}, {x: 8027.5, y: 237.5, z: 7304.0}, {x: 8027.5, y: 237.5, z: 7304.0} ];
function saveCameraState() {
oldMode = Camera.getMode();
oldMode = Camera.mode;
avatarPosition = MyAvatar.position;
Camera.setModeShiftPeriod(0.0);
Camera.setMode("independent");
Camera.mode = "independent";
}
function restoreCameraState() {
Camera.stopLooking();
Camera.setMode(oldMode);
Camera.mode = oldMode;
}
function update(deltaTime) {
@ -52,7 +52,7 @@ function keyPressEvent(event) {
saveCameraState();
freeCamera = true;
}
Camera.setMode("independent");
Camera.mode = "independent";
Camera.setPosition(cameraLocations[choice - 1]);
Camera.keepLookingAt(cameraLookAts[choice - 1]);
}

View file

@ -88,8 +88,8 @@ CameraManager = function() {
that.focalPoint = focalPoint;
that.setFocalPoint(focalPoint);
that.previousCameraMode = Camera.getMode();
Camera.setMode("independent");
that.previousCameraMode = Camera.mode;
Camera.mode = "independent";
that.updateCamera();
@ -102,7 +102,7 @@ CameraManager = function() {
that.mode = MODE_INACTIVE;
if (!ignoreCamera) {
Camera.setMode(that.previousCameraMode);
Camera.mode = that.previousCameraMode;
}
cameraTool.setVisible(false);
}
@ -271,7 +271,7 @@ CameraManager = function() {
}
that.updateCamera = function() {
if (!that.enabled || Camera.getMode() != "independent") return;
if (!that.enabled || Camera.mode != "independent") return;
var yRot = Quat.angleAxis(that.yaw, { x: 0, y: 1, z: 0 });
var xRot = Quat.angleAxis(that.pitch, { x: 1, y: 0, z: 0 });
@ -300,7 +300,7 @@ CameraManager = function() {
// Ease the position and orbit of the camera
that.update = function(dt) {
if (Camera.getMode() != "independent") {
if (Camera.mode != "independent") {
return;
}
@ -350,7 +350,7 @@ CameraManager = function() {
Controller.keyReleaseEvent.connect(function (event) {
if (event.text == "ESC" && that.enabled) {
Camera.setMode(lastAvatarCameraMode);
Camera.mode = lastAvatarCameraMode;
cameraManager.disable(true);
}
});