[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4762: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4764: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4765: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4766: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
Chipmunk Physics • View topic - CollisionManager Callbacks

CollisionManager Callbacks

Chipmunk2D Bindings for the Unity3D engine

CollisionManager Callbacks

Postby runonthespot » Sun Oct 13, 2013 4:54 pm

runonthespot
 
Posts: 8
Joined: Fri Aug 16, 2013 10:42 am

Re: CollisionManager Callbacks

Postby runonthespot » Mon Oct 14, 2013 3:30 am

...also in a larger existing class, where I was trying to replace OnTriggerEnter with a ChipmunkBegin_box_orb routine, I could not get it to fire at all. I tried normal collider, sensor, and with it set to IsKinematic, and without, but nothing could make the event fire. With it set to IsSensor = false, the objects are actually physically colliding, just no event to speak of. I've eliminated all the usual suspects like ensuring all layers collide, setting appropriate types, etc etc.

I'm pretty sure it's registering *some* sort of handler, because I tried adding a Debug.Log event of the same name to a different script on the same object, with the objects switched around (e.g. orb_box), and it at least complained that the order had to be the same if there was more than one handler.
runonthespot
 
Posts: 8
Joined: Fri Aug 16, 2013 10:42 am

Re: CollisionManager Callbacks

Postby runonthespot » Thu Oct 17, 2013 2:55 am

Still having strangeness with 1.0.3 unfortunately. I'm worried that I'm misunderstanding how things should work with collision callbacks:

Namely, can I have two classes, both subclassing ChipmunkCollisionManager, both implementing the same callback, e.g.
ChipmunkBegin_orb_box()...

so that I can implement behaviour on the box, and behaviour on the orb that differs?
runonthespot
 
Posts: 8
Joined: Fri Aug 16, 2013 10:42 am

Re: CollisionManager Callbacks

Postby runonthespot » Tue Oct 22, 2013 7:28 am

Just an update here, apparently this is working as intended. In Unity you get to implement the callback only once, e.g. ChipmunkBegin_orb_water has a single implementation. (Thanks to the chipmunk authors for getting back to me so promptly)

I'm working on implementing an event class that dispatches these events to listeners, which seems the most sensible way to distribute the events, where the implementation may differ between bodies.
runonthespot
 
Posts: 8
Joined: Fri Aug 16, 2013 10:42 am


Return to Chipmunk2D for Unity

Who is online

Users browsing this forum: No registered users and 0 guests

cron