On Tue, 2009-09-08 at 08:41 +0200, gabor papp wrote: > > i added a new function, (get-pos) to get the position of an object from > > the physics system. > i realized i was coding too early instead of thinking first again. > actually the physics system writes back all the transformation info to > the primitive which can be read simply like this: > define (get-pos) > (let ([t (get-global-transform)]) > (vector (vector-ref t 12) > (vector-ref t 13) > (vector-ref t 14))))
I generally do this: (define (get-pos) (vtransform (vector 0 0 0) (get-global-transform))) As I think it might be safer as it includes the rotation and scale - but I'm not sure in this case your way would be faster. cheers, dave
