aboutsummaryrefslogtreecommitdiff
path: root/src/guiPasswordChange.cpp
diff options
context:
space:
mode:
authorparamat <mat.gregory@virginmedia.com>2016-04-25 11:47:25 +0100
committerkwolekr <kwolekr@minetest.net>2016-04-28 23:36:19 -0400
commit8b1f8e99cf860625ebd20531ab7f3e8316a66b51 (patch)
treeea03ca34bd86180bae270493b47f1f6ad5e19705 /src/guiPasswordChange.cpp
parent46fd114e9a4e05b74576dce682e24357363298e7 (diff)
downloadminetest-8b1f8e99cf860625ebd20531ab7f3e8316a66b51.tar.gz
minetest-8b1f8e99cf860625ebd20531ab7f3e8316a66b51.tar.bz2
minetest-8b1f8e99cf860625ebd20531ab7f3e8316a66b51.zip
Mapgen: Make 3D noise tunnels' width settable
Correct parameter names mg_valleys to mgvalleys Remove biome NoiseParams from MapgenValleysParams Improve format of parameter code
Diffstat (limited to 'src/guiPasswordChange.cpp')
0 files changed, 0 insertions, 0 deletions
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
/*
Minetest
Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#include "test.h"

#include "collision.h"

class TestCollision : public TestBase {
public:
	TestCollision() { TestManager::registerTestModule(this); }
	const char *getName() { return "TestCollision"; }

	void runTests(IGameDef *gamedef);

	void testAxisAlignedCollision();
};

static TestCollision g_test_instance;

void TestCollision::runTests(IGameDef *gamedef)
{
	TEST(testAxisAlignedCollision);
}

////////////////////////////////////////////////////////////////////////////////

void TestCollision::testAxisAlignedCollision()
{
	for (s16 bx = -3; bx <= 3; bx++)
	for (s16 by = -3; by <= 3; by++)
	for (s16 bz = -3; bz <= 3; bz++) {
		// X-
		{
			aabb3f s(bx, by, bz, bx+1, by+1, bz+1);
			aabb3f m(bx-2, by, bz, bx-1, by+1, bz+1);
			v3f v(1, 0, 0);
			f32 dtime = 0;
			UASSERT(axisAlignedCollision(s, m, v, 0, dtime) == 0);
			UASSERT(fabs(dtime - 1.000) < 0.001);
		}
		{
			aabb3f s(bx, by, bz, bx+1, by+1, bz+1);
			aabb3f m(bx-2, by, bz, bx-1, by+1, bz+1);
			v3f v(-1, 0, 0);
			f32 dtime = 0;
			UASSERT(axisAlignedCollision(s, m, v, 0, dtime) == -1);
		}
		{
			aabb3f s(bx, by, bz, bx+1, by+1, bz+1);
			aabb3f m(bx-2, by+1.5, bz, bx-1, by+2.5, bz-1);
			v3f v(1, 0, 0);
			f32 dtime;
			UASSERT(axisAlignedCollision(s, m, v, 0, dtime) == -1);
		}
		{
			aabb3f s(bx, by, bz, bx+1, by+1, bz+1);