-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtools.cpp
45 lines (37 loc) · 885 Bytes
/
tools.cpp
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
//
// Created by xhy on 2021/12/16.
//
#include "tools.h"
#include <cstdarg>
#include <cstdio>
bool Vec2i::operator<(const Vec2i &rhs) const {
if (x < rhs.x)
return true;
if (rhs.x < x)
return false;
return z < rhs.z;
}
bool Vec2i::operator==(const Vec2i &rhs) const {
return x == rhs.x &&
z == rhs.z;
}
bool Box::operator<(const Box &rhs) const {
if (min < rhs.min)
return true;
if (rhs.min < min)
return false;
return max < rhs.max;
}
bool Box::operator==(const Box &rhs) const {
return min == rhs.min &&
max == rhs.max;
}
void log(const char *file_name, const char *function_name, size_t line, const char *fmt, ...) {
#ifdef DEBUG
va_list args;
va_start(args, fmt);
printf("[%s: %s: %d] ", file_name, function_name, line);
vprintf(fmt, args);
printf("\n");
#endif
}