fixed swimming

This commit is contained in:
Dave Schuyler 2003-12-13 02:03:40 +00:00
parent 842b8d6d4e
commit bd093075a0
3 changed files with 7 additions and 5 deletions

View File

@ -27,9 +27,7 @@ class ControlManager:
self.enableJumpCounter = 1
self.swimControls=GravityWalker.GravityWalker(
gravity = -32.1740 * 2.0)
#self.swimControls=NonPhysicsWalker.NonPhysicsWalker()
self.swimControls=NonPhysicsWalker.NonPhysicsWalker()
self.ghostControls=GhostWalker.GhostWalker()
if __debug__:
self.devControls=DevWalker.DevWalker()

View File

@ -158,7 +158,7 @@ class GravityWalker(DirectObject.DirectObject):
"""
# This is a sphere on the ground to detect barrier collisions
self.avatarRadius = avatarRadius
self.cSphere = CollisionSphere(0.0, 0.0, avatarRadius+0.5, avatarRadius)
self.cSphere = CollisionSphere(0.0, 0.0, avatarRadius, avatarRadius)
cSphereNode = CollisionNode('GW.cWallSphereNode')
cSphereNode.addSolid(self.cSphere)
cSphereNodePath = self.avatarNodePath.attachNewNode(cSphereNode)

View File

@ -154,7 +154,7 @@ class NonPhysicsWalker(DirectObject.DirectObject):
reverse = inputState.isSet("reverse")
turnLeft = inputState.isSet("turnLeft")
turnRight = inputState.isSet("turnRight")
slide = inputState.isSet(self.slideName)
slide = inputState.isSet(self.slideName) or 0
#jump = inputState.isSet("jump")
# Determine what the speeds are based on the buttons:
self.speed=(forward and self.avatarControlForwardSpeed or
@ -196,6 +196,10 @@ class NonPhysicsWalker(DirectObject.DirectObject):
self.vel.set(0.0, 0.0, 0.0)
return Task.cont
def doDeltaPos(self):
assert(self.debugPrint("doDeltaPos()"))
pass
def reset(self):
assert(self.debugPrint("reset()"))
pass