Jump to content

SIM_Force implementation behaves strangely


Recommended Posts

Hello everybody,

I'm currently working on a two-way rigid body coupling with SPH simulations in Houdini. Everything is working out fine. Execept from one of the key points. The two way coupling. The SPH Solver is running in Houdini, it reacts to Houdinis rigid bodys, get's its correct data etc.

To apply the corresponding velocitys and torque to the rigid body I subclassed SIM_Force and implemented the virtual getForceSubclass method. This method has a UT_Vector for force and torque as parameter. If I add to this vectors arbitray values (even with 0, 0, 0) my rigid body is freaking out. If I put a gravity force node in the simulation and set it's values to 0 for all components it looks better until some point where my rbd seems to disappear. Using the torque vector this happens often on the first simulation frame. 

 

I think that I did all as in the SIM_ForceOrbit example in the HDK:

I derived my class from SIM_Force

I overrode getForceSubclass, getForceOnCircleSubclass, getForceOnSphereSubclass (the last two just call getForceSubclass)

I overrode the getOptimalForceSamplingSubclass which returns SIM_FORCE_SAMPLEPOINT because the rbd is only represented with it's pivot point.

The data get's places in the SIM_Container (Forces) as every other Forces, too, so that it can be discovered by the bullet solver.

I builded it as Force  AutoDOP Node and also as a simple Force Data that is created with the SIM_DATA_CREATE Macro on the Object. None is working. 

 

printing the content of the position and mass, passed in to the getForceSubclass method, on the console shows reasonably values

 

Any suggestions? Is there a better way to achieve what I try to do, I think the RBD_State or other Data is not the way to go.

Best regards and a big thanks to everyone helping me out.

Yannic

Link to comment
Share on other sites

I found the solution a few hours ago:

The force and torque vectors seem to be uninitialized when passed to the getForceSubclass() method. Populating them with values is absolutely neccessary after creating the force on the object.

Hopefully someone can profit from my mistake in the future.

  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...