-
Notifications
You must be signed in to change notification settings - Fork 0
/
Collider.cpp
46 lines (35 loc) · 1.02 KB
/
Collider.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
44
45
46
#ifndef LINEARCHEXT_COLLIDER_CPP
#define LINEARCHEXT_COLLIDER_CPP
#include "Collider.hpp"
namespace LinearchExt{
std::list<Collider> colliders0;
std::list<Collider> Collider::colliders = colliders0;
void Collider::Init(GameObject* gameObject){
Component::Init(gameObject);
gameObject->collider = this;
}
Collider::Collider(){
Collider::colliders.push_back(*this);
}
Collider::Collider(GameObject* gameObject){
Init(gameObject);
Collider::colliders.push_back(*this);
}
Collider::~Collider(){
if(gameObject != 0 && gameObject->collider == this)
gameObject->collider = 0;
}
bool IsPointInCollider(){
return false;
}
bool LineColliderIntersection(Vector2 from, Vector2 to, Intersection** out = 0){
return false;
}
bool CheckIntersection(Collider col, Intersection** out = 0){
return false;
}
bool Raycast(Ray ray, RaycastHit** out = 0){
return false;
}
}
#endif // COLLIDER_CPP