Sign in to follow this  
NovaXPT

PhysX SDK - Fluid Collision vs Static Trianglemesh

Recommended Posts

Hi, i dont know if this is the right subforum, but i hope so :) i have a problem, which i cant get solved for some weeks now. i am using PhysX from AGEIA. I have a scene in which fluid is spilled over a trianglemesh. Now i want to change that mesh. So i change it, connect it with the actor and delete the old mesh. It works fine for rigid bodys which collide against the new mesh, but not for fluids. I tried; - deleting the mesh - deleting the whole actor - deleting the fluid - tried TriangleMeshes and Heightfields (tried in HW and SW) The new fluid always collides against the old shape, even if the whole actor ist deleted. With all static shapes I found that only triangles which collided once with the fluid are somewhere saved, where i cant get rid of them. I realize, that the fluid resides in a compartment and meshcooking is done on the fly. Is there any chance to recook it? I tried cookFluidMeshHotspot but it doesnt work. Just by changing the vars, which are important for cooking (like particles per meter) a new mesh is cooked for fluids. So here is my question. Is it somehow possible to delete a static actor (or change its shape) after collision with a fluid. So that the fluid doesnt collide against the old shape but the new shape?

Share this post


Link to post
Share on other sites
When you create the mesh, do you create then "return actor;"?
If so replace with "return gScene->createActor(actorDesc);"

But at the end of the day, you would be better of asking over at Ageia:
http://devsupport.ageia.com I'm guessing you're registered as you have the SDK.

Share this post


Link to post
Share on other sites
I did it like you said, but it doesnt work.

Example:
--------------------------------
NxTriangleMeshDesc actorDesc;
actorDesc.
...
..
.
//Cooking
MemoryWriteBuffer buf;
bool status = CookTriangleMesh(terrainDesc, buf);
MemoryReadBuffer readBuffer(buf.data);
actorMesh = gPhysicsSDK->createTriangleMesh(readBuffer);

NxTriangleMeshShapeDesc actorShapeDesc;
actorShapeDesc.meshData = actorMesh;
actorShapeDesc.
...
..
.
//Actor
NxActorDesc ActorDesc;
ActorDesc.shapes.pushBack(&actorShapeDesc);

actor = gScene->createActor(ActorDesc);

I posted this question at "devsupport.ageia.com" too, but as they doesn't have so many users, i thougt "gamedev" might be also helpfull.

[Edited by - NovaXPT on January 31, 2008 1:17:30 AM]

Share this post


Link to post
Share on other sites
Doesnt anybody knows something about this problem? Even a possible source for a solution would be fine. I allready read the physx SDK doc but its no use, i cant find anything to solve this. Maybe its impossible to solve?

Share this post


Link to post
Share on other sites
A little more detail on what i find so far:

The traingle meshes are cooked on the fly and stored in AABB which are defined by the fluid parameters. This happens, when particles move in an AABB where a mesh resists, or when using CookFluidMeshHotspot. Unfortunately once created, these AABB (fluid mesh packets) are not eraseable as it seems. It seems also not possible to overwrite them or destroy them in some other way.

I didnt find a way to get rid of them except for releasing the whole PhysX Scene. I really need to erase these fluid mesh packets (in the AABBs) so that a collision against a new shape in this AABB is possible.

Share this post


Link to post
Share on other sites
Sorry I can't help further, fluids are frustratingly slow on my system in software. I'm undecided still about purchasing hardware, if I do it will be ordered from US as it's twice as expensive here in the UK.

I notice your post over at Ageia is still quiet 'young', it tends to take about 5+ days to get an official response over there, unless a member throws their experience in.

Another thing with their forum is most people don't notice new threads, unless they change the sort method to 'Show Newest...', but I see you posted an update/bump yesterday so perhaps someone will now notice and be able to offer more suggestions.

Share this post


Link to post
Share on other sites
@jezham
i bought a PPU and doesn't regret it. Although with Nvidia buying Ageia i guess there will be GPUs for this purpose in the near future.

At the Ageia Forums there tends to be no reply after all, but i'm not surprised, this was the same for the last 12 months.

@MrRowl

If i make an actor kinematic there is no fluid collission at all.

@all
If anyone finds this thread, the only solution so far is to create a second scene with the fluids. Then mirroring the actors into this scene. When a static mesh is changed, release the second scene and create it again. With PhysX SDK 2.8 there is some additional information, that static meshes which are changed, are not properly mirrored into (fluid-) compartments.

The solution is rather slow (don't expect to have more than 4000 particles) and complicated.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this