Try to allow cake and plunger to have collision callbacks
This commit is contained in:
parent
8ea38a6103
commit
4b17d2133a
@ -234,12 +234,6 @@ void Bowling::onFireFlyable()
|
||||
// this would disable gravity.
|
||||
setAdjustUpVelocity(false);
|
||||
|
||||
// unset no_contact_response flags, so that the ball
|
||||
// will bounce off the track
|
||||
int flag = getBody()->getCollisionFlags();
|
||||
flag = flag & (~ btCollisionObject::CF_NO_CONTACT_RESPONSE);
|
||||
getBody()->setCollisionFlags(flag);
|
||||
|
||||
// should not live forever, auto-destruct after 20 seconds
|
||||
m_max_lifespan = stk_config->time2Ticks(20);
|
||||
} // onFireFlyable
|
||||
|
@ -186,8 +186,6 @@ void Flyable::createPhysics(float forw_offset, const Vec3 &velocity,
|
||||
m_body->setLinearVelocity(v);
|
||||
if(!rotates) m_body->setAngularFactor(0.0f); // prevent rotations
|
||||
}
|
||||
m_body->setCollisionFlags(m_body->getCollisionFlags() |
|
||||
btCollisionObject::CF_NO_CONTACT_RESPONSE);
|
||||
} // createPhysics
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -90,6 +90,12 @@ void RubberBall::onFireFlyable()
|
||||
btVector3(.0f,.0f,.0f) /*gravity*/,
|
||||
true /*rotates*/);
|
||||
|
||||
// add no_contact_response flags, so that the ball
|
||||
// will not explode if hitting the track or objects
|
||||
int flag = getBody()->getCollisionFlags();
|
||||
flag |= btCollisionObject::CF_NO_CONTACT_RESPONSE;
|
||||
getBody()->setCollisionFlags(flag);
|
||||
|
||||
// Do not adjust the up velocity
|
||||
setAdjustUpVelocity(false);
|
||||
m_max_lifespan = stk_config->time2Ticks(9999);
|
||||
|
Loading…
Reference in New Issue
Block a user