From c42a0a0613b23914aa7920a890deb5ff7b4a8634 Mon Sep 17 00:00:00 2001 From: DeltaRager Date: Fri, 8 Oct 2021 10:27:16 +0530 Subject: [PATCH 1/4] Create Reflection.lua --- src/Reflection.lua | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 src/Reflection.lua diff --git a/src/Reflection.lua b/src/Reflection.lua new file mode 100644 index 0000000..73a0897 --- /dev/null +++ b/src/Reflection.lua @@ -0,0 +1,6 @@ +-- Finding reflection vector for an incident vector +-- Arguments made for raycast [Origin, RaycastResult.Position, RaycastResult.Normal] + +local function Reflection(origin : Vector3,hitpos : Vector3,normal : Vector3) + return ((hitpos - origin) - 2*((hitpos - origin):Dot(normal) * normal)) +end \ No newline at end of file From 4fbd8e4e0738816f5ec185ada36b5028a00006a7 Mon Sep 17 00:00:00 2001 From: DeltaRager Date: Fri, 8 Oct 2021 11:09:18 +0530 Subject: [PATCH 2/4] Update README.md --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 5b9e2c8..0fb0915 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ Feel free to submit a pull request with your own contributions! - [LinearInterpolation.lua](#linearinterpolation) - [Map.lua](#map) - [ModelCFramer.lua](#modelcframer) + - [Reflection.lua](#reflection) - [RoundNumbers.lua](#roundnumbers) ### AngleBetween @@ -111,6 +112,21 @@ end ---------- +### Reflection +[`Reflection.lua`](src/Reflection.lua) + +```lua +-- Finding reflection vector for an incident vector +-- Arguments made for raycast [Origin, RaycastResult.Position, RaycastResult.Normal] + +local function Reflection(origin : Vector3,hitpos : Vector3,normal : Vector3) + return ((hitpos - origin) - 2*((hitpos - origin):Dot(normal) * normal)) +end +``` + +---------- + + ### RoundNumbers [`RoundNumbers.lua`](src/RoundNumbers.lua) From 0bcabbb06a4bb89e3cada6f16bb009d586151237 Mon Sep 17 00:00:00 2001 From: DeltaRager Date: Fri, 8 Oct 2021 11:10:20 +0530 Subject: [PATCH 3/4] Update Reflection.lua --- src/Reflection.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Reflection.lua b/src/Reflection.lua index 73a0897..3f8ede0 100644 --- a/src/Reflection.lua +++ b/src/Reflection.lua @@ -1,4 +1,4 @@ --- Finding reflection vector for an incident vector +-- Finding the reflection vector for an incident vector -- Arguments made for raycast [Origin, RaycastResult.Position, RaycastResult.Normal] local function Reflection(origin : Vector3,hitpos : Vector3,normal : Vector3) From a045dd11282046f1b3d64322e3608c46b17ed081 Mon Sep 17 00:00:00 2001 From: DeltaRager Date: Fri, 8 Oct 2021 11:10:44 +0530 Subject: [PATCH 4/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0fb0915..98226ce 100644 --- a/README.md +++ b/README.md @@ -116,7 +116,7 @@ end [`Reflection.lua`](src/Reflection.lua) ```lua --- Finding reflection vector for an incident vector +-- Finding the reflection vector for an incident vector -- Arguments made for raycast [Origin, RaycastResult.Position, RaycastResult.Normal] local function Reflection(origin : Vector3,hitpos : Vector3,normal : Vector3)