|
@@ -80,14 +80,22 @@ func _physics_process(delta):
|
|
vel.z = relativeDir.z * moveSpeed2
|
|
vel.z = relativeDir.z * moveSpeed2
|
|
vel.y = relativeDir.y * moveSpeed2
|
|
vel.y = relativeDir.y * moveSpeed2
|
|
|
|
|
|
|
|
+ var gravity = self.global_transform.origin.normalized()
|
|
# move the player
|
|
# move the player
|
|
vel = move_and_slide(vel, Vector3.UP)
|
|
vel = move_and_slide(vel, Vector3.UP)
|
|
#ray = ray.look_at(self.global_transform.origin, Vector3.UP)
|
|
#ray = ray.look_at(self.global_transform.origin, Vector3.UP)
|
|
|
|
|
|
var pos = self.global_transform.origin
|
|
var pos = self.global_transform.origin
|
|
|
|
+ var polPos = Common.globalToLatLon(pos.x,pos.y,pos.z)
|
|
|
|
+ var rotationDeg=get_rotation_degrees().x
|
|
|
|
+ var posNorm=abs(pos.normalized().y)
|
|
|
|
+ var targetRot = posNorm * 90
|
|
|
|
+ #if rotationDeg < targetRot:
|
|
|
|
+ #rotate_x(1)
|
|
|
|
+ #elif rotationDeg > targetRot:
|
|
|
|
+ #rotate_x(-1)
|
|
|
|
|
|
.get_parent().get_node("UI/1").text="x:%s y:%s z:%s" %[pos.x, pos.y, pos.z]
|
|
.get_parent().get_node("UI/1").text="x:%s y:%s z:%s" %[pos.x, pos.y, pos.z]
|
|
- var polPos = Common.globalToLatLon(pos.x,pos.y,pos.z)
|
|
|
|
.get_parent().get_node("UI/2").text="lat:%s lon:%s" %[polPos.x, polPos.y]
|
|
.get_parent().get_node("UI/2").text="lat:%s lon:%s" %[polPos.x, polPos.y]
|
|
#.get_node("UI/3").text="LatLonPos=="+str(latLonToGlobal( self.global_transform.origin.x,self.global_transform.origin.y))
|
|
#.get_node("UI/3").text="LatLonPos=="+str(latLonToGlobal( self.global_transform.origin.x,self.global_transform.origin.y))
|
|
|
|
|