Oimo.js icon indicating copy to clipboard operation
Oimo.js copied to clipboard

Extending Oimo shapes from outside

Open jagenjo opened this issue 8 years ago • 0 comments

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

jagenjo avatar Feb 20 '17 14:02 jagenjo