mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
Optimize parameter passing to avoid unnecessary copying
This commit is contained in:
parent
46ca1bb04a
commit
f25a425cb9
123 changed files with 578 additions and 522 deletions
|
|
@ -10,6 +10,7 @@
|
|||
#include "../items/Inventory.hpp"
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
#include <utility>
|
||||
|
||||
const float CROUCH_SPEED_MUL = 0.35f;
|
||||
const float RUN_SPEED_MUL = 1.5f;
|
||||
|
|
@ -22,7 +23,7 @@ const float JUMP_FORCE = 8.0f;
|
|||
Player::Player(glm::vec3 position, float speed, std::shared_ptr<Inventory> inv) :
|
||||
speed(speed),
|
||||
chosenSlot(0),
|
||||
inventory(inv),
|
||||
inventory(std::move(inv)),
|
||||
camera(std::make_shared<Camera>(position, glm::radians(90.0f))),
|
||||
spCamera(std::make_shared<Camera>(position, glm::radians(90.0f))),
|
||||
tpCamera(std::make_shared<Camera>(position, glm::radians(90.0f))),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue