joshcamas

Oimo Physics!?

Recommended Posts

Hello!

 

I've been trying to get Oimo working, and all I've managed to do is a very basic imposter and compound imposter.

 

My question is...

 

what does Babylon support for Oimo at the moment? joints? motors?

 

I can't seem to find any documentation on this, and would be grateful for answers. :3

 

Thanks!

 

EDIT: Also, is it possible to have collisions without having physics? Thanks again!

Share this post


Link to post
Share on other sites

Hi,

Our collision engine is natively embedded in our Babylon.js engine. You check the tutorials on github or on the playground: http://www.babylonjs.com/playground No need for physics engine.

About Oimo, Temechon has done the plugin for us. You can read his code here: https://github.com/BabylonJS/Babylon.js/blob/master/Babylon/Physics/Plugins/babylon.oimoJSPlugin.js and check our online demo to discover features: http://www.babylonjs.com/index.html?physics

David

Share this post


Link to post
Share on other sites

Ok, so how would one create something like a player...

 

I tried making a sphere for the physical properties, then a cube as the collision stuff, then connecting these.

 

But that just ends up weird when you run into something and you fly into the air...

 

So how should I create an actual player or creature? And also use movement? Thanks!

 

EDIT: As I'm testing more and more things, the more confused I'm getting!

 

Is it possible to have a mesh with gravity and collisions enabled, but not have fancy bouncy engine? I don't want a player that is bouncy or gets rolled over or anything!

Share this post


Link to post
Share on other sites

Here is how you can do:

var meshPlayer = actor || creature:// Player collision and gravitymeshPlayer.ellipsoid = new BABYLON.Vector3(0.5, 1, 0.5));meshPlayer.ellipsoidOffset = new BABYLON.Vector3(0, 3, 0);meshPlayer.applyGravity = true;var VitessePerso = 8; // Speed run  (walk = speed  = 4 or 3)var gravity = 0.15;var forward = new BABYLON.Vector3(parseFloat(Math.sin(parseFloat(meshPlayer.rotation.y))) / VitessePerso, gravity , parseFloat(Math.cos(parseFloat(meshPlayer.rotation.y))) / VitessePerso); // forwardvar backwards= forward.negate(); // backmeshPlayer.moveWithCollisions(forward or backwards); // move player with collision and gravity.// CollisionGround.checkCollisions = true; // the ground get collisions.House.checkCollisions = true; // the house get collisions.Wall.checkCollisions = true; // the wall get collisions.

Share this post


Link to post
Share on other sites

Sorry to bother you again, but could you have a playground example for this? I'm not getting it to work. :S

 

http://www.babylonjs.com/playground/#1NEYPW

 

This physics confusingness is really turning me off towards Babylon - it seems like the top "problem" with the engine... too many plugins, along with confusing collision stuff... D:

 

If someone could like show some code on how to make a character move around and have collisions and everything, that'd be bomb.

 

:D

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.