Fix getting stuck when sliding and wrong capsule transform upon rotation
This commit is contained in:
parent
ccc275c0f6
commit
441503234e
@ -21,7 +21,7 @@ void game::Entity::Move(glm::vec3& velocity, float dt)
|
|||||||
{
|
{
|
||||||
glm::vec3 u = velocity * dt; // Calculate the movement vector
|
glm::vec3 u = velocity * dt; // Calculate the movement vector
|
||||||
|
|
||||||
const int MAX_ITERS = 4;
|
const int MAX_ITERS = 16;
|
||||||
for (size_t i = 0; i < MAX_ITERS && glm::dot(u, u) > 0.0f; ++i)
|
for (size_t i = 0; i < MAX_ITERS && glm::dot(u, u) > 0.0f; ++i)
|
||||||
{
|
{
|
||||||
//printf("Entity::Move: Iteration %zu, u = (%f, %f, %f)\n", i, u.x, u.y, u.z);
|
//printf("Entity::Move: Iteration %zu, u = (%f, %f, %f)\n", i, u.x, u.y, u.z);
|
||||||
@ -177,7 +177,7 @@ bool game::EntityOccurrence::Sweep(const glm::vec3& target_position, float& hit_
|
|||||||
|
|
||||||
return sector_->SweepCapsule(
|
return sector_->SweepCapsule(
|
||||||
bt_capsule_,
|
bt_capsule_,
|
||||||
normal_basis_,
|
inv_normal_basis_,
|
||||||
position_,
|
position_,
|
||||||
target_position,
|
target_position,
|
||||||
hit_fraction,
|
hit_fraction,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user