This repository has been archived on 2023-12-19. You can view files and clone it, but cannot push or open issues or pull requests.
MUR/scripts/Util.gd

37 lines
783 B
GDScript

extends Node
var random_number_generator:RandomNumberGenerator = RandomNumberGenerator.new()
func _ready():
random_number_generator.randomize()
func randf():
return random_number_generator.randf()
func randf_range (from:float, to:float ):
return random_number_generator.randf_range(from,to)
func randfn (mean:float=0.0, deviation:float=1.0 ):
return random_number_generator.randfn(mean, deviation)
func randi():
return random_number_generator.randi()
func randi_range ( from:int, to:int ):
return random_number_generator.randi_range( from, to)
func clear_node(node:Node):
for idx in range(node.get_child_count()):
node.remove_child(node.get_child(0))
func curve_get_last_point(curve:Curve3D):
return curve.get_point_position(curve.get_point_count() - 1)