anchor.diff:       force)
       (mem-aref force :float)))
   
  -(defun material-pair-contact-max-normal-impact (material-pair)
  +(defn material-pair-contact-max-normal-impact ((material-pair material-pair))
  +    single-float
     (declare (optimize (speed 3) (safety 1) (debug 1)))
     (newtonmaterialgetcontactmaxnormalimpact
      (%material-pair-ptr material-pair)))
   
  -(defun material-pair-contact-max-tangent-impact (material-pair index)
  +(defn material-pair-contact-max-tangent-impact ((material-pair material-pair)
  +                                                (index (signed-byte 32)))
  +    single-float
     (declare (optimize (speed 3) (safety 1) (debug 1)))
     (newtonmaterialgetcontactmaxtangentimpact
      (%material-pair-ptr material-pair)
      index))
   
  -(defun material-pair-contact-normal-speed (material-pair)
  +(defn material-pair-contact-normal-speed ((material-pair material-pair))
  +    single-float
     (declare (optimize (speed 3) (safety 1) (debug 1)))
     (newtonmaterialgetcontactnormalspeed
      (%material-pair-ptr material-pair)))
   
  -(defun material-pair-contact-penetration (material-pair)
  +(defn material-pair-contact-penetration ((material-pair material-pair))
  +    single-float
     (declare (optimize (speed 3) (safety 1) (debug 1)))
     (newtonmaterialgetcontactpenetration
      (%material-pair-ptr material-pair)))
   
  -(defun material-pair-contact-tangent-directions (material-pair body)
  +(defn material-pair-contact-tangent-directions ((material-pair material-pair)
  +                                                (body body))
  +    (values (simple-array single-float (3))
  +            (simple-array single-float (3)))
     (declare (optimize (speed 3) (safety 1) (debug 1)))
     (with-foreign-objects ((t0 :float 3)
                            (t1 :float 3))
  
positive.code:      (%body-ptr body) t0 t1)
      (values (ptr->v3 t0) (ptr->v3 t1))))
  
  (defun material-pair-contact-tangent-speed (material-pair index)
    (declare (optimize (speed 3) (safety 1) (debug 1)))
    (newtonmaterialgetcontacttangentspeed
     (%material-pair-ptr material-pair)
     index))
  
  (defun material-pair-set-callback-userdata (material-pair
                                              material-a
                                              material-b
                                              ptr)
    (declare (optimize (speed 3) (safety 1) (debug 1)))
    (newtonmaterialsetcallbackuserdata
     (%material-pair-ptr material-pair)
     material-a
     material-b
     ptr)
    (values))
  
  (defun material-pair-set-contact-elasticity (material-pair restitution)
    (declare (optimize (speed 3) (safety 1) (debug 1)))
    (newtonmaterialsetcontactelasticity
     (%material-pair-ptr material-pair)
     restitution)
    (values))
  
  (defun material-pair-set-contact-friction-coef (material-pair
                                                  static-friction-coefficient
                                                  kinetic-friction-coefficient
                                                  index)
    (declare (optimize (speed 3) (safety 1) (debug 1)))
    (newtonmaterialsetcontactfrictioncoef
     (%material-pair-ptr material-pair)
     static-friction-coefficient
     kinetic-friction-coefficient
     index)
    (values))
  
  (defun material-pair-set-contact-friction-state (material-pair state index)
    (declare (optimize (speed 3) (safety 1) (debug 1)))
    ;; {TODO} what is the state in lisp? (its an int in C)
    (newtonmaterialsetcontactfrictionstate
     (%material-pair-ptr material-pair)
     state
     index)
    (values))
  
  (defun material-pair-set-contact-softness (material-pair softness)
    (declare (optimize (speed 3) (safety 1) (debug 1)))
    (newtonmaterialsetcontactsoftness
     (%material-pair-ptr material-pair)
     softness)
    (values))
  
  (defun material-pair-set-contact-tangent-acceleration (material-pair
                                                         acceleration
                                                         index)
    (declare (optimize (speed 3) (safety 1) (debug 1)))
    (newtonmaterialsetcontacttangentacceleration
     (%material-pair-ptr material-pair)
     acceleration
     index)
    (values))
  
  (defun material-pair-set-contact-tangent-friction (material-pair
                                                     friction
                                                     index)
    (declare (optimize (speed 3) (safety 1) (debug 1)))
    (newtonmaterialsetcontacttangentfriction
     (%material-pair-ptr material-pair)
     friction
     index)
    (values))
  
  (defun world-set-default-material-collidable (world
                                                material-a
                                                material-b
                                                state)
    (declare (optimize (speed 3) (safety 1) (debug 1)))
    ;; {TODO} how do we represent state?
    (newtonmaterialsetdefaultcollidable
  
negative.code:      (%body-ptr body) pos3 norm3)
      (ptr->v3 pos3)))
  
  (defn material-pair-contact-normal ((material-pair material-pair)
                                      (body body))
      (simple-array single-float (3))
    (declare (optimize (speed 3) (safety 1) (debug 1)))
    (with-foreign-objects ((pos3 :float 3)
                           (norm3 :float 3))
  