Jump to content
Sign in to follow this  

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.


Share this post

Link to post
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

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