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

Commit 2f3fa43

Browse files
fix re #76. sweep prune had wrong aabb dims
1 parent 2e062a0 commit 2f3fa43

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/behaviors/sweep-prune.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -360,10 +360,7 @@ Physics.behavior('sweep-prune', function( parent ){
360360

361361
var tr
362362
,intr
363-
,scratch = Physics.scratchpad()
364-
,pos = scratch.vector()
365363
,aabb
366-
,span = scratch.vector()
367364
,list = this.tracked
368365
,i = list.length
369366
;
@@ -373,17 +370,13 @@ Physics.behavior('sweep-prune', function( parent ){
373370

374371
tr = list[ i ];
375372
intr = tr.interval;
376-
pos.clone( tr.body.state.pos );
377373
aabb = tr.body.aabb();
378-
span.set( aabb.hw, aabb.hh );
379374

380375
// copy the position (plus or minus) the aabb half-dimensions
381376
// into the min/max intervals
382-
intr.min.val.clone( pos ).vsub( span );
383-
intr.max.val.clone( pos ).vadd( span );
377+
intr.min.val.clone( aabb ).sub( aabb.hw, aabb.hh );
378+
intr.max.val.clone( aabb ).add( aabb.hw, aabb.hh );
384379
}
385-
386-
scratch.done();
387380
},
388381

389382
/** internal

0 commit comments

Comments
 (0)