Beispiel #1
0
hkBool gep::HavokCollisionFilter_Simple::isCollisionEnabled(const hkpShapeRayCastInput& aInput,
                                                            const HK_SHAPE_CONTAINER& bContainer,
                                                            hkpShapeKey bKey) const
{
    hkUint32 infoB = bContainer.getCollisionFilterInfo(bKey);
    return isCollisionEnabled(aInput.m_filterInfo, infoB);
}
// And suppose we were to enable/disable collisions like this:
// 1 & 3 collide
// 1 & 4 collide
// 2 & 4 collide
// but 2 & 3 *don't* collide,
// Then we'd either get collisions between the leaves, or we wouldn't, *depending on the order of the filter calls*, ie depending
// which body is 'a and which is 'b'. In one case it will test 2 against 3, and in one case it won't. (Again, see the comments in hkpGroupFilter)
// This call order depends on the agent types and on the order of addition of bodies to the world. Clearly this is highly dangerous. 
hkBool MyCollisionFilter::isCollisionEnabled( const hkpCollisionInput& input, const hkpCdBody& a, const hkpCdBody& b, const hkpShapeContainer& bCollection, hkpShapeKey bKey  ) const
{
	hkUint32 infoB = bCollection.getCollisionFilterInfo( bKey );
	// We need a corresponding filter info for 'a'. Whether we should get this from a parent/grandparent/etc... of 'a' in the case that
	// 'a' is part of a shape collection depends on how we decide to handle the 'collection vs collection' case.
	// Here we just assume that we do not have collections colliding against collections, and use the filter info of the root collidable of 'a'
	return isCollisionEnabled( a.getRootCollidable()->getCollisionFilterInfo(), infoB );
}
Beispiel #3
0
hkBool gep::HavokCollisionFilter_Simple::isCollisionEnabled(const hkpCollisionInput& input,
                                                            const hkpCdBody& collectionBodyA,
                                                            const hkpCdBody& collectionBodyB,
                                                            const HK_SHAPE_CONTAINER& containerShapeA,
                                                            const HK_SHAPE_CONTAINER& containerShapeB,
                                                            hkpShapeKey keyA,
                                                            hkpShapeKey keyB) const
{
    hkUint32 infoA = containerShapeA.getCollisionFilterInfo(keyA);
    hkUint32 infoB = containerShapeB.getCollisionFilterInfo(keyB);
    return isCollisionEnabled(infoA, infoB);
}
// This decides if two collidables (overlapping in the broadphase for example) should collide and is inherited from
// hkpCollidableCollidableFilter
hkBool MyCollisionFilter::isCollisionEnabled( const hkpCollidable& a, const hkpCollidable& b ) const
{
	return isCollisionEnabled( a.getCollisionFilterInfo(), b.getCollisionFilterInfo() );
}
hkBool MyCollisionFilter::isCollisionEnabled( const hkpWorldRayCastInput& aInput, const hkpCollidable& collidableB ) const
{
	return isCollisionEnabled( aInput.m_filterInfo, collidableB.getCollisionFilterInfo() );
}
hkBool MyCollisionFilter::isCollisionEnabled( const hkpShapeRayCastInput& aInput, const hkpShape& shape, const hkpShapeContainer& bContainer, hkpShapeKey bKey ) const 
{
	hkUint32 infoB = bContainer.getCollisionFilterInfo( bKey );
	return isCollisionEnabled( aInput.m_filterInfo, infoB );
}
Beispiel #7
0
hkBool gep::HavokCollisionFilter_Simple::isCollisionEnabled(const hkpWorldRayCastInput& a,
                                                            const hkpCollidable& collidableB) const
{
    return isCollisionEnabled(a.m_filterInfo, collidableB.getCollisionFilterInfo());
}
Beispiel #8
0
hkBool gep::HavokCollisionFilter_Simple::isCollisionEnabled(const hkpCollidable& a,
                                                            const hkpCollidable& b) const
{
    return isCollisionEnabled(a.getCollisionFilterInfo(), b.getCollisionFilterInfo());
}