Add raycasting
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user