From a5619d16f74863168f45b04b37cc6383e1a92263 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 13 Oct 2010 07:24:37 -0400 Subject: correct licenses (fix problem with license change merge) --- indra/newview/llagentpilot.cpp | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) (limited to 'indra/newview/llagentpilot.cpp') diff --git a/indra/newview/llagentpilot.cpp b/indra/newview/llagentpilot.cpp index 8ffb97d8fc..13e1023185 100644 --- a/indra/newview/llagentpilot.cpp +++ b/indra/newview/llagentpilot.cpp @@ -2,31 +2,25 @@ * @file llagentpilot.cpp * @brief LLAgentPilot class implementation * - * $LicenseInfo:firstyear=2002&license=viewergpl$ - * - * Copyright (c) 2002-2009, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2002&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ -- cgit v1.2.3 From 7205ad6d53224d5ade142c579d1c38b49f3d9885 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 31 Jan 2011 18:03:39 -0500 Subject: SH-872 WIP - temporarily disabling problematic log output to see if that fixes crash on test machine --- indra/newview/llagentpilot.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) mode change 100644 => 100755 indra/newview/llagentpilot.cpp (limited to 'indra/newview/llagentpilot.cpp') diff --git a/indra/newview/llagentpilot.cpp b/indra/newview/llagentpilot.cpp old mode 100644 new mode 100755 index 13e1023185..afeba6bdf0 --- a/indra/newview/llagentpilot.cpp +++ b/indra/newview/llagentpilot.cpp @@ -178,6 +178,8 @@ void LLAgentPilot::stopPlayback() } } +#define SKIP_PILOT_LOGGING 1 + void LLAgentPilot::updateTarget() { if (mPlaying) @@ -195,7 +197,9 @@ void LLAgentPilot::updateTarget() { if (!mStarted) { +#if SKIP_PILOT_LOGGING llinfos << "At start, beginning playback" << llendl; +#endif mTimer.reset(); mStarted = TRUE; } @@ -218,17 +222,23 @@ void LLAgentPilot::updateTarget() { if ((mNumRuns < 0) || (mNumRuns > 0)) { +#if SKIP_PILOT_LOGGING llinfos << "Looping, restarting playback" << llendl; +#endif startPlayback(); } else if (mQuitAfterRuns) { +#if SKIP_PILOT_LOGGING llinfos << "Done with all runs, quitting viewer!" << llendl; +#endif LLAppViewer::instance()->forceQuit(); } else { +#if SKIP_PILOT_LOGGING llinfos << "Done with all runs, disabling pilot" << llendl; +#endif stopPlayback(); } } -- cgit v1.2.3 From 04ddae45b284b8f535aa6cdc6b90af2088e82334 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 3 Feb 2011 17:52:45 -0500 Subject: SH-872 WIP - restored log statements, as removing them had no effect --- indra/newview/llagentpilot.cpp | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'indra/newview/llagentpilot.cpp') diff --git a/indra/newview/llagentpilot.cpp b/indra/newview/llagentpilot.cpp index afeba6bdf0..13e1023185 100644 --- a/indra/newview/llagentpilot.cpp +++ b/indra/newview/llagentpilot.cpp @@ -178,8 +178,6 @@ void LLAgentPilot::stopPlayback() } } -#define SKIP_PILOT_LOGGING 1 - void LLAgentPilot::updateTarget() { if (mPlaying) @@ -197,9 +195,7 @@ void LLAgentPilot::updateTarget() { if (!mStarted) { -#if SKIP_PILOT_LOGGING llinfos << "At start, beginning playback" << llendl; -#endif mTimer.reset(); mStarted = TRUE; } @@ -222,23 +218,17 @@ void LLAgentPilot::updateTarget() { if ((mNumRuns < 0) || (mNumRuns > 0)) { -#if SKIP_PILOT_LOGGING llinfos << "Looping, restarting playback" << llendl; -#endif startPlayback(); } else if (mQuitAfterRuns) { -#if SKIP_PILOT_LOGGING llinfos << "Done with all runs, quitting viewer!" << llendl; -#endif LLAppViewer::instance()->forceQuit(); } else { -#if SKIP_PILOT_LOGGING llinfos << "Done with all runs, disabling pilot" << llendl; -#endif stopPlayback(); } } -- cgit v1.2.3 From 64e017fc6b19006c893b4766be05c18ddb3b5593 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 9 Feb 2011 15:04:25 -0500 Subject: SH-915 WIP - allow flycam control in autopilot record/playback --- indra/newview/llagentpilot.cpp | 70 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 68 insertions(+), 2 deletions(-) mode change 100644 => 100755 indra/newview/llagentpilot.cpp (limited to 'indra/newview/llagentpilot.cpp') diff --git a/indra/newview/llagentpilot.cpp b/indra/newview/llagentpilot.cpp old mode 100644 new mode 100755 index 13e1023185..92e0180b46 --- a/indra/newview/llagentpilot.cpp +++ b/indra/newview/llagentpilot.cpp @@ -34,6 +34,8 @@ #include "llagent.h" #include "llappviewer.h" #include "llviewercontrol.h" +#include "llviewercamera.h" +#include "llviewerjoystick.h" LLAgentPilot gAgentPilot; @@ -47,7 +49,8 @@ LLAgentPilot::LLAgentPilot() : mLastRecordTime(0.f), mStarted(FALSE), mPlaying(FALSE), - mCurrentAction(0) + mCurrentAction(0), + mOverrideCamera(FALSE) { } @@ -55,6 +58,8 @@ LLAgentPilot::~LLAgentPilot() { } +#define CAM_FIELDS 1 + void LLAgentPilot::load(const std::string& filename) { if(filename.empty()) @@ -85,10 +90,30 @@ void LLAgentPilot::load(const std::string& filename) Action new_action; file >> new_action.mTime >> action_type; file >> new_action.mTarget.mdV[VX] >> new_action.mTarget.mdV[VY] >> new_action.mTarget.mdV[VZ]; +#if CAM_FIELDS + file >> new_action.mCameraView; + file >> new_action.mCameraOrigin.mV[VX] + >> new_action.mCameraOrigin.mV[VY] + >> new_action.mCameraOrigin.mV[VZ]; + + file >> new_action.mCameraXAxis.mV[VX] + >> new_action.mCameraXAxis.mV[VY] + >> new_action.mCameraXAxis.mV[VZ]; + + file >> new_action.mCameraYAxis.mV[VX] + >> new_action.mCameraYAxis.mV[VY] + >> new_action.mCameraYAxis.mV[VZ]; + + file >> new_action.mCameraZAxis.mV[VX] + >> new_action.mCameraZAxis.mV[VY] + >> new_action.mCameraZAxis.mV[VZ]; +#endif new_action.mType = (EActionType)action_type; mActions.put(new_action); } + mOverrideCamera = true; + file.close(); } @@ -108,7 +133,27 @@ void LLAgentPilot::save(const std::string& filename) for (i = 0; i < mActions.count(); i++) { file << mActions[i].mTime << "\t" << mActions[i].mType << "\t"; - file << std::setprecision(32) << mActions[i].mTarget.mdV[VX] << "\t" << mActions[i].mTarget.mdV[VY] << "\t" << mActions[i].mTarget.mdV[VZ] << '\n'; + file << std::setprecision(32) << mActions[i].mTarget.mdV[VX] << "\t" << mActions[i].mTarget.mdV[VY] << "\t" << mActions[i].mTarget.mdV[VZ]; +#if CAM_FIELDS + file << "\t" << mActions[i].mCameraView; + + file << "\t" << mActions[i].mCameraOrigin[VX] + << "\t" << mActions[i].mCameraOrigin[VY] + << "\t" << mActions[i].mCameraOrigin[VZ]; + + file << "\t" << mActions[i].mCameraXAxis[VX] + << "\t" << mActions[i].mCameraXAxis[VY] + << "\t" << mActions[i].mCameraXAxis[VZ]; + + file << "\t" << mActions[i].mCameraYAxis[VX] + << "\t" << mActions[i].mCameraYAxis[VY] + << "\t" << mActions[i].mCameraYAxis[VZ]; + + file << "\t" << mActions[i].mCameraZAxis[VX] + << "\t" << mActions[i].mCameraZAxis[VY] + << "\t" << mActions[i].mCameraZAxis[VZ]; +#endif + file << '\n'; } file.close(); @@ -136,6 +181,12 @@ void LLAgentPilot::addAction(enum EActionType action_type) action.mType = action_type; action.mTarget = gAgent.getPositionGlobal(); action.mTime = mTimer.getElapsedTimeF32(); + LLViewerCamera *cam = LLViewerCamera::getInstance(); + action.mCameraView = cam->getView(); + action.mCameraOrigin = cam->getOrigin(); + action.mCameraXAxis = cam->getXAxis(); + action.mCameraYAxis = cam->getYAxis(); + action.mCameraZAxis = cam->getZAxis(); mLastRecordTime = (F32)action.mTime; mActions.put(action); } @@ -151,7 +202,12 @@ void LLAgentPilot::startPlayback() if (mActions.count()) { llinfos << "Starting playback, moving to waypoint 0" << llendl; + if (!LLViewerJoystick::getInstance()->getOverrideCamera()) + { + LLViewerJoystick::getInstance()->toggleFlycam(); + } gAgent.startAutoPilotGlobal(mActions[0].mTarget); + moveCamera(mActions[0]); mStarted = FALSE; } else @@ -178,6 +234,15 @@ void LLAgentPilot::stopPlayback() } } +void LLAgentPilot::moveCamera(Action& action) +{ + LLViewerCamera::getInstance()->setView(action.mCameraView); + LLViewerCamera::getInstance()->setOrigin(action.mCameraOrigin); + LLViewerCamera::getInstance()->mXAxis = LLVector3(action.mCameraXAxis); + LLViewerCamera::getInstance()->mYAxis = LLVector3(action.mCameraYAxis); + LLViewerCamera::getInstance()->mZAxis = LLVector3(action.mCameraZAxis); +} + void LLAgentPilot::updateTarget() { if (mPlaying) @@ -209,6 +274,7 @@ void LLAgentPilot::updateTarget() if (mCurrentAction < mActions.count()) { gAgent.startAutoPilotGlobal(mActions[mCurrentAction].mTarget); + moveCamera(mActions[mCurrentAction]); } else { -- cgit v1.2.3 From 3ae3a4a6cb2b23e78493ae04f365188b95efcd64 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 9 Feb 2011 17:07:13 -0500 Subject: SH-915 WIP - support pilot.xml with extended camera info --- indra/newview/llagentpilot.cpp | 111 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 105 insertions(+), 6 deletions(-) (limited to 'indra/newview/llagentpilot.cpp') diff --git a/indra/newview/llagentpilot.cpp b/indra/newview/llagentpilot.cpp index 92e0180b46..1a443e62a4 100755 --- a/indra/newview/llagentpilot.cpp +++ b/indra/newview/llagentpilot.cpp @@ -36,6 +36,8 @@ #include "llviewercontrol.h" #include "llviewercamera.h" #include "llviewerjoystick.h" +#include "llsdserialize.h" +#include "llsdutil_math.h" LLAgentPilot gAgentPilot; @@ -58,9 +60,28 @@ LLAgentPilot::~LLAgentPilot() { } -#define CAM_FIELDS 1 +#define CAM_FIELDS 0 -void LLAgentPilot::load(const std::string& filename) +void LLAgentPilot::load() +{ + std::string txt_filename = gSavedSettings.getString("StatsPilotFile"); + std::string xml_filename = gSavedSettings.getString("StatsPilotXMLFile"); + if (LLFile::isfile(xml_filename)) + { + loadXML(xml_filename); + } + else if (LLFile::isfile(txt_filename)) + { + loadTxt(txt_filename); + } + else + { + lldebugs << "no autopilot file found" << llendl; + return; + } +} + +void LLAgentPilot::loadTxt(const std::string& filename) { if(filename.empty()) { @@ -112,12 +133,58 @@ void LLAgentPilot::load(const std::string& filename) mActions.put(new_action); } - mOverrideCamera = true; + mOverrideCamera = false; file.close(); } -void LLAgentPilot::save(const std::string& filename) +void LLAgentPilot::loadXML(const std::string& filename) +{ + if(filename.empty()) + { + return; + } + + llifstream file(filename); + + if (!file) + { + lldebugs << "Couldn't open " << filename + << ", aborting agentpilot load!" << llendl; + return; + } + else + { + llinfos << "Opening pilot file " << filename << llendl; + } + + LLSD record; + while (!file.eof() && LLSDSerialize::fromXML(record, file)) + { + Action action; + action.mTime = record["time"].asReal(); + action.mType = (EActionType)record["type"].asInteger(); + action.mCameraView = record["camera_view"].asReal(); + action.mTarget = ll_vector3d_from_sd(record["target"]); + action.mCameraOrigin = ll_vector3_from_sd(record["camera_origin"]); + action.mCameraXAxis = ll_vector3_from_sd(record["camera_xaxis"]); + action.mCameraYAxis = ll_vector3_from_sd(record["camera_yaxis"]); + action.mCameraZAxis = ll_vector3_from_sd(record["camera_zaxis"]); + mActions.put(action); + } + mOverrideCamera = true; + file.close(); +} + +void LLAgentPilot::save() +{ + std::string txt_filename = gSavedSettings.getString("StatsPilotFile"); + std::string xml_filename = gSavedSettings.getString("StatsPilotXMLFile"); + saveTxt(txt_filename); + saveXML(xml_filename); +} + +void LLAgentPilot::saveTxt(const std::string& filename) { llofstream file; file.open(filename); @@ -159,6 +226,34 @@ void LLAgentPilot::save(const std::string& filename) file.close(); } +void LLAgentPilot::saveXML(const std::string& filename) +{ + llofstream file; + file.open(filename); + + if (!file) + { + llinfos << "Couldn't open " << filename << ", aborting agentpilot save!" << llendl; + } + + S32 i; + for (i = 0; i < mActions.count(); i++) + { + Action& action = mActions[i]; + LLSD record; + record["time"] = (LLSD::Real)action.mTime; + record["type"] = (LLSD::Integer)action.mType; + record["camera_view"] = (LLSD::Real)action.mCameraView; + record["target"] = ll_sd_from_vector3d(action.mTarget); + record["camera_origin"] = ll_sd_from_vector3(action.mCameraOrigin); + record["camera_xaxis"] = ll_sd_from_vector3(action.mCameraXAxis); + record["camera_yaxis"] = ll_sd_from_vector3(action.mCameraYAxis); + record["camera_zaxis"] = ll_sd_from_vector3(action.mCameraZAxis); + LLSDSerialize::toXML(record, file); + } + file.close(); +} + void LLAgentPilot::startRecord() { mActions.reset(); @@ -170,7 +265,7 @@ void LLAgentPilot::startRecord() void LLAgentPilot::stopRecord() { gAgentPilot.addAction(STRAIGHT); - gAgentPilot.save(gSavedSettings.getString("StatsPilotFile")); + gAgentPilot.save(); mRecording = FALSE; } @@ -202,7 +297,8 @@ void LLAgentPilot::startPlayback() if (mActions.count()) { llinfos << "Starting playback, moving to waypoint 0" << llendl; - if (!LLViewerJoystick::getInstance()->getOverrideCamera()) + if (getOverrideCamera() && + !LLViewerJoystick::getInstance()->getOverrideCamera()) { LLViewerJoystick::getInstance()->toggleFlycam(); } @@ -236,6 +332,9 @@ void LLAgentPilot::stopPlayback() void LLAgentPilot::moveCamera(Action& action) { + if (!getOverrideCamera()) + return; + LLViewerCamera::getInstance()->setView(action.mCameraView); LLViewerCamera::getInstance()->setOrigin(action.mCameraOrigin); LLViewerCamera::getInstance()->mXAxis = LLVector3(action.mCameraXAxis); -- cgit v1.2.3 From 54bf80bf450fa6b8b50c573ca5ef902b4462d410 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 9 Feb 2011 18:23:30 -0500 Subject: SH-915 WIP - cleanup --- indra/newview/llagentpilot.cpp | 41 ++--------------------------------------- 1 file changed, 2 insertions(+), 39 deletions(-) (limited to 'indra/newview/llagentpilot.cpp') diff --git a/indra/newview/llagentpilot.cpp b/indra/newview/llagentpilot.cpp index 1a443e62a4..25318c940a 100755 --- a/indra/newview/llagentpilot.cpp +++ b/indra/newview/llagentpilot.cpp @@ -60,8 +60,6 @@ LLAgentPilot::~LLAgentPilot() { } -#define CAM_FIELDS 0 - void LLAgentPilot::load() { std::string txt_filename = gSavedSettings.getString("StatsPilotFile"); @@ -101,6 +99,7 @@ void LLAgentPilot::loadTxt(const std::string& filename) llinfos << "Opening pilot file " << filename << llendl; } + mActions.reset(); S32 num_actions; file >> num_actions; @@ -111,24 +110,6 @@ void LLAgentPilot::loadTxt(const std::string& filename) Action new_action; file >> new_action.mTime >> action_type; file >> new_action.mTarget.mdV[VX] >> new_action.mTarget.mdV[VY] >> new_action.mTarget.mdV[VZ]; -#if CAM_FIELDS - file >> new_action.mCameraView; - file >> new_action.mCameraOrigin.mV[VX] - >> new_action.mCameraOrigin.mV[VY] - >> new_action.mCameraOrigin.mV[VZ]; - - file >> new_action.mCameraXAxis.mV[VX] - >> new_action.mCameraXAxis.mV[VY] - >> new_action.mCameraXAxis.mV[VZ]; - - file >> new_action.mCameraYAxis.mV[VX] - >> new_action.mCameraYAxis.mV[VY] - >> new_action.mCameraYAxis.mV[VZ]; - - file >> new_action.mCameraZAxis.mV[VX] - >> new_action.mCameraZAxis.mV[VY] - >> new_action.mCameraZAxis.mV[VZ]; -#endif new_action.mType = (EActionType)action_type; mActions.put(new_action); } @@ -158,6 +139,7 @@ void LLAgentPilot::loadXML(const std::string& filename) llinfos << "Opening pilot file " << filename << llendl; } + mActions.reset(); LLSD record; while (!file.eof() && LLSDSerialize::fromXML(record, file)) { @@ -201,25 +183,6 @@ void LLAgentPilot::saveTxt(const std::string& filename) { file << mActions[i].mTime << "\t" << mActions[i].mType << "\t"; file << std::setprecision(32) << mActions[i].mTarget.mdV[VX] << "\t" << mActions[i].mTarget.mdV[VY] << "\t" << mActions[i].mTarget.mdV[VZ]; -#if CAM_FIELDS - file << "\t" << mActions[i].mCameraView; - - file << "\t" << mActions[i].mCameraOrigin[VX] - << "\t" << mActions[i].mCameraOrigin[VY] - << "\t" << mActions[i].mCameraOrigin[VZ]; - - file << "\t" << mActions[i].mCameraXAxis[VX] - << "\t" << mActions[i].mCameraXAxis[VY] - << "\t" << mActions[i].mCameraXAxis[VZ]; - - file << "\t" << mActions[i].mCameraYAxis[VX] - << "\t" << mActions[i].mCameraYAxis[VY] - << "\t" << mActions[i].mCameraYAxis[VZ]; - - file << "\t" << mActions[i].mCameraZAxis[VX] - << "\t" << mActions[i].mCameraZAxis[VY] - << "\t" << mActions[i].mCameraZAxis[VZ]; -#endif file << '\n'; } -- cgit v1.2.3 From 49b8f8af026a627db47c9592fc92eccda790401e Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 10 Feb 2011 15:57:08 -0500 Subject: SH-915 WIP - LLAgentPilot class cleanup, added interpolation for camera motion --- indra/newview/llagentpilot.cpp | 81 +++++++++++++++++++++++------------------- 1 file changed, 44 insertions(+), 37 deletions(-) (limited to 'indra/newview/llagentpilot.cpp') diff --git a/indra/newview/llagentpilot.cpp b/indra/newview/llagentpilot.cpp index 25318c940a..f96db0a5df 100755 --- a/indra/newview/llagentpilot.cpp +++ b/indra/newview/llagentpilot.cpp @@ -41,9 +41,6 @@ LLAgentPilot gAgentPilot; -BOOL LLAgentPilot::sLoop = TRUE; -BOOL LLAgentPilot::sReplaySession = FALSE; - LLAgentPilot::LLAgentPilot() : mNumRuns(-1), mQuitAfterRuns(FALSE), @@ -52,7 +49,9 @@ LLAgentPilot::LLAgentPilot() : mStarted(FALSE), mPlaying(FALSE), mCurrentAction(0), - mOverrideCamera(FALSE) + mOverrideCamera(FALSE), + mLoop(TRUE), + mReplaySession(FALSE) { } @@ -266,7 +265,7 @@ void LLAgentPilot::startPlayback() LLViewerJoystick::getInstance()->toggleFlycam(); } gAgent.startAutoPilotGlobal(mActions[0].mTarget); - moveCamera(mActions[0]); + moveCamera(); mStarted = FALSE; } else @@ -287,22 +286,51 @@ void LLAgentPilot::stopPlayback() gAgent.stopAutoPilot(); } - if (sReplaySession) + if (mReplaySession) { LLAppViewer::instance()->forceQuit(); } } -void LLAgentPilot::moveCamera(Action& action) +void LLAgentPilot::moveCamera() { if (!getOverrideCamera()) return; + + if (mCurrentAction 0.0) + { + t = tickelapsed/timedelta; + } + + if ((t<0.0)||(t>1.0)) + { + llwarns << "mCurrentAction is invalid, t = " << t << llendl; + return; + } + + Action& start = mActions[start_index]; + Action& end = mActions[end_index]; + + F32 view = lerp(start.mCameraView, end.mCameraView, t); + LLVector3 origin = lerp(start.mCameraOrigin, end.mCameraOrigin, t); + LLQuaternion start_quat(start.mCameraXAxis, start.mCameraYAxis, start.mCameraZAxis); + LLQuaternion end_quat(end.mCameraXAxis, end.mCameraYAxis, end.mCameraZAxis); + LLQuaternion quat = nlerp(t, start_quat, end_quat); + LLMatrix3 mat(quat); - LLViewerCamera::getInstance()->setView(action.mCameraView); - LLViewerCamera::getInstance()->setOrigin(action.mCameraOrigin); - LLViewerCamera::getInstance()->mXAxis = LLVector3(action.mCameraXAxis); - LLViewerCamera::getInstance()->mYAxis = LLVector3(action.mCameraYAxis); - LLViewerCamera::getInstance()->mZAxis = LLVector3(action.mCameraZAxis); + LLViewerCamera::getInstance()->setView(view); + LLViewerCamera::getInstance()->setOrigin(origin); + LLViewerCamera::getInstance()->mXAxis = LLVector3(mat.mMatrix[0]); + LLViewerCamera::getInstance()->mYAxis = LLVector3(mat.mMatrix[1]); + LLViewerCamera::getInstance()->mZAxis = LLVector3(mat.mMatrix[2]); + } } void LLAgentPilot::updateTarget() @@ -336,13 +364,13 @@ void LLAgentPilot::updateTarget() if (mCurrentAction < mActions.count()) { gAgent.startAutoPilotGlobal(mActions[mCurrentAction].mTarget); - moveCamera(mActions[mCurrentAction]); + moveCamera(); } else { stopPlayback(); mNumRuns--; - if (sLoop) + if (mLoop) { if ((mNumRuns < 0) || (mNumRuns > 0)) { @@ -377,29 +405,8 @@ void LLAgentPilot::updateTarget() } } -// static -void LLAgentPilot::startRecord(void *) -{ - gAgentPilot.startRecord(); -} - -void LLAgentPilot::saveRecord(void *) -{ - gAgentPilot.stopRecord(); -} - -void LLAgentPilot::addWaypoint(void *) +void LLAgentPilot::addWaypoint() { - gAgentPilot.addAction(STRAIGHT); -} - -void LLAgentPilot::startPlayback(void *) -{ - gAgentPilot.mNumRuns = -1; - gAgentPilot.startPlayback(); + addAction(STRAIGHT); } -void LLAgentPilot::stopPlayback(void *) -{ - gAgentPilot.stopPlayback(); -} -- cgit v1.2.3 From d381ec420972722cc176910b4d9e2f7ecf45288a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 11 Feb 2011 13:19:49 -0500 Subject: SH-915 WIP - removed coupling between autopilot flycam and joystick flycam --- indra/newview/llagentpilot.cpp | 6 ------ 1 file changed, 6 deletions(-) (limited to 'indra/newview/llagentpilot.cpp') diff --git a/indra/newview/llagentpilot.cpp b/indra/newview/llagentpilot.cpp index f96db0a5df..734c502fcf 100755 --- a/indra/newview/llagentpilot.cpp +++ b/indra/newview/llagentpilot.cpp @@ -35,7 +35,6 @@ #include "llappviewer.h" #include "llviewercontrol.h" #include "llviewercamera.h" -#include "llviewerjoystick.h" #include "llsdserialize.h" #include "llsdutil_math.h" @@ -259,11 +258,6 @@ void LLAgentPilot::startPlayback() if (mActions.count()) { llinfos << "Starting playback, moving to waypoint 0" << llendl; - if (getOverrideCamera() && - !LLViewerJoystick::getInstance()->getOverrideCamera()) - { - LLViewerJoystick::getInstance()->toggleFlycam(); - } gAgent.startAutoPilotGlobal(mActions[0].mTarget); moveCamera(); mStarted = FALSE; -- cgit v1.2.3