Loading libs/rs/java/Balls/src/com/android/balls/BallsRS.java +1 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ import android.renderscript.*; import android.util.Log; public class BallsRS { public static final int PART_COUNT = 800; public static final int PART_COUNT = 1000; public BallsRS() { } Loading libs/rs/java/Balls/src/com/android/balls/ball_physics.rs +14 −1 Original line number Diff line number Diff line Loading @@ -41,8 +41,21 @@ void root(const Ball_t *ballIn, Ball_t *ballOut, const BallControl_t *ctl, uint3 fv -= (vec / (len * len * len)) * 20000.f; } else { if (len2 < 0.1) { if (xin == x) { continue; } ballOut->delta = 0.f; ballOut->position = ballIn->position; if (xin > x) { ballOut->position.x += 1.f; } else { ballOut->position.x -= 1.f; } ballOut->color.rgb = 1.f; ballOut->arcID = -1; ballOut->arcStr = 0; return; } // Collision float2 axis = normalize(vec); float e1 = dot(axis, ballIn->delta); Loading Loading
libs/rs/java/Balls/src/com/android/balls/BallsRS.java +1 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ import android.renderscript.*; import android.util.Log; public class BallsRS { public static final int PART_COUNT = 800; public static final int PART_COUNT = 1000; public BallsRS() { } Loading
libs/rs/java/Balls/src/com/android/balls/ball_physics.rs +14 −1 Original line number Diff line number Diff line Loading @@ -41,8 +41,21 @@ void root(const Ball_t *ballIn, Ball_t *ballOut, const BallControl_t *ctl, uint3 fv -= (vec / (len * len * len)) * 20000.f; } else { if (len2 < 0.1) { if (xin == x) { continue; } ballOut->delta = 0.f; ballOut->position = ballIn->position; if (xin > x) { ballOut->position.x += 1.f; } else { ballOut->position.x -= 1.f; } ballOut->color.rgb = 1.f; ballOut->arcID = -1; ballOut->arcStr = 0; return; } // Collision float2 axis = normalize(vec); float e1 = dot(axis, ballIn->delta); Loading