52 lines
785 B
C++
52 lines
785 B
C++
#pragma once
|
|
|
|
#include<iostream>
|
|
#include<vector>
|
|
#include<map>
|
|
#include <deque>
|
|
#include<cmath>
|
|
#include<assert.h>
|
|
/*
|
|
baseÖзÅһЩ¹¤¾ß
|
|
*/
|
|
#define PI 3.14159265358979323
|
|
#define DEG2RAD(theta) (0.01745329251994329 * (theta))
|
|
#define FRACTION(v) ((v) - (int)(v))
|
|
#define UNFRACTION(v) ((int)v + 1 - v)
|
|
#define SWAP_INT(a,b) swapT<int>(a,b);
|
|
template<typename T>
|
|
void swapT(T& a, T& b)
|
|
{
|
|
T temp = a;
|
|
a = b;
|
|
b = temp;
|
|
}
|
|
|
|
|
|
struct Point3D {
|
|
double x, y, z;
|
|
Point3D() : x(0.0), y(0.0), z(0.0) {}
|
|
Point3D(double p_x, double p_y, double p_z) : x(p_x), y(p_y), z(p_z) {}
|
|
};
|
|
|
|
using BYTE = unsigned char;
|
|
struct RGBA {
|
|
BYTE mB;
|
|
BYTE mG;
|
|
BYTE mR;
|
|
BYTE mA;
|
|
|
|
RGBA(
|
|
BYTE r = 255,
|
|
BYTE g = 255,
|
|
BYTE b = 255,
|
|
BYTE a = 255)
|
|
{
|
|
mR = r;
|
|
mG = g;
|
|
mB = b;
|
|
mA = a;
|
|
}
|
|
};
|
|
|