[Sidefx-houdini-list] HDK SIM_ColliderPoint usage

Szymon Kapeniak szymon.kapeniak at gmail.com
Mon Dec 17 03:52:16 EST 2012


Hello everyone,
I'm making a custom soft-body solver, but to spare some time at front I
wanted to rely on built-in point collider. After sniffing around
my hypothesis was it's enough that my solver
re-implements SIM_Solver::getDefaultColliderLabel
and SIM_Solver::getDefaultColliderSubclass returning a simple strings with
collider's label and class name respectively. After that, as I presumed, I
may call  collider->collideObjects(...) to make it working. At first it
seemed to be doing fine: collider->getDataType() returns expected label,
and colliders sort of works generating dozens of impacts for a self
collisions, but ignores other (RBD/static) affectors provided to it by
collideObjecs(engine, object, affector, ....).

I might be here on a completely wrong track, as there is no examples in HDK
of using built-in colliders, nor ODE/Bullet public code use them. Could
anyone point me to the right direction?

I'm doing more or less something like this:

        /// Should the endtime be in future? reversing it to start =
current - timestep, end = current doesn't help ether.
        const SIM_Time starttime = engine.getSimulationTime();
        const SIM_Time endtime(starttime+timestep);

       /// Take objects' colliders:
        object.getColliderInfo(colliderinfo);
        int ncolliders = colliderinfo.entries();
        for (int i = 0; i < ncolliders; ++i)
        {
            const SIM_Object       *affector =
colliderinfo(i).getAffector();
            const SIM_Collider      *collider =
colliderinfo(i).getCollider(&object);
            collider->collideObjects(engine, object,
*(SIM_Object*)affector, starttime, endtime,

 SIM_ColliderPoint::SIM_IMPACTAPPLY_ONEWAY, impactflags);
       }

I added also IMPLEMENT_DATAFACTORY(SIM_ColliderPoint) in initializeSIM()
,besides own SIM_Solver

Thanks for any help,
skk.



More information about the Sidefx-houdini-list mailing list