Compare commits
2 Commits
34221bf850
...
2b7c1dd829
Author | SHA1 | Date |
---|---|---|
Lorenzo Cogotti | 2b7c1dd829 | |
Lorenzo Cogotti | 940846e420 |
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
|
||||
"workspace.checkThirdParty": false,
|
||||
"runtime.version": "LuaJIT",
|
||||
"diagnostics.globals": [ "love" ]
|
||||
}
|
9
vec.lua
9
vec.lua
|
@ -26,8 +26,13 @@ function vec.dot3(x1,y1,z1, x2,y2,z2)
|
|||
return x1*x2 + y1*y2 + z1*z2
|
||||
end
|
||||
|
||||
--- Vector cross product.
|
||||
function vec.cross(x1,y1,z1, x2,y2,z2)
|
||||
--- Vector cross product in 2D, returning a scalar.
|
||||
function vec.cross(x1,y1, x2,y2)
|
||||
return x1*y2 - y1*x2
|
||||
end
|
||||
|
||||
--- Vector cross product in 3D, returning a vector.
|
||||
function vec.cross3(x1,y1,z1, x2,y2,z2)
|
||||
return y1*z2 - z1*y2,
|
||||
z1*x2 - x1*z2,
|
||||
x1*y2 - y1*x2
|
||||
|
|
Loading…
Reference in New Issue