Skip to content

Commit

Permalink
Don't generate hits between immovable objects
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinmera committed Oct 30, 2023
1 parent 93918a9 commit 2c22c78
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions physics/resolution.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,12 @@
for a = (aref objects i)
do (loop for j from (1+ i) below (length objects)
for b = (aref objects j)
do (loop for a-p across (physics-primitives a)
do (loop for b-p across (physics-primitives b)
do (setf start (detect-hits a-p b-p contacts start end))))))
do (unless (and (= 0.0 (inverse-mass a))
(= 0.0 (inverse-mass b)))
;; Don't bother detecting hits between immovable objects
(loop for a-p across (physics-primitives a)
do (loop for b-p across (physics-primitives b)
do (setf start (detect-hits a-p b-p contacts start end)))))))
start)

(defmethod resolve-hits ((system rigidbody-system) contacts start end dt &key (iterations 200))
Expand Down

0 comments on commit 2c22c78

Please sign in to comment.