mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 04:21:50 +00:00
fix: incomplete size transform support by entities
This commit is contained in:
parent
1d56d83b72
commit
fefc975832
7 changed files with 53 additions and 26 deletions
|
|
@ -52,6 +52,7 @@ struct Hitbox {
|
|||
glm::vec3 position;
|
||||
glm::vec3 halfsize;
|
||||
glm::vec3 velocity;
|
||||
glm::vec3 scale {1.0f, 1.0f, 1.0f};
|
||||
float linearDamping = 0.5;
|
||||
float friction = 1.0f;
|
||||
float verticalDamping = 1.0f;
|
||||
|
|
@ -64,4 +65,8 @@ struct Hitbox {
|
|||
AABB getAABB() const {
|
||||
return AABB(position-halfsize, position+halfsize);
|
||||
}
|
||||
|
||||
glm::vec3 getHalfSize() const {
|
||||
return halfsize * scale;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue