gd: added input addon
This commit is contained in:
17
addons/guide/modifiers/guide_modifier_normalize.gd
Normal file
17
addons/guide/modifiers/guide_modifier_normalize.gd
Normal file
@ -0,0 +1,17 @@
|
||||
## Normalizes the input vector.
|
||||
@tool
|
||||
class_name GUIDEModifierNormalize
|
||||
extends GUIDEModifier
|
||||
|
||||
func _modify_input(input:Vector3, delta:float, value_type:GUIDEAction.GUIDEActionValueType) -> Vector3:
|
||||
if not input.is_finite():
|
||||
return Vector3.INF
|
||||
|
||||
return input.normalized()
|
||||
|
||||
func _editor_name() -> String:
|
||||
return "Normalize"
|
||||
|
||||
|
||||
func _editor_description() -> String:
|
||||
return "Normalizes the input vector."
|
Reference in New Issue
Block a user