diff --git a/code/ryzom/client/src/motion/modes/cam_anim_mode.cpp b/code/ryzom/client/src/motion/modes/cam_anim_mode.cpp index 9122c5dcc..9fcd66b74 100644 --- a/code/ryzom/client/src/motion/modes/cam_anim_mode.cpp +++ b/code/ryzom/client/src/motion/modes/cam_anim_mode.cpp @@ -69,8 +69,7 @@ void CUserControls::camAnimModeStart() //----------------------------------------------- void CUserControls::camAnimModeStop() { - UserEntity->frontVelocity(_CamAnimEntityFrontVelocity); - UserEntity->lateralVelocity(_CamAnimEntityLateralVelocity); + }// camAnimModeStop // //----------------------------------------------- diff --git a/code/ryzom/client/src/motion/user_controls.cpp b/code/ryzom/client/src/motion/user_controls.cpp index 25d19aa22..edebd1261 100644 --- a/code/ryzom/client/src/motion/user_controls.cpp +++ b/code/ryzom/client/src/motion/user_controls.cpp @@ -172,9 +172,6 @@ void CUserControls::init() _NeedReleaseForward = false; _NextForwardCancelMoveTo = false; - _CamAnimEntityFrontVelocity = 0.f; - _CamAnimEntityLateralVelocity = 0.f; - }// init // diff --git a/code/ryzom/client/src/motion/user_controls.h b/code/ryzom/client/src/motion/user_controls.h index 0a7045373..d2a2fb598 100644 --- a/code/ryzom/client/src/motion/user_controls.h +++ b/code/ryzom/client/src/motion/user_controls.h @@ -314,9 +314,6 @@ private: /// when true the next forward action will cancel any moveto bool _NextForwardCancelMoveTo; - /// Variables used by the camera animation mode to remember values - float _CamAnimEntityFrontVelocity; - float _CamAnimEntityLateralVelocity; }; /// User Controls (mouse, keyboard, interfaces, ...) diff --git a/code/ryzom/client/src/view.cpp b/code/ryzom/client/src/view.cpp index a233fe155..85aa9f23e 100644 --- a/code/ryzom/client/src/view.cpp +++ b/code/ryzom/client/src/view.cpp @@ -148,14 +148,14 @@ void CView::update() //----------------------------------------------- CVector CView::currentViewPos() const { - // If we are in camanimmode or deathmode we just return the viewpos - if (UserControls.mode() == CUserControls::DeathMode || UserControls.mode() == CUserControls::CamAnimMode) + // If we are in camanimmode we just return the viewpos + if (UserControls.mode() == CUserControls::CamAnimMode) return _ViewPos; // clamp to the collisioned camera distance float minCamDist= min(_CurrentCameraDist, _CollisionCameraDist); - if(_RearView) + if (_RearView && UserControls.mode() != CUserControls::DeathMode) { CVector v; if(UserEntity->viewMode() == CUserEntity::FirstPV || _ForceFirstPersonView) @@ -191,11 +191,11 @@ CVector CView::currentViewPos() const //----------------------------------------------- CVector CView::currentView() const { - // If we are in camanimmode or deathmode we just return the view - if (UserControls.mode() == CUserControls::DeathMode || UserControls.mode() == CUserControls::CamAnimMode) + // If we are in camanimmode we just return the view + if (UserControls.mode() == CUserControls::CamAnimMode) return _View; - if(_RearView) + if (_RearView && UserControls.mode() != CUserControls::DeathMode) { CVector v; v.x = -UserEntity->front().x; @@ -213,15 +213,15 @@ CVector CView::currentView() const //----------------------------------------------- CVector CView::currentCameraTarget() const { - // If we are in camanimmode or deathmode we just return the viewpos - if (UserControls.mode() == CUserControls::DeathMode || UserControls.mode() == CUserControls::CamAnimMode) + // If we are in camanimmode we just return the viewpos + if (UserControls.mode() == CUserControls::CamAnimMode) return _ViewPos; if(UserEntity->viewMode() == CUserEntity::FirstPV || _ForceFirstPersonView) return currentViewPos(); else { - if(_RearView) + if (_RearView && UserControls.mode() != CUserControls::DeathMode) { return UserEntity->pos() + CVector(0.0f, 0.0f, 2.0f); } diff --git a/code/ryzom/server/src/entities_game_service/camera_animation_manager/camera_animation_manager.cpp b/code/ryzom/server/src/entities_game_service/camera_animation_manager/camera_animation_manager.cpp index a64df0edf..c1dccfbe7 100644 --- a/code/ryzom/server/src/entities_game_service/camera_animation_manager/camera_animation_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/camera_animation_manager/camera_animation_manager.cpp @@ -147,6 +147,8 @@ void CCameraAnimationManager::sendAnimation(const NLMISC::CEntityId& eid, const void CCameraAnimationManager::TCameraAnimInfo::sendAnimationSteps(const NLMISC::CEntityId& eid) { // We first send an impulse to the client to tell him an animation will start (this way he can remember its current position) + nldebug("CameraAnimation sending impulse for starting anim, eidDynamicId: %d", (int)eid.getDynamicId()); + PlayerManager.sendImpulseToClient(eid, "CAMERA_ANIMATION:PLAY"); // We send the first step, and then the others @@ -173,6 +175,10 @@ bool CCameraAnimationManager::TCameraAnimInfo::sendAnimationStep(const NLMISC::C // We add the buffer to the message msgout.serialBufferWithSize((uint8*)bms.buffer(), bms.length()); + + nldebug("CameraAnimation sending impulse for step %s, buffer length: %d, eidDynamicId: %d", step->getStepName().c_str(), + bms.length(), (int)eid.getDynamicId()); + NLNET::CUnifiedNetwork::getInstance()->send(NLNET::TServiceId(eid.getDynamicId()), msgout); return true; @@ -196,6 +202,8 @@ void CCameraAnimationManager::TCameraAnimInfo::sendAnimationStepsFrom(const NLMI else { // There was no other step, so we send an impulse to tell the client it's finished + nldebug("CameraAnimation sending impulse for finished anim, eidDynamicId: %d", (int)eid.getDynamicId()); + PlayerManager.sendImpulseToClient(eid, "CAMERA_ANIMATION:FINISHED"); } } \ No newline at end of file diff --git a/code/ryzom/server/src/entities_game_service/camera_animation_manager/camera_animation_manager.h b/code/ryzom/server/src/entities_game_service/camera_animation_manager/camera_animation_manager.h index ed0600cd2..0395976ae 100644 --- a/code/ryzom/server/src/entities_game_service/camera_animation_manager/camera_animation_manager.h +++ b/code/ryzom/server/src/entities_game_service/camera_animation_manager/camera_animation_manager.h @@ -108,7 +108,16 @@ private: { _Infos = info; _Next = nextStep; + + nldebug("TCameraAnimTimerEvent constructor for step %s, eidDynamicId: %d", info->Name.c_str(), + (int)eid.getDynamicId()); } + + ~TCameraAnimTimerEvent() + { + nldebug("TCameraAnimTimerEvent destructor"); + } + // Callback called when the timer finished void timerCallback(CTimer* owner) { @@ -124,7 +133,7 @@ private: private: TCameraAnimInfo* _Infos; int _Next; - const NLMISC::CEntityId& _Eid; + NLMISC::CEntityId _Eid; }; }; diff --git a/code/ryzom/server/src/entities_game_service/camera_animation_manager/camera_animation_steps.cpp b/code/ryzom/server/src/entities_game_service/camera_animation_manager/camera_animation_steps.cpp index 6fe02c758..a44d3c383 100644 --- a/code/ryzom/server/src/entities_game_service/camera_animation_manager/camera_animation_steps.cpp +++ b/code/ryzom/server/src/entities_game_service/camera_animation_manager/camera_animation_steps.cpp @@ -111,6 +111,8 @@ public: virtual void sendAnimationStep(NLMISC::CBitMemStream& bms) { CCameraAnimationStepBasic::sendAnimationStep(bms); + + nldebug("CameraAnimation - step %s . Value: Duration: %f", getStepName().c_str(), Duration); } CAMERA_ANIMATION_STEP_NAME("camera_animation_static"); @@ -163,6 +165,8 @@ public: } bms.serial(const_cast(pos)); + + nldebug("CameraAnimation - step %s . Value: Duration: %f", getStepName().c_str(), Duration); } CAMERA_ANIMATION_STEP_NAME("camera_animation_go_to"); @@ -231,6 +235,8 @@ public: bms.serial(const_cast(pos)); bms.serial(const_cast(DistanceToEntity)); + + nldebug("CameraAnimation - step %s . Value: Duration: %f", getStepName().c_str(), Duration); } CAMERA_ANIMATION_STEP_NAME("camera_animation_follow_entity"); @@ -315,6 +321,8 @@ public: bms.serial(const_cast(pos)); bms.serial(const_cast(DistanceToPoint)); bms.serial(const_cast(Speed)); + + nldebug("CameraAnimation - step %s . Value: Duration: %f", getStepName().c_str(), Duration); } CAMERA_ANIMATION_STEP_NAME("camera_animation_turn_around"); @@ -358,6 +366,8 @@ public: virtual void sendAnimationStep(NLMISC::CBitMemStream& bms) { bms.serial(const_cast(Duration)); + + nldebug("CameraAnimation - step %s . Value: Duration: %f", getStepName().c_str(), Duration); } virtual float getDuration() const