mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
fixed swimming
This commit is contained in:
parent
842b8d6d4e
commit
bd093075a0
@ -27,9 +27,7 @@ class ControlManager:
|
|||||||
|
|
||||||
self.enableJumpCounter = 1
|
self.enableJumpCounter = 1
|
||||||
|
|
||||||
self.swimControls=GravityWalker.GravityWalker(
|
self.swimControls=NonPhysicsWalker.NonPhysicsWalker()
|
||||||
gravity = -32.1740 * 2.0)
|
|
||||||
#self.swimControls=NonPhysicsWalker.NonPhysicsWalker()
|
|
||||||
self.ghostControls=GhostWalker.GhostWalker()
|
self.ghostControls=GhostWalker.GhostWalker()
|
||||||
if __debug__:
|
if __debug__:
|
||||||
self.devControls=DevWalker.DevWalker()
|
self.devControls=DevWalker.DevWalker()
|
||||||
|
@ -158,7 +158,7 @@ class GravityWalker(DirectObject.DirectObject):
|
|||||||
"""
|
"""
|
||||||
# This is a sphere on the ground to detect barrier collisions
|
# This is a sphere on the ground to detect barrier collisions
|
||||||
self.avatarRadius = avatarRadius
|
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 = CollisionNode('GW.cWallSphereNode')
|
||||||
cSphereNode.addSolid(self.cSphere)
|
cSphereNode.addSolid(self.cSphere)
|
||||||
cSphereNodePath = self.avatarNodePath.attachNewNode(cSphereNode)
|
cSphereNodePath = self.avatarNodePath.attachNewNode(cSphereNode)
|
||||||
|
@ -154,7 +154,7 @@ class NonPhysicsWalker(DirectObject.DirectObject):
|
|||||||
reverse = inputState.isSet("reverse")
|
reverse = inputState.isSet("reverse")
|
||||||
turnLeft = inputState.isSet("turnLeft")
|
turnLeft = inputState.isSet("turnLeft")
|
||||||
turnRight = inputState.isSet("turnRight")
|
turnRight = inputState.isSet("turnRight")
|
||||||
slide = inputState.isSet(self.slideName)
|
slide = inputState.isSet(self.slideName) or 0
|
||||||
#jump = inputState.isSet("jump")
|
#jump = inputState.isSet("jump")
|
||||||
# Determine what the speeds are based on the buttons:
|
# Determine what the speeds are based on the buttons:
|
||||||
self.speed=(forward and self.avatarControlForwardSpeed or
|
self.speed=(forward and self.avatarControlForwardSpeed or
|
||||||
@ -196,6 +196,10 @@ class NonPhysicsWalker(DirectObject.DirectObject):
|
|||||||
self.vel.set(0.0, 0.0, 0.0)
|
self.vel.set(0.0, 0.0, 0.0)
|
||||||
return Task.cont
|
return Task.cont
|
||||||
|
|
||||||
|
def doDeltaPos(self):
|
||||||
|
assert(self.debugPrint("doDeltaPos()"))
|
||||||
|
pass
|
||||||
|
|
||||||
def reset(self):
|
def reset(self):
|
||||||
assert(self.debugPrint("reset()"))
|
assert(self.debugPrint("reset()"))
|
||||||
pass
|
pass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user