Jump to content

How to load collision using Physijs and Universalloader


Terraviper-5
 Share

Recommended Posts

Hi!

 

For a project in school we are making a game. For loading models, I tried using https://github.com/jeromeetienne/threex.universalloader which made loading obj models very easy:

    var loader  = new THREEx.UniversalLoader();    var url = ['mdl/tower.obj', 'mdl/tower.mtl'];    loader.load(url, function(object3d){        // this function will be notified when the model is loaded        object3d.scale.divideScalar(0.25);        scene.add(object3d)    });

This loads and shows the model in my scene, but I have to make collision for it too. For that purpose, I created another obj file which contains a simple cyllinder sized to my tower model. But I have no idea how to use universalloader and Physijs together (or how to use custom physics model at all in Physijs). I found function Physijs.CovexShape but I dont know how to make it work. Any help would be greatly appreciated!

 

Thanks!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...