Testing a collision against a complex mesh can be very expensive in Janus. Typically, the only collision detection is that of the player and any object they may potentially collide with, and the depth buffer check the mouse pointer relies on to set its orientation and position in space.
Currently, Janus tests every triangle of an object against the player's capsule shaped collision placeholder, and turning on these collision calculations is an easy way to drop frames. The mouse calculations are also expensive, and, on a GTX 970 running the landing page bring me from 1050 to 450 FPS.
This overhead doesn't leave much room for performing any other physics calculations, and makes it impractical to give the user any sort of collision checking capabilities in Javascript, that could lead to many use cases. Personally, for the Dot Matrix, I've been wanting to make a third person platformer, but it's not practical to use a Javascript physics engine, since you'd need to manually pass the models in somehow. It's a huge step for new users to have to overcome, and should really be part of the Janus suite of tools.
I think the lack of a proper physics engine is one of the reasons we don't see many games within Janus. Of course, you can argue "Janus isn't for games!", but "where are the games?" is a question I hear too often :D
Also, if you have VSYNC disabled, there's a lot of glitches with the current physics implementation in rooms where you get over 600 FPS (like not being able to jump.)
The solution to this issue would be the implementation of a proper physics engine, like Bullet. Not only would this allow for faster, more accurate computation of the mouse and player physics, but it would allow for soft and rigid body physics as well.
EDIT: also, it'd be cool as hell to have physics controls over users, so we could create upside down worlds (like https://i.gyazo.com/0380361f9c38ece13b6c24b272e259d1.jpg)
tl;dr The two physics calculations in Janus are extremely expensive. Use a physics engine like Bullet. If you give people collision detection tools in Javascript, you'll see more games crop up. Also, rigid and soft body physics, and no more glitches with VSYNC disabled.
Subreddit
Post Details
- Posted
- 9 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/janusVR/com...