summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-03-18 13:50:28 +0100
committerMattes D <github@xoft.cz>2015-03-18 13:50:43 +0100
commitc41183d450cd036cd323546b525e819edc0e1b73 (patch)
tree0de722670f74dcafca0ecdc2db2a9381df27726e /MCServer/Plugins
parentNetwork: Close the UDP endpoint in destructor. (diff)
downloadcuberite-c41183d450cd036cd323546b525e819edc0e1b73.tar
cuberite-c41183d450cd036cd323546b525e819edc0e1b73.tar.gz
cuberite-c41183d450cd036cd323546b525e819edc0e1b73.tar.bz2
cuberite-c41183d450cd036cd323546b525e819edc0e1b73.tar.lz
cuberite-c41183d450cd036cd323546b525e819edc0e1b73.tar.xz
cuberite-c41183d450cd036cd323546b525e819edc0e1b73.tar.zst
cuberite-c41183d450cd036cd323546b525e819edc0e1b73.zip
Diffstat (limited to '')
-rw-r--r--MCServer/Plugins/Debuggers/Debuggers.lua55
-rw-r--r--MCServer/Plugins/Debuggers/Info.lua6
2 files changed, 61 insertions, 0 deletions
diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua
index c8069a411..9ea623b64 100644
--- a/MCServer/Plugins/Debuggers/Debuggers.lua
+++ b/MCServer/Plugins/Debuggers/Debuggers.lua
@@ -1741,3 +1741,58 @@ end
+
+function HandleConsoleBBox(a_Split)
+ local bbox = cBoundingBox(0, 10, 0, 10, 0, 10)
+ local v1 = Vector3d(1, 1, 1)
+ local v2 = Vector3d(5, 5, 5)
+ local v3 = Vector3d(11, 11, 11)
+
+ if (bbox:IsInside(v1)) then
+ LOG("v1 is inside bbox")
+ else
+ LOG("v1 is not inside bbox")
+ end
+
+ if (bbox:IsInside(v2)) then
+ LOG("v2 is inside bbox")
+ else
+ LOG("v2 is not inside bbox")
+ end
+
+ if (bbox:IsInside(v3)) then
+ LOG("v3 is inside bbox")
+ else
+ LOG("v3 is not inside bbox")
+ end
+
+ if (bbox:IsInside(v1, v2)) then
+ LOG("v1*v2 is inside bbox")
+ else
+ LOG("v1*v2 is not inside bbox")
+ end
+
+ if (bbox:IsInside(v2, v1)) then
+ LOG("v2*v1 is inside bbox")
+ else
+ LOG("v2*v1 is not inside bbox")
+ end
+
+ if (bbox:IsInside(v1, v3)) then
+ LOG("v1*v3 is inside bbox")
+ else
+ LOG("v1*v3 is not inside bbox")
+ end
+
+ if (bbox:IsInside(v2, v3)) then
+ LOG("v2*v3 is inside bbox")
+ else
+ LOG("v2*v3 is not inside bbox")
+ end
+
+ return true
+end
+
+
+
+
diff --git a/MCServer/Plugins/Debuggers/Info.lua b/MCServer/Plugins/Debuggers/Info.lua
index 63a4b9177..e062a8d8c 100644
--- a/MCServer/Plugins/Debuggers/Info.lua
+++ b/MCServer/Plugins/Debuggers/Info.lua
@@ -200,6 +200,12 @@ g_PluginInfo =
ConsoleCommands =
{
+ ["bbox"] =
+ {
+ Handler = HandleConsoleBBox,
+ HelpString = "Performs cBoundingBox API tests",
+ },
+
["hash"] =
{
Handler = HandleConsoleHash,