mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
added stern sphere
This commit is contained in:
parent
45a2ab245c
commit
efcad6c65a
@ -170,6 +170,7 @@ class ShipPilot(PhysicsWalker.PhysicsWalker):
|
|||||||
self.cSphereNodePath = self.avatarNodePath.attachNewNode(cSphereNode)
|
self.cSphereNodePath = self.avatarNodePath.attachNewNode(cSphereNode)
|
||||||
self.cSphereBitMask = bitmask
|
self.cSphereBitMask = bitmask
|
||||||
else:
|
else:
|
||||||
|
# Middle sphere:
|
||||||
self.avatarRadius = avatarRadius
|
self.avatarRadius = avatarRadius
|
||||||
self.cSphere = CollisionSphere(0.0, -5.0, 0.0, avatarRadius)
|
self.cSphere = CollisionSphere(0.0, -5.0, 0.0, avatarRadius)
|
||||||
cSphereNode = CollisionNode('SP.cSphereNode')
|
cSphereNode = CollisionNode('SP.cSphereNode')
|
||||||
@ -188,6 +189,7 @@ class ShipPilot(PhysicsWalker.PhysicsWalker):
|
|||||||
self.pusher.addCollider(self.cSphereNodePath, self.avatarNodePath)
|
self.pusher.addCollider(self.cSphereNodePath, self.avatarNodePath)
|
||||||
|
|
||||||
if 1:
|
if 1:
|
||||||
|
# Front sphere:
|
||||||
self.cBowSphere = CollisionSphere(0.0, 20.0, 0.0, avatarRadius)
|
self.cBowSphere = CollisionSphere(0.0, 20.0, 0.0, avatarRadius)
|
||||||
cBowSphereNode = CollisionNode('SP.cBowSphereNode')
|
cBowSphereNode = CollisionNode('SP.cBowSphereNode')
|
||||||
cBowSphereNode.addSolid(self.cBowSphere)
|
cBowSphereNode.addSolid(self.cBowSphere)
|
||||||
@ -199,6 +201,18 @@ class ShipPilot(PhysicsWalker.PhysicsWalker):
|
|||||||
|
|
||||||
self.pusher.addCollider(self.cBowSphereNodePath, self.avatarNodePath)
|
self.pusher.addCollider(self.cBowSphereNodePath, self.avatarNodePath)
|
||||||
|
|
||||||
|
# Back sphere:
|
||||||
|
self.cSternSphere = CollisionSphere(0.0, -20.0, 0.0, avatarRadius)
|
||||||
|
cSternSphereNode = CollisionNode('SP.cSternSphereNode')
|
||||||
|
cSternSphereNode.addSolid(self.cSternSphere)
|
||||||
|
self.cSternSphereNodePath = self.avatarNodePath.attachNewNode(cSternSphereNode)
|
||||||
|
self.cSternSphereBitMask = bitmask
|
||||||
|
|
||||||
|
cSternSphereNode.setFromCollideMask(self.cSphereBitMask)
|
||||||
|
cSternSphereNode.setIntoCollideMask(BitMask32.allOff())
|
||||||
|
|
||||||
|
self.pusher.addCollider(self.cSternSphereNodePath, self.avatarNodePath)
|
||||||
|
|
||||||
def takedownPhysics(self):
|
def takedownPhysics(self):
|
||||||
assert(self.debugPrint("takedownPhysics()"))
|
assert(self.debugPrint("takedownPhysics()"))
|
||||||
if hasattr(self, "phys"):
|
if hasattr(self, "phys"):
|
||||||
@ -423,6 +437,7 @@ class ShipPilot(PhysicsWalker.PhysicsWalker):
|
|||||||
if active:
|
if active:
|
||||||
self.cTrav.addCollider(self.cSphereNodePath, self.pusher)
|
self.cTrav.addCollider(self.cSphereNodePath, self.pusher)
|
||||||
self.cTrav.addCollider(self.cBowSphereNodePath, self.pusher)
|
self.cTrav.addCollider(self.cBowSphereNodePath, self.pusher)
|
||||||
|
self.cTrav.addCollider(self.cSternSphereNodePath, self.pusher)
|
||||||
if self.useHeightRay:
|
if self.useHeightRay:
|
||||||
if self.useLifter:
|
if self.useLifter:
|
||||||
self.cTrav.addCollider(self.cRayNodePath, self.lifter)
|
self.cTrav.addCollider(self.cRayNodePath, self.lifter)
|
||||||
@ -431,6 +446,7 @@ class ShipPilot(PhysicsWalker.PhysicsWalker):
|
|||||||
else:
|
else:
|
||||||
self.cTrav.removeCollider(self.cSphereNodePath)
|
self.cTrav.removeCollider(self.cSphereNodePath)
|
||||||
self.cTrav.removeCollider(self.cBowSphereNodePath)
|
self.cTrav.removeCollider(self.cBowSphereNodePath)
|
||||||
|
self.cTrav.removeCollider(self.cSternSphereNodePath)
|
||||||
if self.useHeightRay:
|
if self.useHeightRay:
|
||||||
self.cTrav.removeCollider(self.cRayNodePath)
|
self.cTrav.removeCollider(self.cRayNodePath)
|
||||||
# Now that we have disabled collisions, make one more pass
|
# Now that we have disabled collisions, make one more pass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user