jbs

collision in js + three.js

Recommended Posts

I have the following problem:
Im making a first person shooter with js + three.js. Now I wanna do collision detection. So far im doing simple aabb boxes wrapped around everything, but when i comes to complex shapes, like a building, the whole building gets wrapped in 1 aabb hitbox, the whole building becomes unaccessable. What would be a good way around this ? Is there some lib or aalgorithm that creates boxes for complex shapes or would i have to do it manually ?
Also, this whole collision thing runs server side, so it shouldnt be too expensive.

Share this post


Link to post
Share on other sites

I read in this article Real Time Multiplayer in HTML5 that we should to create a fixed physics loop on server and on a client. Server should have high frequency loop for physics and low frequency loop for sending messages to clients. I upload the example from the article on the free Heroku hosting https://battle-world.herokuapp.com/?debug You can run it in two browser windows. Free hosting has limits. If no one runs the application 30 minutes the server will sleep until someone wake up it. To wake up server you need to wait 10-15 seconds.

Edited by 8Observer8

Share this post


Link to post
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...

  • Recently Browsing   0 members

    No registered users viewing this page.