Giter VIP home page Giter VIP logo

Comments (7)

mtamis-NV avatar mtamis-NV commented on July 19, 2024

This sounds like an issue with collision shape interpolation.
I've not used the triangle API for a use case like this before, so it is just a guess.
Are you using setTriangles(Range<const physx::PxVec3> triangles, uint32_t first, uint32_t last) or setTriangles(Range<const physx::PxVec3> startTriangles, Range<const physx::PxVec3> targetTriangles, uint32_t first)?
You probably want to use the latter one to control the interpolation, using the first one makes it really complicated to get the triangles to match up with the previous frame.

from nvcloth.

a908778387 avatar a908778387 commented on July 19, 2024

I did use the previous API. Every frame I use a std::vector triArray to collect collisions, so the vector's length and value inside may be quite different between frames sometimes. And then I use cloth->setTriangles({&triArray.data(), &triArray.data()+triArray.size()}, 0, cloth->getNumTriangles()). If it's an interpolation issue, any idea to git rid of this? Many many thanks.

from nvcloth.

a908778387 avatar a908778387 commented on July 19, 2024

I did use the previous API. Every frame I use a std::vector triArray to collect collisions, so the vector's length and value inside may be quite different between frames sometimes. And then I use cloth->setTriangles({&triArray.data(), &triArray.data()+triArray.size()}, 0, cloth->getNumTriangles()). If it's an interpolation issue, any idea to git rid of this? Many many thanks.

Oh, I think I get the key point from your advice. Still two question, first one is for confirmation.

If I use this API, I should consider the interpolation maters. The previous one setTriangles(Range<const physx::PxVec3> triangles, uint32_t first, uint32_t last) is really complicated to control the collision if the cloth collision with the dynamic number of triangles. In my case, it's better to use the latter one, and I should manage the startTriangles and targetTriangles myself ?

And another problem is if I want to do the same thing to the PhysX Sphere Shape. but only void setSpheres(Range<const physx::PxVec4> spheres, uint32_t first, uint32_t last) I can found, any advice to make it work?

Many thanks !!

from nvcloth.

mtamis-NV avatar mtamis-NV commented on July 19, 2024

In my case, it's better to use the latter one, and I should manage the startTriangles and targetTriangles myself ?

Yes that is probably the simplest way.

As for the setSpheres api, we didn't add the new style here yet unfortunately.
In this case you need to keep track of the spheres in the buffer yourself, or add the new API yourself.
You can remove spheres by using an empty range for the first argument, and insert spheres by setting the first and last index to the same value.
If I ever get back to this I'll add the new style api for the spheres as well, but I can't give any time estimates right now.

from nvcloth.

a908778387 avatar a908778387 commented on July 19, 2024

Thank you very much!

from nvcloth.

mtamis-NV avatar mtamis-NV commented on July 19, 2024

I added new setSpheres and setPlanes apis.
I hope it will be useful for you.

from nvcloth.

a908778387 avatar a908778387 commented on July 19, 2024

It will be very useful, thank you!

from nvcloth.

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.