Beispiel #1
0
 def breakMe(self, debrisNode):
     projDummy = ProjectileArc(self.wantRotate, self.wantColl)
     projDummy.reparentTo(self.prop)
     projDummy.startVel = Vec3(random.uniform(-10, 10),
                               random.uniform(-10, 10),
                               random.uniform(20, 40))
     projDummy.gravityMult = 2.0
     projDummy.rotateMin = 90
     projDummy.rotateMax = 200
     if self.wantHidden:
         debrisNode.unstash()
     projDummy.transNode.setPos(render, debrisNode.getPos(render))
     projDummy.transNode.setHpr(render, debrisNode.getHpr(render))
     projDummy.transNode.setScale(render, debrisNode.getScale(render))
     projDummy.startPos = projDummy.transNode.getPos(render)
     debrisNode.reparentTo(projDummy.rotateNode)
     debrisNode.setPos(0, 0, 0)
     debrisNode.setHpr(0, 0, 0)
     debrisNode.setScale(1)
     projDummy.startPos = projDummy.transNode.getPos(render)
     debrisParent = self.getDebrisParent()
     projDummy.wrtReparentTo(render)
     shatterSeq = Sequence(Func(projDummy.play))
     self.intervals.append(shatterSeq)
     shatterSeq.start()
Beispiel #2
0
 def breakMe(self, debrisNode):
     projDummy = ProjectileArc(self.wantRotate, self.wantColl)
     projDummy.reparentTo(self.prop)
     projDummy.startVel = Vec3(random.uniform(-60, 60), random.uniform(-60, 60), random.uniform(30, 100))
     projDummy.gravityMult = 4.0
     projDummy.rotateMin = 30
     projDummy.rotateMax = 200
     debrisParent = self.getDebrisParent()
     if self.wantHidden:
         debrisNode.unstash()
     projDummy.setPos(debrisNode.getPos(self.prop))
     projDummy.setScale(debrisNode.getScale(self.prop))
     debrisNode.reparentTo(projDummy.rotateNode)
     debrisNode.setPos(0, 0, 0)
     debrisNode.setHpr(0, 0, 0)
     projDummy.startPos = projDummy.transNode.getPos(self.prop)
     shatterSeq = Sequence(Func(projDummy.play), Wait(10.0), Func(debrisNode.reparentTo, debrisParent), Func(debrisNode.hide))
     self.intervals.append(shatterSeq)
     shatterSeq.start()
 def breakMe(self, debrisNode):
     projDummy = ProjectileArc(self.wantRotate, self.wantColl)
     projDummy.reparentTo(self.prop)
     projDummy.startVel = Vec3(random.uniform(-60, 60), random.uniform(-60, 60), random.uniform(30, 100))
     projDummy.gravityMult = 4.0
     projDummy.rotateMin = 30
     projDummy.rotateMax = 200
     debrisParent = self.getDebrisParent()
     if self.wantHidden:
         debrisNode.unstash()
     
     projDummy.setPos(debrisNode.getPos(self.prop))
     projDummy.setScale(debrisNode.getScale(self.prop))
     debrisNode.reparentTo(projDummy.rotateNode)
     debrisNode.setPos(0, 0, 0)
     debrisNode.setHpr(0, 0, 0)
     projDummy.startPos = projDummy.transNode.getPos(self.prop)
     shatterSeq = Sequence(Func(projDummy.play), Wait(10.0), Func(debrisNode.reparentTo, debrisParent), Func(debrisNode.hide))
     self.intervals.append(shatterSeq)
     shatterSeq.start()
 def breakMe(self, debrisNode):
     projDummy = ProjectileArc(self.wantRotate, self.wantColl)
     projDummy.reparentTo(self.prop)
     projDummy.startVel = Vec3(random.uniform(-10, 10), random.uniform(-10, 10), random.uniform(20, 40))
     projDummy.gravityMult = 2.0
     projDummy.rotateMin = 90
     projDummy.rotateMax = 200
     if self.wantHidden:
         debrisNode.unstash()
     
     projDummy.transNode.setPos(render, debrisNode.getPos(render))
     projDummy.transNode.setHpr(render, debrisNode.getHpr(render))
     projDummy.transNode.setScale(render, debrisNode.getScale(render))
     projDummy.startPos = projDummy.transNode.getPos(render)
     debrisNode.reparentTo(projDummy.rotateNode)
     debrisNode.setPos(0, 0, 0)
     debrisNode.setHpr(0, 0, 0)
     debrisNode.setScale(1)
     projDummy.startPos = projDummy.transNode.getPos(render)
     debrisParent = self.getDebrisParent()
     projDummy.wrtReparentTo(render)
     shatterSeq = Sequence(Func(projDummy.play))
     self.intervals.append(shatterSeq)
     shatterSeq.start()