mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
fixed swimming
This commit is contained in:
parent
842b8d6d4e
commit
bd093075a0
@ -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()
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user