Add raycasting

This commit is contained in:
Dane Johnson committed 2021-04-21 18:27:30 -05:00
1 parent 84c4abbd94
commit fa20631e7b
5 files changed
+106 -2

No files matched your search

+24
View File
@@ -18,6 +18,17 @@
#include "Skybox.h"
#include "Rigidbody.h"
#include "CollisionShape.h"
struct RaycastResult {
bool hit;
Vector3 position;
Vector3 normal;
Rigidbody *object;
};
class World {
public:
static World* GetWorld();
RaycastResult Raycast(const Vector3 &from, const Vector3 &to);
};
%}
class Vector3 {
@@ -37,6 +48,19 @@ public:
}
%ignore "Vector3";
struct RaycastResult {
bool hit;
Vector3 position;
Vector3 normal;
Rigidbody *object;
};
class World {
public:
static World* GetWorld();
RaycastResult Raycast(const Vector3 &from, const Vector3 &to);
};
%include "types.h"
%include "constants.h"
%include "Node.h"