GithubHelp home page GithubHelp logo

Comments (8)

troublehoff avatar troublehoff commented on July 23, 2024

Just had a closer look at the worker thread etc.. It appears that the plane is mainly represented by it's normal - possibly I'm needing the heightfield structure you mention @ #12

from physijs.

chandlerprall avatar chandlerprall commented on July 23, 2024

So I suspect vehicles & terrain will be ready in early June - we'll see if I can stick to that plan :)

Obviously that didn't work out as planned. But yes, you will need the heightfield body for what you want to do. Constraints are finished apart from good examples so I can start looking at the heightfield stuff again. When have you been planning on releasing (so I can prioritize)?

from physijs.

troublehoff avatar troublehoff commented on July 23, 2024

I don't have any release date. It's something I've been working on for the odd hour after work for about 2 months now. I'd estimate that I'm around 30% of the way through so far so it could be around November.

I have many things on my to-do list so it's easy for me to switch to something else in the meantime. I'm sure you're also busy with other projects and there are ways for me to work around it so don't worry too much as I'm aware that it's not a trivial piece of work.

If there are any ways I can contribute, I'd be happy to? I was thinking about trying to attempt this myself using multiple 'triangle' shape models that you have in the worker thread, generated from the plane.. let me know if you think that'd work?

thanks again

from physijs.

troublehoff avatar troublehoff commented on July 23, 2024

I plan to release something incomplete within the month.

from physijs.

chandlerprall avatar chandlerprall commented on July 23, 2024

If there are any ways I can contribute, I'd be happy to? I was thinking about trying to attempt this myself using multiple 'triangle' shape models that you have in the worker thread, generated from the plane.. let me know if you think that'd work?

Your approach should work but I don't think it would perform well. Here is a write up I sent to someone a couple of months back on what will need to be done for heightfield support - the biggest challenge has been getting the vertice positions into the heightfield correctly.

A heightfield mesh is a physics body which is calculated from a height map. In case you don't already know, here's an overview of how Physijs works:

Physijs - two script files - physi.js and physijs_worker.js
- physi.js provides everything the developer needs. This includes the custom Scene and *Mesh objects and their functionality
- physijs_worker.js manages the Ammo.js world and physics objects themselves (Ammo.js is the actual physics library, and is a port of Bullet Physics which is written in C)

To implement a heightfield mesh

There is some weirdness to implement a btHeightfieldTerrainShape however. The function definition in the Bullet Physics library takes the height map data as a pointer. The way Ammo.js handles this is interesting, but there are some examples of it online. An existing github issue for adding heightfield to Physijs is here - #1 and there are links in that ticket to an example where the heightfield shape is used with Ammo.js

from physijs.

troublehoff avatar troublehoff commented on July 23, 2024

Cool, I'll look into this tonight and get back to you

from physijs.

troublehoff avatar troublehoff commented on July 23, 2024

I've created the heightfield object. It's working well with my game!

All fairly straightforward to implement except for the pointer stuff which seemed to be allocating a piece of memory 4 times too large in the examples. Some of the allocation stuff has moved on since these examples regards naming of the heap object etc...

I've sent you a pull request.

from physijs.

chandlerprall avatar chandlerprall commented on July 23, 2024

merged heightfield code

from physijs.

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.