Giter VIP home page Giter VIP logo

Comments (7)

lo-th avatar lo-th commented on July 25, 2024

Thank's yes terrain this would be the top.
Saharan think of it for next release of OimoPhysics.
For the moment no triangle shape but is possible for sure.
I try to add this but if someone finds an idea I take

from oimo.js.

erichlof avatar erichlof commented on July 25, 2024

Hi, that's great that Saharan wants to add it. I just might put an issue on his original repo and maybe I can help get the process started.

As for doing it on your own, there are numerous ray-triangle intersection tests out there (Three.js already has one in place). I'm pretty sure we could get a sphere to work, using the sphere's old center position as one end of a line segment and it's current position as the other end of the line segment. But the box is more difficult because of numerous edges and possible orientations. I don't really know how to do that.

A good place to look for ideas on terrain shape is here: https://github.com/bartdeboer/JigLibJS2/blob/master/geometry/JTerrain.js

and here for sphere-terrain collision code:
https://github.com/bartdeboer/JigLibJS2/blob/master/collision/CollDetectSphereTerrain.js

and box-terrain code:
https://github.com/bartdeboer/JigLibJS2/blob/master/collision/CollDetectBoxTerrain.js

EDIT: just found this triangle class: might be helpful
https://github.com/bartdeboer/JigLibJS2/blob/master/geometry/JTriangle.js

JigLibJS2 is also a good physics library, but unfortunately it is not in active development, both original and ports. There are some bugs in this engine I think but I don't know how to fix them.

Anyway, thanks for the info. I will contact Saharan and see what's happening with his terrain implementation. I have starred your repo and I look forward to what's coming next with Oimo!

Thanks!

from oimo.js.

lo-th avatar lo-th commented on July 25, 2024

hum i think test sphere terrain for the moment
oimo can manage 1000 dynamique sphere i hop more when fixed

also add particule can be cool

from oimo.js.

lo-th avatar lo-th commented on July 25, 2024

sphere terrain demo added :)

from oimo.js.

erichlof avatar erichlof commented on July 25, 2024

@lo-th ,
Thank you so much for implementing this! It works great across all of my very different devices - old Windows XP desktop, 'newer' Windows 7 laptop, and even my Samsung Galaxy smartphone!

How did you end up implementing this? How does the internal terrain collision algorithm work? Are you using object (falling boxes' or balls')ray-triangle intersect test for each triangle of the terrain, or falling object's bounding sphere/ bounding box vs. terrain bounding sphere for each triangle of the terrain?

Regardless, this is a great addition to the already awesome Oimo engine - Thanks again! :)

from oimo.js.

lo-th avatar lo-th commented on July 25, 2024

thank's, i use sphere collision, each vertex of terrain mesh have one sphere. box take many more calculation. is limited 64*64 sphere is good. Triangle can be the best option but i have to make some research about.

from oimo.js.

ilixn avatar ilixn commented on July 25, 2024

@lo-th Hello, I've looked at your sphere terrain demo, but i didn't understand the concept...
Could you make a wiki page, or add some useful comments in tour code?
I've made the same thing, but without physics (here) and i would like to add physics to it.
Could you please help me (just give me a few explainations if you don't have much timeπŸ˜‰) and give me a sort of "example code" ?
Excuse me, this issue is very oldπŸ˜ƒ...
Thanks...

from oimo.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.