[Solved] Warning: You must implement collideSphere

[Solved] Warning: You must implement collideSphere

Imagen de Sergey T.

Hi, I am trying to use hkpSampledHeightFieldShape, but I always get this warning during simulation:

Shape\HeightField\SampledHeightField\hkpSampledHeightFieldShape.cpp(107): [0x4B50036A] Warning: You must implement collideSpheres!

The implementation is:

class MySampledHeightFieldShape : public hkpSampledHeightFieldShape
{
public:
MySampledHeightFieldShape(const hkpSampledHeightFieldBaseCinfo& ci) : hkpSampledHeightFieldShape(ci) {}
HK_FORCE_INLINE hkReal getHeightAtImpl( int x, int z ) const{ return 0; }
HK_FORCE_INLINE hkBool getTriangleFlipImpl(){ return false; }
virtual void collideSpheres( const CollideSpheresInput& input, SphereCollisionOutput* outputArray) const
{
hkSampledHeightFieldShape_collideSpheres(*this, input, outputArray);
}
};

So, how should I remove warning?

publicaciones de 2 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.
Imagen de Havok_Amy

Hi Sergey,

Looks like you're missing a const in the getTriangleFlipImpl() definition so it isn't overriding the base class definition, it should be "HK_FORCE_INLINE hkBool getTriangleFlipImpl() const". Unfortunately getTriangleFlipImpl() throws throws the same warning as the collideSpheres(...) if it isn't implemented in the child class. I've logged an issue for this as it is quite confusing :)

Amy Developer Support Engineer Havok www.havok.com

Inicie sesión para dejar un comentario.