You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-13 13:31:48 +00:00
round / ceil methods for c sharp vectors
(cherry picked from commit a6bd2c6e72)
This commit is contained in:
committed by
Hein-Pieter van Braam
parent
8231b3cef8
commit
f697b53eba
@@ -97,6 +97,11 @@ namespace Godot
|
||||
return -Reflect(n);
|
||||
}
|
||||
|
||||
public Vector2 Ceil()
|
||||
{
|
||||
return new Vector2(Mathf.Ceil(x), Mathf.Ceil(y));
|
||||
}
|
||||
|
||||
public Vector2 Clamped(real_t length)
|
||||
{
|
||||
var v = this;
|
||||
@@ -190,6 +195,11 @@ namespace Godot
|
||||
return new Vector2(Mathf.Cos(rads), Mathf.Sin(rads)) * Length();
|
||||
}
|
||||
|
||||
public Vector2 Round()
|
||||
{
|
||||
return new Vector2(Mathf.Round(x), Mathf.Round(y));
|
||||
}
|
||||
|
||||
public void Set(real_t x, real_t y)
|
||||
{
|
||||
this.x = x;
|
||||
|
||||
Reference in New Issue
Block a user