diff options
| author | GreYFoXGTi <GreYFoXGTi@GMaiL.CoM> | 2011-02-13 08:47:51 +0200 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2011-02-13 12:57:10 +0100 |
| commit | 68a1a29db8641348937548fea1cb32dab2317a0c (patch) | |
| tree | b183103f2269e095b2a3180d34ea97e9dd75d03e /src/game/gamecore.cpp | |
| parent | 7bfbe24a1c55613219caa2ab59da7558207d9e82 (diff) | |
| download | zcatch-68a1a29db8641348937548fea1cb32dab2317a0c.tar.gz zcatch-68a1a29db8641348937548fea1cb32dab2317a0c.zip | |
Reverted 1 Letter Refactoring or Edited it to a full name.
Diffstat (limited to 'src/game/gamecore.cpp')
| -rw-r--r-- | src/game/gamecore.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/game/gamecore.cpp b/src/game/gamecore.cpp index a3d3e6c9..52b9b558 100644 --- a/src/game/gamecore.cpp +++ b/src/game/gamecore.cpp @@ -43,9 +43,9 @@ bool CTuningParams::Get(const char *pName, float *pValue) return false; } -float HermiteBasis1(float V) +float HermiteBasis1(float v) { - return 2*V*V*V - 3*V*V+1; + return 2*v*v*v - 3*v*v+1; } float VelocityRamp(float Value, float Start, float Range, float Curvature) @@ -100,16 +100,16 @@ void CCharacterCore::Tick(bool UseInput) m_Direction = m_Input.m_Direction; // setup angle - float A = 0; + float a = 0; if(m_Input.m_TargetX == 0) - A = atanf((float)m_Input.m_TargetY); + a = atanf((float)m_Input.m_TargetY); else - A = atanf((float)m_Input.m_TargetY/(float)m_Input.m_TargetX); + a = atanf((float)m_Input.m_TargetY/(float)m_Input.m_TargetX); if(m_Input.m_TargetX < 0) - A = A+pi; + a = a+pi; - m_Angle = (int)(A*256.0f); + m_Angle = (int)(a*256.0f); // handle jump if(m_Input.m_Jump) @@ -209,7 +209,7 @@ void CCharacterCore::Tick(bool UseInput) // Check against other players first if(m_pWorld && m_pWorld->m_Tuning.m_PlayerHooking) { - float Dist = 0.0f; + float Distance = 0.0f; for(int i = 0; i < MAX_CLIENTS; i++) { CCharacterCore *pCharCore = m_pWorld->m_apCharacters[i]; @@ -219,12 +219,12 @@ void CCharacterCore::Tick(bool UseInput) vec2 ClosestPoint = closest_point_on_line(m_HookPos, NewPos, pCharCore->m_Pos); if(distance(pCharCore->m_Pos, ClosestPoint) < PhysSize+2.0f) { - if (m_HookedPlayer == -1 || distance(m_HookPos, pCharCore->m_Pos) < Dist) + if (m_HookedPlayer == -1 || distance(m_HookPos, pCharCore->m_Pos) < Distance) { m_TriggeredEvents |= COREEVENT_HOOK_ATTACH_PLAYER; m_HookState = HOOK_GRABBED; m_HookedPlayer = i; - Dist = distance(m_HookPos, pCharCore->m_Pos); + Distance = distance(m_HookPos, pCharCore->m_Pos); } } } @@ -315,28 +315,28 @@ void CCharacterCore::Tick(bool UseInput) continue; // make sure that we don't nudge our self // handle player <-> player collision - float D = distance(m_Pos, pCharCore->m_Pos); + float Distance = distance(m_Pos, pCharCore->m_Pos); vec2 Dir = normalize(m_Pos - pCharCore->m_Pos); - if(D < PhysSize*1.25f && D > 1.0f) + if(Distance < PhysSize*1.25f && Distance > 1.0f) { - float A = (PhysSize*1.45f - D); - float V = 0.5f; + float a = (PhysSize*1.45f - Distance); + float Velocity = 0.5f; // make sure that we don't add excess force by checking the // direction against the current velocity. if not zero. if (length(m_Vel) > 0.0001) - V = 1-(dot(normalize(m_Vel), Dir)+1)/2; + Velocity = 1-(dot(normalize(m_Vel), Dir)+1)/2; - m_Vel += Dir*A*(V*0.75f); + m_Vel += Dir*a*(Velocity*0.75f); m_Vel *= 0.85f; } // handle hook influence if(m_HookedPlayer == i) { - if(D > PhysSize*1.50f) // TODO: fix tweakable variable + if(Distance > PhysSize*1.50f) // TODO: fix tweakable variable { - float Accel = m_pWorld->m_Tuning.m_HookDragAccel * (D/m_pWorld->m_Tuning.m_HookLength); + float Accel = m_pWorld->m_Tuning.m_HookDragAccel * (Distance/m_pWorld->m_Tuning.m_HookLength); float DragSpeed = m_pWorld->m_Tuning.m_HookDragSpeed; // add force to the hooked player |