Added automatic procedural level of detail to planets

This commit is contained in:
2024-02-29 09:00:00 -05:00
parent c2399094c4
commit ec869732ba
14 changed files with 326 additions and 237 deletions

View File

@ -0,0 +1,20 @@
extends Camera3D
@export var velocity: Vector3
@export var acceleration: Vector3
var g : float = 0.01
# Called when the node enters the scene tree for the first time.
func _ready():
global_position = Vector3(0,0,-150)
acceleration = -global_position.normalized()
velocity = Vector3(0.5, 0.5, 0)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
acceleration = -global_position.normalized() * g
velocity += acceleration
global_translate(velocity)
Global.camera_position = global_position
look_at(Vector3(0,0,0))