Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add missing interpolators #355

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion addons/netfox.extras/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
name="netfox.extras"
description="Game-specific utilities for Netfox"
author="Tamas Galffy and contributors"
version="1.18.0"
version="1.18.1"
script="netfox-extras.gd"
2 changes: 1 addition & 1 deletion addons/netfox.internals/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
name="netfox.internals"
description="Shared internals for netfox addons"
author="Tamas Galffy and contributors"
version="1.18.0"
version="1.18.1"
script="plugin.gd"
2 changes: 1 addition & 1 deletion addons/netfox.noray/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
name="netfox.noray"
description="Bulletproof your connectivity with noray integration for netfox"
author="Tamas Galffy and contributors"
version="1.18.0"
version="1.18.1"
script="netfox-noray.gd"
45 changes: 43 additions & 2 deletions addons/netfox/interpolators.gd
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,13 @@ static func _static_init():
func(a): return a is float,
func(a: float, b: float, f: float): return lerpf(a, b, f)
)


# Int
register(
func(a): return a is int,
func(a: int, b: int, f: float): return int(lerpf(a, b, f))
)

# Vector
register(
func(a): return a is Vector2,
Expand All @@ -62,7 +68,24 @@ static func _static_init():
func(a): return a is Vector3,
func(a: Vector3, b: Vector3, f: float): return a.lerp(b, f)
)

register(
func(a): return a is Vector4,
func(a: Vector4, b: Vector4, f: float): return a.lerp(b, f)
)

register(
func(a): return a is Vector2i,
func(a: Vector2i, b: Vector2i, f: float): return Vector2i(Vector2(a).lerp(b, f))
)
register(
func(a): return a is Vector3i,
func(a: Vector3i, b: Vector3i, f: float): return Vector3i(Vector3(a).lerp(b, f))
)
register(
func(a): return a is Vector4i,
func(a: Vector4i, b: Vector4i, f: float): return Vector4i(Vector4(a).lerp(b, f))
)

# Transform
register(
func(a): return a is Transform2D,
Expand All @@ -72,3 +95,21 @@ static func _static_init():
func(a): return a is Transform3D,
func(a: Transform3D, b: Transform3D, f: float): return a.interpolate_with(b, f)
)

# Quaternion
register(
func(a): return a is Quaternion,
func(a: Quaternion, b: Quaternion, f: float): return a.slerp(b, f)
)

# Basis
register(
func(a): return a is Basis,
func(a: Basis, b: Basis, f: float): return a.slerp(b, f)
)

# Color
register(
func(a): return a is Color,
func(a: Color, b: Color, f: float): return a.lerp(b, f)
)
2 changes: 1 addition & 1 deletion addons/netfox/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
name="netfox"
description="Shared internals for netfox addons"
author="Tamas Galffy and contributors"
version="1.18.0"
version="1.18.1"
script="netfox.gd"