Permalink
Browse files

Added a ball to knock over the pyramid topple benchmark

  • Loading branch information...
1 parent 9765de7 commit a9d654ee8db40c0d0dcc8d87329ce648ce023888 @josephg josephg committed Dec 30, 2011
Showing with 14 additions and 1 deletion.
  1. +7 −1 benchmark/bench.js
  2. +4 −0 cp.js
  3. +3 −0 lib/cpBBTree.js
View
@@ -373,7 +373,7 @@ add_benchmark({name:'NoCollide', ticks:2000}, function(){
return space;
});
-add_benchmark({name:'PyramidTopple', dt:1/180, ticks:5000}, function(){
+add_benchmark({name:'PyramidTopple', dt:1/180, ticks:400}, function(){
var WIDTH = 4;
var HEIGHT = 30;
@@ -421,6 +421,12 @@ add_benchmark({name:'PyramidTopple', dt:1/180, ticks:5000}, function(){
}
}
}
+
+ // Add a circle to knock the dominoes down
+ var body = space.addBody(new Body(2, momentForCircle(2, 0, 5, v(0,0))));
+ body.setPos(v(65, 100));
+ var shape = space.addShape(new CircleShape(body, 5, v(0,0)));
+ shape.setElasticity(0);
});
// TODO ideas:
View
4 cp.js
@@ -2053,6 +2053,10 @@ var bbProximity = function(a, b)
var subtreeInsert = function(subtree, leaf, tree)
{
+
+// var s = new Error().stack;
+// traces[s] = traces[s] ? traces[s]+1 : 1;
+
if(subtree == null){
return leaf;
} else if(subtree.isLeaf){
View
@@ -294,6 +294,9 @@ var bbProximity = function(a, b)
var subtreeInsert = function(subtree, leaf, tree)
{
+// var s = new Error().stack;
+// traces[s] = traces[s] ? traces[s]+1 : 1;
+
if(subtree == null){
return leaf;
} else if(subtree.isLeaf){

0 comments on commit a9d654e

Please sign in to comment.