You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Well, just what the title says. I tried implementing a custom velocity_func and discovered that chipmunk-ffi is passing me nil for the gravity parameter. Replacing Vect.by_value with CP_FLOAT, CP_FLOAT in the callback definition causes FFI to pass the vector as two float values and this works on OS X, but it's probably not portable.
The text was updated successfully, but these errors were encountered:
I am on Ubuntu linux, and I report a similar error. However, instead of getting nil, I receive a CP::Vect object. This does not have #struct defined, and thus generates an error.
/var/lib/gems/1.9.1/gems/chipmunk-ffi-1.1.0/lib/chipmunk-ffi/body.rb:193:in update_velocity': undefined methodstruct' for #CP::Vect:0x0000000334be00 (NoMethodError)
from /home/ravenskrag/Code/Source/eternity/Physics/Space.rb:10:in block in <class:Space>' from /var/lib/gems/1.9.1/gems/chipmunk-ffi-1.1.0/lib/chipmunk-ffi/body.rb:212:incall'
from /var/lib/gems/1.9.1/gems/chipmunk-ffi-1.1.0/lib/chipmunk-ffi/body.rb:212:in block in velocity_func=' from /var/lib/gems/1.9.1/gems/chipmunk-ffi-1.1.0/lib/chipmunk-ffi/space.rb:300:incall'
from /var/lib/gems/1.9.1/gems/chipmunk-ffi-1.1.0/lib/chipmunk-ffi/space.rb:300:in cpSpaceStep' from /var/lib/gems/1.9.1/gems/chipmunk-ffi-1.1.0/lib/chipmunk-ffi/space.rb:300:instep'
from /home/ravenskrag/Code/Source/eternity/Physics/Space.rb:118:in step' from ./init_game.rb:136:inupdate'
from ./init_game.rb:255:in show' from ./init_game.rb:255:in
Well, just what the title says. I tried implementing a custom velocity_func and discovered that chipmunk-ffi is passing me
nil
for the gravity parameter. ReplacingVect.by_value
withCP_FLOAT, CP_FLOAT
in the callback definition causes FFI to pass the vector as two float values and this works on OS X, but it's probably not portable.The text was updated successfully, but these errors were encountered: