Comments (7)
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.
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.
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.
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.
Thank you very much!
from nvcloth.
I added new setSpheres and setPlanes apis.
I hope it will be useful for you.
from nvcloth.
It will be very useful, thank you!
from nvcloth.
Related Issues (20)
- what is the right way to do cloth-body animation? HOT 11
- DX solver function accelerateParticles looks wrong HOT 1
- Compiler error when disabling USE_SELF_COLLISION_SORT in DX solver
- [Feature Request] Add CMake arguments to disable CUDA and DX solver for the samples
- No CmakeGenerateAll.bat HOT 6
- [Question] PhysX and NvCloth interaction HOT 2
- Compiling 32 bit
- Compiling 32 bit
- Manually-specified variables were not used by the project
- Cmake Build system for windows is broken and project files cannot build properly due to custom rule for CuSolverKernel.cu is missing
- Licensing questions HOT 3
- A question about spheres CCD
- Would NvCloth support Visual Studio 16 2019? HOT 1
- Strange problem of simulation result HOT 1
- sse2/SwCollisionHelpers.h->x86intrin.h does not compile on mac arch x86_64 HOT 3
- There is a gap in the skirt, how to solve it? HOT 2
- Automation script MAC, Win compilation failed
- DX solver doesn't invalidate mClothDatas after sorting cloth instances
- Would NvCloth support DirectX12 in future?
- Installation fails with 403 from cloudfront HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nvcloth.