-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSubspaces.h
More file actions
65 lines (55 loc) · 980 Bytes
/
Subspaces.h
File metadata and controls
65 lines (55 loc) · 980 Bytes
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#pragma once
#ifndef SUBSPACES_H
#define SUBSPACES_H
#ifndef VECTOR_H
#include "Vector.hpp"
#endif
namespace cliqCity
{
template<class Vector>
struct Ray
{
Vector origin;
Vector normal;
};
template<class Vector>
struct Line
{
Vector origin;
Vector end;
};
template<class Vector>
struct AABB
{
Vector origin;
Vector halfSize;
};
template<class Vector, int Dimension>
struct OBB
{
Vector origin;
Vector halfSize;
Vector axis[Dimension];
};
template<class Vector>
struct Sphere
{
Vector origin;
float radius;
};
template<class Vector>
struct Plane
{
Vector normal;
float distance;
};
}
struct Vector2;
struct Vector3;
typedef cliqCity::AABB<Vector2> BoxCollider2D;
typedef cliqCity::AABB<Vector3> BoxCollider;
typedef cliqCity::Sphere<Vector2> CircleCollider;
typedef cliqCity::Sphere<Vector3> SphereCollider;
typedef cliqCity::OBB<Vector3, 3> OrientedBoxCollider;
typedef cliqCity::Plane<Vector3> PlaneCollider;
#endif