mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 12:01:50 +00:00
add entities raycast
This commit is contained in:
parent
638a0d9850
commit
c17f3fec54
8 changed files with 90 additions and 15 deletions
|
|
@ -33,12 +33,13 @@ struct PlayerInput {
|
|||
bool flight : 1;
|
||||
};
|
||||
|
||||
struct BlockSelection {
|
||||
voxel vox {0, {}};
|
||||
struct CursorSelection {
|
||||
voxel vox {BLOCK_VOID, {}};
|
||||
glm::ivec3 position {};
|
||||
glm::ivec3 actualPosition {};
|
||||
glm::ivec3 normal {};
|
||||
glm::vec3 hitPosition;
|
||||
entityid_t entity = ENTITY_NONE;
|
||||
};
|
||||
|
||||
class Player : public Object, public Serializable {
|
||||
|
|
@ -56,7 +57,7 @@ public:
|
|||
std::shared_ptr<Camera> currentCamera;
|
||||
bool debug = false;
|
||||
glm::vec3 cam {};
|
||||
BlockSelection selection {};
|
||||
CursorSelection selection {};
|
||||
|
||||
Player(Level* level, glm::vec3 position, float speed,
|
||||
std::shared_ptr<Inventory> inv, entityid_t eid);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue