I'm using the linearCast/getPenetrations functions. Its first argument is an hkpCollidable object. However the input shapes are gameplay-related objects unrelated to Havok (i.e. they don't exist as Havok objects in the game code), so I don't have ready-to-use hkpCollidable objects for them.
I can't pre-create those hkpCollidable objects either, since most of them are created on-the-fly anyway, during the game.
So I am currently creating rigid bodies on-the-fly, just to access its hkpCollidable. Something like this:
const hkpSphereShape SphereShape(sphere.mRadius);
ci.m_shape = &SphereShape;
ci.m_motionType = hkpMotion::MOTION_FIXED;
ci.m_rotation = hkQuaternion(0.0f, 0.0f, 0.0f, 1.0f);
ci.m_position = ToHkVector4(sphere.mCenter);
mPhysicsWorld->linearCast(rigidBody.getCollidable(), input, castCollector);
Is there a better way to do this? This looks both inefficient and weird (after all I don't need a "rigid body" here, just a shape really).