Skip to content
This repository has been archived by the owner on Dec 15, 2019. It is now read-only.

Commit

Permalink
fix re #76. sweep prune had wrong aabb dims
Browse files Browse the repository at this point in the history
  • Loading branch information
wellcaffeinated committed Nov 14, 2014
1 parent 2e062a0 commit 2f3fa43
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/behaviors/sweep-prune.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,7 @@ Physics.behavior('sweep-prune', function( parent ){

var tr
,intr
,scratch = Physics.scratchpad()
,pos = scratch.vector()
,aabb
,span = scratch.vector()
,list = this.tracked
,i = list.length
;
Expand All @@ -373,17 +370,13 @@ Physics.behavior('sweep-prune', function( parent ){

tr = list[ i ];
intr = tr.interval;
pos.clone( tr.body.state.pos );
aabb = tr.body.aabb();
span.set( aabb.hw, aabb.hh );

// copy the position (plus or minus) the aabb half-dimensions
// into the min/max intervals
intr.min.val.clone( pos ).vsub( span );
intr.max.val.clone( pos ).vadd( span );
intr.min.val.clone( aabb ).sub( aabb.hw, aabb.hh );
intr.max.val.clone( aabb ).add( aabb.hw, aabb.hh );
}

scratch.done();
},

/** internal
Expand Down

0 comments on commit 2f3fa43

Please sign in to comment.