Code: Select all
import bge
## this code sends linV to the pelvis and back each frame from every rigid body piece
def main():
cont = bge.logic.getCurrentController()
own = cont.owner
scene=bge.logic.getCurrentScene()
P=scene.objects['pelvic']
sens = cont.sensors['Named']
if sens.positive and P['On']==True:
ownV=own.worldLinearVelocity
own.worldLinearVelocity.x=(own.worldLinearVelocity .x*.6)+P.worldLinearVelocity.x*.4
own.worldLinearVelocity.y=(own.worldLinearVelocity .y*.6)+P.worldLinearVelocity.y*.4
own.worldLinearVelocity.z=(own.worldLinearVelocity .z*.6)+P.worldLinearVelocity.z*.4
P.worldLinearVelocity= ownV*.1+ P.worldLinearVelocity*.895
ownAng=own.worldAngularVelocity
own.worldAngularVelocity.x=(own.worldAngularVeloci ty.x*.9)+P.worldAngularVelocity.x*.1
own.worldAngularVelocity.y=(own.worldAngularVeloci ty.y*.9)+P.worldAngularVelocity.y*.1
own.worldAngularVelocity.z=(own.worldAngularVeloci ty.z*.9)+P.worldAngularVelocity.z*.1
P.worldAngularVelocity= ownAng*.05+ P.worldAngularVelocity*.845
if sens.positive and P['On']==False:
ownV=own.worldLinearVelocity
own.worldLinearVelocity.x=(own.worldLinearVelocity .x*.9)+P.worldLinearVelocity.x*.1
own.worldLinearVelocity.y=(own.worldLinearVelocity .y*.9)+P.worldLinearVelocity.y*.1
own.worldLinearVelocity.z=(own.worldLinearVelocity .z*.9)+P.worldLinearVelocity.z*.1
P.worldLinearVelocity= ownV*.01+ P.worldLinearVelocity*.99
main()
Can anyone direct me to another method of fluid movement of a rag-doll, that looks like it's not "slack?"
https://www.youtube.com/watch?v=Y9xyFyLmHng