breakable constraints
Posted: Mon Jul 03, 2006 5:05 pm
To trigger breaking chains, collapsing bridges etc. there is a new getAppliedImpulse to measure 'stress' on the constraints. A bridge can be build using 'hinge' constraint, or a bunch of point-to-point constraints.
The stress/appliedImpulse can be read out in the very latest RC3 preview43 build, see the included breaking_chain.blend.
Win32:
http://www.continuousphysics.com/ftp/pu ... indows.zip
Linux:
http://www.continuousphysics.com/ftp/pu ... view43.tgz
Erwin
The stress/appliedImpulse can be read out in the very latest RC3 preview43 build, see the included breaking_chain.blend.
Win32:
http://www.continuousphysics.com/ftp/pu ... indows.zip
Linux:
http://www.continuousphysics.com/ftp/pu ... view43.tgz
Code: Select all
#shows breaking constraints dependent on constraint 'appliedImpulse'
import PhysicsConstraints
import GameLogic
ob = GameLogic.getCurrentController().getOwner()
#ob.id points to the constraint id
imp1 = PhysicsConstraints.getAppliedImpulse(ob.id)
imp = imp1*imp1
print imp
breakingTreshold = 0.82
if imp>breakingTreshold:
PhysicsConstraints.removeConstraint(ob.id)
Erwin