Chipmunk globals (@Brucey)

BlitzMax Forums/BlitzMax Programming/Chipmunk globals (@Brucey)

nino(Posted 2008) [#1]
Is there a way to set chipmunk globals via the bmx wrapper?

specifically:
int cp_contact_persistence: This determines how long contacts should persist.

cpFloat cp_collision_slop: The amount that shapes are allowed to penetrate.

cpFloat cp_bias_coef: The amount of penetration to reduce in each step.


Ive been having the classic oscillating contacts problem which results in objects generating contact messages every frame once they are supposed to be at rest. Modifying these is said to help.


grable(Posted 2008) [#2]
Doesnt this work?

Extern "C"
	Global cp_contact_persistence:Int
	Global cp_collision_slop:Float
	Global cp_bias_coef:Float
EndExtern



N(Posted 2008) [#3]
It should, if I recall correctly. Although cpFloats are probably doubles, if I recall correctly.


nino(Posted 2008) [#4]
This worked BTW although only started to solve the issue.

Getting reliable contact and release messages can be a real hassle...