mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-05 11:28:17 -04:00
stick to terrain
This commit is contained in:
parent
0c7e721e79
commit
13ab99c29f
@ -518,7 +518,7 @@ class GravityWalker(DirectObject.DirectObject):
|
|||||||
self.vel=Vec3(Vec3.forward() * distance +
|
self.vel=Vec3(Vec3.forward() * distance +
|
||||||
Vec3.right() * slideDistance)
|
Vec3.right() * slideDistance)
|
||||||
if self.vel != Vec3.zero() or self.priorParent != Vec3.zero():
|
if self.vel != Vec3.zero() or self.priorParent != Vec3.zero():
|
||||||
if 1:
|
if 0:
|
||||||
# rotMat is the rotation matrix corresponding to
|
# rotMat is the rotation matrix corresponding to
|
||||||
# our previous heading.
|
# our previous heading.
|
||||||
rotMat=Mat3.rotateMatNormaxis(self.avatarNodePath.getH(), Vec3.up())
|
rotMat=Mat3.rotateMatNormaxis(self.avatarNodePath.getH(), Vec3.up())
|
||||||
@ -532,7 +532,7 @@ class GravityWalker(DirectObject.DirectObject):
|
|||||||
step=rotMat.xform(self.vel) + (self.priorParent * dt)
|
step=rotMat.xform(self.vel) + (self.priorParent * dt)
|
||||||
self.avatarNodePath.setFluidPos(Point3(
|
self.avatarNodePath.setFluidPos(Point3(
|
||||||
self.avatarNodePath.getPos()+step))
|
self.avatarNodePath.getPos()+step))
|
||||||
if 0:
|
if 1:
|
||||||
# rotMat is the rotation matrix corresponding to
|
# rotMat is the rotation matrix corresponding to
|
||||||
# our previous heading.
|
# our previous heading.
|
||||||
rotMat=Mat3.rotateMatNormaxis(self.avatarNodePath.getH(), Vec3.up())
|
rotMat=Mat3.rotateMatNormaxis(self.avatarNodePath.getH(), Vec3.up())
|
||||||
@ -542,7 +542,7 @@ class GravityWalker(DirectObject.DirectObject):
|
|||||||
headsUp(rotMat2, forward, up)
|
headsUp(rotMat2, forward, up)
|
||||||
#rotMat2=Mat3.rotateMatNormaxis(0.0, )
|
#rotMat2=Mat3.rotateMatNormaxis(0.0, )
|
||||||
step=rotMat2.xform(self.vel) + (self.priorParent * dt)
|
step=rotMat2.xform(self.vel) + (self.priorParent * dt)
|
||||||
if 1:
|
if 0:
|
||||||
onScreenDebug.add("a getH()", self.avatarNodePath.getH())
|
onScreenDebug.add("a getH()", self.avatarNodePath.getH())
|
||||||
onScreenDebug.add("a forward", forward.pPrintValues())
|
onScreenDebug.add("a forward", forward.pPrintValues())
|
||||||
onScreenDebug.add("a up", up.pPrintValues())
|
onScreenDebug.add("a up", up.pPrintValues())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user