Jump to content

Oimo questions


Recommended Posts

Hello guys, I've added physics to the following playground:




Using WASD you can move the "car"


Three questions:


1) Why the wheels of the car compenetrate the "ground"? Since they are children of the box, the BoxImpostor

    should take them into account, or not?

1) Why the car, once outside the "ground" doesn't fall?

2) Why the car when collides with the box, compenetrate it and doesn't "push" it around?


I suppose it's because I "move" the car with the translate function... BUt if it is the case, how do I have to move it around?


Thanks in advance for your answers

Link to comment
Share on other sites

First - such a cool demo, I have been playing with the car for the last 10 minutes... :D

The answer to question nr. 1 would be that oimo doesn't "know" this parent system and the plugin doesn't support that. The plugin does, however, update the physics state of parents of meshes that were registered (https://github.com/BabylonJS/Babylon.js/blob/master/Babylon/Physics/Plugins/babylon.oimoJSPlugin.ts#L239).

Enable physics state on all 4 wheels (maybe as a sphere) if you want oimo to actually know their properties. otherwise, their data is not known to the plugin and it cannot calculate their physics-state.

Link to comment
Share on other sites



Yet another, using the angular velocity setting for rotation, instead of applyImpulse.  *shrug*


I found it at the bottom of Temechon's tutorial... http://pixelcodr.com/tutos/physics/physics.html


The problem with using applyImpulse is tire skid.  ApplyImpulse essentially ignores the tires/wheels.


It sort-of brings us back to RaananW's thoughts.  If the wheels themselves had physicsState with sphere imposters, then you could use angular velocity on X-axis to ROLL the wheel (forward and backward movement), and use angular velocity on Y-axis for turning the FRONT wheels.  (don't quote me)  :)  Then, also, tire-to-ground friction would become active and usable (road ice, snow, water, dirt, etc).


In this case, likely, the best way is to use ONLY the front wheels for both turns and forward/backward, and let the rear wheels just come along for the ride.


SO much trouble to get a physics car properly working, eh?  *nod*.  As you have probably noticed, it seems to be .translate (in your original demo) that causes the car to NOT FALL when it drives off the edge.  I'm not sure if it's a bug in .translate, but maybe.  This might be fixable, but until it's fixed, .translate has limited use for physics things.


Oh well... we keep on "trucking" anyway, right?  I just completed converting Euro Trucks 2... to BJS.  (yeeeeah, you wish, Wingy)  :)

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.

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.


  • Recently Browsing   0 members

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