Hugging Face
Models
Datasets
Spaces
Posts
Docs
Enterprise
Pricing
Log In
Sign Up
Datasets:
edbeeching
/
godot_rl_Racer
like
1
Tags:
deep-reinforcement-learning
reinforcement-learning
godot-rl
environments
video-games
Dataset card
Files
Files and versions
Community
main
godot_rl_Racer
/
CameraSmoother.gd
edbeeching
HF staff
Upload . with huggingface_hub
b1e4a8e
almost 2 years ago
raw
Copy download link
history
blame
contribute
delete
Safe
760 Bytes
extends Node3D
#@export var running_size =
30
#
#@onready var camera : Camera3D = $Camera3D
#
#var positions := []
#var rotations := []
#
#
func
_ready():
# positions.append(global_position)
# rotations.append(global_rotation+Vector3.ONE*
2
*PI)
#
#
#
func
running_average(array:Array):
# var s = (array[
0
]) /len(array)
# for i in (len(array)
-1
):
# s += (array[i]) / len(array)
# return s
#
#
func
_physics_process(delta):
# positions.append(global_position)
#
#
if
len(positions) > running_size:
# positions.pop_front()
# camera.global_position = running_average(positions)
#
# rotations.append(global_rotation+Vector3.ONE*
2
*PI)
#
if
len(rotations) > running_size:
# rotations.pop_front()
# camera.global_rotation = running_average(rotations)-Vector3.ONE*
2
*PI