vcg-uvic / viper

Open-source code for VIPER -- Volume Invariant Position-based Elastic Rods
Apache License 2.0
903 stars 105 forks source link

Error when compile project in CudaSolver.cu #7

Closed geotyper closed 4 years ago

geotyper commented 4 years ago

In line 551 CudaSolver.cu thrust::copy(S.X.v.begin(), S.X.v.end(), state.v.begin());

before in line 314..

 S.X.x = state.x;
 S.X.q = state.q;
 S.X.r = state.r;

As idea that v it is not used and defined. If comment this line all works well:

Screenshot at 2020-05-15 21-05-39

drebain commented 4 years ago

I'm a bit confused, is that a line you wrote? It's not present in the version in this repository.

If so, could you clarify what you're trying to do? If v here is meant to be velocity, then that won't work as the solver is position based and doesn't store velocity explicitly.

geotyper commented 4 years ago

I download project from https://github.com/tomerwei/viper, and think that it is fork of original repository. But now understand that it have some modifications in code. thanks for prompt answer.

geotyper commented 4 years ago

And small additional question: If make pills with spheres (a,b) and pills (a,c) and give this spheres a,b,c different groupId, the spheres don't collide with together, not only pairs (a,b) and (a,c), but don't collide (b,c). But they collide with other spheres in world if they haven't pills with them. Is code have some flag that disable collide with spheres in pills? Sorry for my english

drebain commented 4 years ago

The way it is implemented now is that there is only collisions between pills, we don't do collision detection or resolution for individual spheres. The reason for this is that doing so would require handling three types of collision (sphere-sphere, pill-pill, and pill-sphere) and we didn't have enough individual spheres to justify it. The only place we had them was for the cannonballs, which we made from pills with the same endpoint.

For filtering pill collisions, we are just setting the group ID of a pill to be that of its first sphere so if you have three spheres connected into two pills then only two of the sphere IDs are actually used. I don't recall why we did it this way, but I think there was an earlier version with different behaviour.

If you are trying to make a self-colliding chain or rope then the group ID collision filtering might not be ideal for you. I think you might be able to just change the filtering method to only look at whether the two pills share any spheres, or to be more robust, filter based on whether they collide in the rest configuration.

geotyper commented 4 years ago

Thanks for detailed answer.