-
Notifications
You must be signed in to change notification settings - Fork 19
/
functions.h
48 lines (40 loc) · 1.76 KB
/
functions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
* This file is a part of KNOSSOS.
*
* (C) Copyright 2007-2018
* Max-Planck-Gesellschaft zur Foerderung der Wissenschaften e.V.
*
* KNOSSOS is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 of
* the License as published by the Free Software Foundation.
*
* 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 General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* For further information, visit https://knossos.app
* or contact [email protected]
*/
#pragma once
#include "coordinate.h"
constexpr bool inRange(const int value, const int min, const int max);
bool insideCurrentSupercube(const Coordinate & coord, const Coordinate & center, const Coordinate & cubesPerDimension, const Coordinate & cubeSize);
bool currentlyVisible(const Coordinate & coord, const Coordinate & center, const Coordinate & cubesPerDimension, const Coordinate & cubeSize);
class Rotation {
public:
floatCoordinate axis;
float alpha{};
Rotation() = default;
Rotation(const floatCoordinate & axis, const float alpha) : axis(axis), alpha(alpha) {}
};
int roundFloat(float number);
int sgn(float number);
float radToDeg(float rad);
float degToRad(float deg);
bool intersectLineAndPlane(const floatCoordinate planeNormal, const floatCoordinate planeUpVec,
const floatCoordinate lineUpVec, const floatCoordinate lineDirectionVec,
floatCoordinate & intersectionPoint);