Changed: #1469 Small debug changes

--HG--
branch : gsoc2012-fabien
hg/feature/gsoc2012-fabien
Fabien_HENON 12 years ago
parent 3e6ffa8b43
commit 0553079378

@ -69,8 +69,7 @@ void CUserControls::camAnimModeStart()
//-----------------------------------------------
void CUserControls::camAnimModeStop()
{
UserEntity->frontVelocity(_CamAnimEntityFrontVelocity);
UserEntity->lateralVelocity(_CamAnimEntityLateralVelocity);
}// camAnimModeStop //
//-----------------------------------------------

@ -172,9 +172,6 @@ void CUserControls::init()
_NeedReleaseForward = false;
_NextForwardCancelMoveTo = false;
_CamAnimEntityFrontVelocity = 0.f;
_CamAnimEntityLateralVelocity = 0.f;
}// init //

@ -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, ...)

@ -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);
}

@ -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");
}
}

@ -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;
};
};

@ -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<TPositionOrEntity&>(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<TPositionOrEntity&>(pos));
bms.serial(const_cast<float&>(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<TPositionOrEntity&>(pos));
bms.serial(const_cast<float&>(DistanceToPoint));
bms.serial(const_cast<float&>(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<float&>(Duration));
nldebug("CameraAnimation - step %s . Value: Duration: %f", getStepName().c_str(), Duration);
}
virtual float getDuration() const

Loading…
Cancel
Save