Tuesday, June 18, 2013

3D JavaScript is weird...

3D JavaScript is weird...

An object can ONLY be collided with if it's in the scene, even if you're only using the object collection as collision reference.
The problem is that an object can only be collided with if it's of type geometry , which normal .obj's aren't.

Now, for the fun part!

Rendering a textured object is significantly faster than rendering an object with a mesh, so, whilst you could just use textured mesh's and render those, this is slow as heck.

And how do you get past this dilemma... ?

Add both the object AND the mesh to the scene, and hide the mesh's. Since they're technically there, they can still be collided with, and since they're invisible, they don't use rendering cycles ;D

Result: 60 FPS with full collision ♥