ropes and ladders

I specialized a new type of object, that allows to stick on it. After physics tick if player wants to catch object, I’m looking on his physics object contact points and simply if there is something to grab – just stick together by adding suitable constraint in right place. When player is sticking something then I unlock his jump possibility, which gives ability to climb. In the video bellow you can see two climbing/sticking models, and as you probably noticed they are not behaving in typical way. I mean specifically that they don’t collide with other objects (especially with player)

in bullet, for turning off collisions per object you can do such things:

  • specify collision group and collision mask while adding object to the world via

[sourcecode language=”cpp”]
btDynamicsWorld::addRigidBody (btRigidBody *body, short group, short mask)
[/sourcecode]

but this is not the way, I use for my ropes, because it prevents collision in very early stage and contact points are not generated for these objects

  • set CF_NO_CONTACT_RESPONSE  flag while constructing body

[sourcecode language=”cpp”]
mBody->setCollisionFlags(mBody->getCollisionFlags() | btCollisionObject::CF_NO_CONTACT_RESPONSE));
[/sourcecode]

contact points will be generated,  so if you don’t need them use previous method because of performance. My sticking objects use this method to let know about ability to grab

Leave a Reply

Your email address will not be published. Required fields are marked *