Make MovingPlatform also use planet-only gravity

also made it a bit larger
This commit is contained in:
karl 2021-06-16 20:58:12 +02:00
parent 78db1629b5
commit 62956d8d7d
2 changed files with 5 additions and 5 deletions

View File

@ -31,7 +31,7 @@ func _process(delta):
velocity = (translation - translation_before) / delta
# Rotate according to gravity
var gravity_acceleration = get_node(solar_system).get_gravity_acceleration(global_transform.origin)
var gravity_acceleration = get_node(solar_system).get_closest_gravity_acceleration(global_transform.origin)
# Rotate down vector to face center of gravity
var down = gravity_acceleration

View File

@ -13,10 +13,10 @@
[ext_resource path="res://LerpedFollow.gd" type="Script" id=11]
[sub_resource type="CubeMesh" id=1]
size = Vector3( 4, 0.5, 4 )
size = Vector3( 10, 0.5, 10 )
[sub_resource type="ConvexPolygonShape" id=2]
points = PoolVector3Array( -2, 0.25, 2, 2, 0.25, -2, 2, 0.25, 2, -2, 0.25, -2, -2, -0.25, 2, 2, -0.25, -2, 2, -0.25, 2, -2, -0.25, -2, 2, 0.25, 2, -2, 0.25, -2, 2, 0.25, -2, -2, 0.25, 2, 2, -0.25, 2, -2, -0.25, -2, 2, -0.25, -2, -2, -0.25, 2, 2, 0.25, 2, -2, -0.25, 2, -2, 0.25, 2, 2, -0.25, 2, 2, 0.25, -2, -2, -0.25, -2, -2, 0.25, -2, 2, -0.25, -2 )
[sub_resource type="ConcavePolygonShape" id=12]
data = PoolVector3Array( -5, 0.25, 5, 5, 0.25, 5, -5, -0.25, 5, 5, 0.25, 5, 5, -0.25, 5, -5, -0.25, 5, 5, 0.25, -5, -5, 0.25, -5, 5, -0.25, -5, -5, 0.25, -5, -5, -0.25, -5, 5, -0.25, -5, 5, 0.25, 5, 5, 0.25, -5, 5, -0.25, 5, 5, 0.25, -5, 5, -0.25, -5, 5, -0.25, 5, -5, 0.25, -5, -5, 0.25, 5, -5, -0.25, -5, -5, 0.25, 5, -5, -0.25, 5, -5, -0.25, -5, 5, 0.25, 5, -5, 0.25, 5, 5, 0.25, -5, -5, 0.25, 5, -5, 0.25, -5, 5, 0.25, -5, -5, -0.25, 5, 5, -0.25, 5, -5, -0.25, -5, 5, -0.25, 5, 5, -0.25, -5, -5, -0.25, -5 )
[sub_resource type="PhysicsMaterial" id=3]
friction = 0.0
@ -118,7 +118,7 @@ mesh = SubResource( 1 )
material/0 = null
[node name="CollisionShape" type="CollisionShape" parent="MovingPlatformPivot/MovingPlatform"]
shape = SubResource( 2 )
shape = SubResource( 12 )
[node name="Planets" type="Spatial" parent="."]
script = ExtResource( 2 )