Collision Detection library updated for new scripting system

Hi

I’ve updated my faster collision detection library to support the new scripting system.

You can use this in place of Ammo for simple picking, object moving and collision detection and avoidance. Supports ray casts etc.

https://www.dropbox.com/s/h13e28kik77wuy0/collision.js?raw=1

Documentation here: https://dl.dropboxusercontent.com/u/314702233/index.html

7 Likes

Hi there!

I really like the idea for fast and simple collision detection. I’m testing the library around but I’m having mixed success.
At first, it took me a while to figure out that it requires Lodash to work. I’m new to Javascript so I’m pretty happy to make silly mistakes. Even after I’ve added lodash.js to the project, I cannot parse the updated collisiondetection.js script without first removing the " _.extend(CollisionDetection.prototype, {…} )" block and then returning it.

In the documentation, we have the simplest example for collision detection with:

Explode.prototype = { colliding: function(other)

With the new scripting system, I’ve tried to use:

Explode.prototype.colliding = function(other) but I’m always getting undefined for other.

Here is the project that I’m trying the library on: https://playcanvas.com/editor/scene/513666

Any pointers on how to get the simple colliding function up and running?

I’ve had a similar issue as Pako_St re: underscore, but declaring it as a var if it didn’t exist got around that. I’m not sure why load order didn’t solve the issue, though.

I am having other issues with the new version. If I attach the collisiondetection.js script and a simplebody.js to an object, the browser just hangs and eventually crashes. I’m not seeing this problem with the previous version that used the legacy script system.

Is there a working example of the latest version of your scripts? I tried to follow your links to the github repository, but I’m getting rejected (non-existent or permissions?).

Thanks!

Hey - I’ll look out what’s happening with that

Sorry! I’m still primarily using the legacy version because I need source code control - so I’ve probably not done anywhere near as much testing as I should!

Hi, your documentation link is broken, can you please update it?