Physics Engine question

Thanks! I try realize that way.

After taking a further look, I think this might be an issue with ammo’s applyImpulse causing issues in their engine causing collision resolution to not fully correct the position causing this double event. Set linear velocity doesn’t have this issue as it looks to be working here. https://playground.babylonjs.com/#RG2AQ4#7 and also works for the edge case https://playground.babylonjs.com/#RG2AQ4#8

I hesitate to add debounce logic in the babylon plugin in case users want the callback to detect when an object is grounded and this logic can always be added in the app if needed.

@Asagi Does this solve your issue? I also agree with @mauricedoepke that a physics engine for your scenario may be a bit overkill so doing the math yourself might reduce complexity.

Now it is difficult for me to calculate physics manually. I wanted to solve the problem using ready-made tools.

Ok, let me know if the above (using setLinearVelocity) works for you in your app code

Ok! Thanks!

Hello!
I have a few questions.
I use Ammo.js for physics.
Suppose I apply some impulse to the mesh. The momentum will fade away. Can I get information on all pulses that affect the mesh?
Or can I find out for example the current mesh acceleration?
Can I set the maximum values ​​for acceleration along the Y axis?

Thank.

@Asagi -

I haven’t used ammo.js personally, so I don’t know if there are any limitations compared to cannon.js and oimo.js. In brief reading they all appear to offer the same core functionality. But that doesn’t mean there arent any major differences. I know when I’m setting up Oimo.js vs. Cannon,js, the settings vary dramatically for extension to scene.

So as for your questions, I hope I’m pointing you in the right direction. If linear velocity works for you then great. However, as you asked in an earlier post, there’s no reason why you can’t animate your meshes in your scene without using impulses. I believe most devs simply assume there are limitations when using a physics engine.I tend to do the opposite. I assume that all tools are open to use until I discover otherwise.

Momentum doesn’t have to fade away. I worked on a project with @Pryme8 a couple years ago where I set up the physics engine with little friction (it’s always a balance) and the meshes never slowed over time… even though they were continually registering collisions and altering behavior.

And you can set limits on all axis’ for practically any condition when registering collisions. This is something we added in our scene as well.

It’s great to have devs to help these days. I would have given anything to get help a couple of years ago. There simply wasn’t the experience then that there is now. I’m really proud of this forum, and all of the people that give their time freely. Ecept for @Wingnut - he’s absolutely insane!:crazy_face:

It’s great to have @trevordev step forward on this one.Although I gotta say that @Wingnut always comes up with an interesting approach to practically any issue. He just won’t give up until the question’s been answered. But I don’t know where he finds the time!

Galen

Thanks to everyone who tried to help and guide you on the right path. Now it seems to me - I solved all the problems with physics. If the decision is interesting - let me know.

:slight_smile: Thanks for the nice words, Galen. Back at-cha! I have pretty good Q&A stats… because I only try to answer EASY or repeated questions. Those easy/repeated questions slow down the REAL experts working on the BIG challenges.

Usually I just talk and talk and talk, and tell dumb 3D jokes… until the user forgets that they had a question, or commits suicide to escape me. :slight_smile:

Generally, I just pass-on the info that others have taught me, but with 10-times more words (and sometimes 20-times more drama-queening). heh. I’m certainly not Galen-grade smart… but I often fantasize about being so.

In most cases (of beer), if mediocre brains like me… bring pot, beer, food, and dumb jokes… to wherever the REAL smart-people hang-out/talk/work, they let me stay and listen. :slight_smile:

Yo @mauricedoepke … Did you ever get isGrounded detection working… if so , can you show code snippet how you got it working.

I’m trying with on collide and trying to get contact normals to detect if on top of a physics collision volume.

I also tried with ray casting downward on collide event… but seems a bit heavy.

How did you get IsGrounded working ?

@MackeyK24

I did not do it yet, but planned to do it with a raycasting as well. Why do you think this is too heavy? Does it run slow?