Oimo.js
Oimo.js copied to clipboard
Extending Oimo shapes from outside
Hi:
I'm trying to adapt Oimo to my special needs for my application, that requires some new collision shapes. The problem is that Oimo do not allow to extend it easily without modifying the lib itself, because any collision detector must inherit from CollisionDetector but that class is not public so I cannot extend it without editing the lib, which will cause problems in future updates.
Also the world.add function allows to pass the shape as an string, but the possible values are hardcoded in a switch. I suggest to have a container to associate shape names with the class representing it.
I will make the changes myself but I dont feel confident enough yet.
Cheers