Skip to content

Commit

Permalink
#9 ODE LCP complain
Browse files Browse the repository at this point in the history
 #15 ODE doesn't like variable timestep
  • Loading branch information
borodust committed Oct 16, 2016
1 parent e8b6e78 commit a5cc768
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 3 additions & 7 deletions physics/system.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

(defstruct (physics-context
(:conc-name pc-))
(universe (make-universe) :read-only t)
(last-world-step-time (epoch-seconds-of (now))))
(universe (make-universe) :read-only t))


(declaim (inline universe))
Expand All @@ -30,8 +29,5 @@
(destroy-universe (pc-universe *system-context*)))


(defun observe-universe ()
(let ((current-time (epoch-seconds-of (now))))
(%observe-universe (universe)
(- current-time (pc-last-world-step-time *system-context*)))
(setf (pc-last-world-step-time *system-context*) current-time)))
(defun observe-universe (timestep)
(%observe-universe (universe) timestep))
2 changes: 1 addition & 1 deletion physics/universe.lisp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(in-package :cl-bodge.physics)


(defvar *contact-points-per-collision* 8)
(defvar *contact-points-per-collision* 1)


(defclass universe ()
Expand Down

0 comments on commit a5cc768

Please sign in to comment.