diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2018-08-23 08:59:26 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-23 08:59:26 +0200 |
| commit | 1e729630d6bff3a32751a1850271b080494373ba (patch) | |
| tree | 14f29a26bb9733b5094a2ec41cf1efa8fe29516c /modules/mono/glue/cs_files/Vector3.cs | |
| parent | a2acbb0bfb547f893f9d84cfde4957fdc4791dae (diff) | |
| parent | 434973fb83ce8add0a235fd5895acaf730857a08 (diff) | |
| download | redot-engine-1e729630d6bff3a32751a1850271b080494373ba.tar.gz | |
Merge pull request #21240 from aaronfranke/mono-project-vector
[Mono] Vector2/3 Project methods
Diffstat (limited to 'modules/mono/glue/cs_files/Vector3.cs')
| -rw-r--r-- | modules/mono/glue/cs_files/Vector3.cs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/mono/glue/cs_files/Vector3.cs b/modules/mono/glue/cs_files/Vector3.cs index 861d9c54d9..6fffe5e4d6 100644 --- a/modules/mono/glue/cs_files/Vector3.cs +++ b/modules/mono/glue/cs_files/Vector3.cs @@ -210,6 +210,11 @@ namespace Godot ); } + public Vector3 Project(Vector3 onNormal) + { + return onNormal * (Dot(onNormal) / onNormal.LengthSquared()); + } + public Vector3 Reflect(Vector3 n) { #if DEBUG |
