mirror of
https://github.com/DigvijaysinhGohil/Godot-Shader-Lib.git
synced 2026-10-10 04:43:04 +08:00
1.0 KiB
1.0 KiB
Chebyshev Distance node
Returns the distance between two points using Chebyshev distance matrix.
Controls
| Options | Description |
|---|---|
| Vector2, Vector3 | Vector type to use for calculation |
Inputs
| Name | Type | Binding | Description |
|---|---|---|---|
| a | Dynamic vector | none | Point a |
| b | Dynamic vector | none | Point b |
| power | float | none | Power to use for Chebyshev distance |
Outputs
| Name | Type | Binding | Description |
|---|---|---|---|
| distance | float | None | Distance between 2 points |
ShaderInc location
res://addons/ShaderLib/Maths/Maths.gdshaderinc
Method signature
For 2D - float chebyshev_distance_2d(vec2 point1, vec2 point2, float power)
For 3D - float chebyshev_distance_3d(vec3 point1, vec3 point2, float power)
Parameters for 2D
| Name | Type | Description |
|---|---|---|
| point1 | vec2 | Point a |
| point2 | vec2 | Point b |
| power | float | Power for Chebyshev distance |
Parameters for 3D
| Name | Type | Description |
|---|---|---|
| point1 | vec3 | Point a |
| point2 | vec3 | Point b |
| power | float | Power for Chebyshev distance |