summaryrefslogtreecommitdiffstats
path: root/res/raw/rollo.c
diff options
context:
space:
mode:
authorJason Sams <rjsams@android.com>2009-10-02 18:43:18 -0700
committerJason Sams <rjsams@android.com>2009-10-02 18:43:18 -0700
commit0aa71664142922b7c071785578373ee839211b84 (patch)
tree849a59140c2dfd505d943d2a2689b3cefe0db700 /res/raw/rollo.c
parent539ed9dfee12564f0bf43822481c7a9b81e5d8b7 (diff)
downloadandroid_packages_apps_Trebuchet-0aa71664142922b7c071785578373ee839211b84.tar.gz
android_packages_apps_Trebuchet-0aa71664142922b7c071785578373ee839211b84.tar.bz2
android_packages_apps_Trebuchet-0aa71664142922b7c071785578373ee839211b84.zip
Minor physics tweaks to make movement more responsive. checkpoint alt layout.
Diffstat (limited to 'res/raw/rollo.c')
-rw-r--r--res/raw/rollo.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/res/raw/rollo.c b/res/raw/rollo.c
index 01781e2b4..2b15d7f55 100644
--- a/res/raw/rollo.c
+++ b/res/raw/rollo.c
@@ -25,21 +25,21 @@ float g_ZoomTarget;
#define VIEW_ANGLE 1.28700222f
void init() {
- g_AttractionTable[0] = 4.5f;
- g_AttractionTable[1] = 4.5f;
- g_AttractionTable[2] = 5.0f;
- g_AttractionTable[3] = 4.0f;
- g_AttractionTable[4] = -4.0f;
- g_AttractionTable[5] = -5.0f;
- g_AttractionTable[6] = -4.5f;
- g_AttractionTable[7] = -4.5f;
- g_AttractionTable[8] = -4.5f; // dup 7 to avoid a clamp later
+ g_AttractionTable[0] = 6.5f;
+ g_AttractionTable[1] = 6.5f;
+ g_AttractionTable[2] = 7.0f;
+ g_AttractionTable[3] = 6.0f;
+ g_AttractionTable[4] = -6.0f;
+ g_AttractionTable[5] = -7.0f;
+ g_AttractionTable[6] = -6.5f;
+ g_AttractionTable[7] = -6.5f;
+ g_AttractionTable[8] = -6.5f; // dup 7 to avoid a clamp later
g_FrictionTable[0] = 3.5f;
g_FrictionTable[1] = 3.6f;
- g_FrictionTable[2] = 3.7f;
- g_FrictionTable[3] = 3.8f;
- g_FrictionTable[4] = 3.8f;
- g_FrictionTable[5] = 3.7f;
+ g_FrictionTable[2] = 4.0f;
+ g_FrictionTable[3] = 5.0f;
+ g_FrictionTable[4] = 5.0f;
+ g_FrictionTable[5] = 4.0f;
g_FrictionTable[6] = 3.6f;
g_FrictionTable[7] = 3.5f;
g_FrictionTable[8] = 3.5f; // dup 7 to avoid a clamp later
@@ -72,7 +72,7 @@ void fling() {
g_LastTouchDown = 0;
g_PosVelocity = -state->flingVelocityX;
float av = fabsf(g_PosVelocity);
- float minVel = 3f;
+ float minVel = 3.5f;
minVel *= 1.f - (fabsf(fracf(g_PosPage + 0.5f) - 0.5f) * 0.45f);
@@ -143,7 +143,7 @@ void updatePos() {
//debugF(" friction", friction);
// If our velocity is low OR acceleration is opposing it, apply it.
- if (fabsf(g_PosVelocity) < 0.5f || (g_PosVelocity * accel) < 0) {
+ if (fabsf(g_PosVelocity) < 1.0f || (g_PosVelocity * accel) < 0) {
g_PosVelocity += accel;
}
@@ -175,12 +175,12 @@ void updatePos() {
// Check for out of boundry conditions.
if (g_PosPage < 0 && g_PosVelocity < 0) {
- float damp = 1.0 + (g_PosPage * 3);
+ float damp = 1.0 + (g_PosPage * 4);
damp = clampf(damp, 0.f, 0.9f);
g_PosVelocity *= damp;
}
if (g_PosPage > (g_PageCount-1) && g_PosVelocity > 0) {
- float damp = 1.0 - ((g_PosPage - g_PageCount + 1) * 3);
+ float damp = 1.0 - ((g_PosPage - g_PageCount + 1) * 4);
damp = clampf(damp, 0.f, 0.9f);
g_PosVelocity *= damp;
}