mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Add comment to physics and replace magic number in climbing boost with a named constant, fixes #1002
This commit is contained in:
parent
680492cea6
commit
01d1089a46
@ -68,10 +68,13 @@ impl CharacterBehavior for Data {
|
|||||||
.then(|| data.body.jump_impulse())
|
.then(|| data.body.jump_impulse())
|
||||||
.flatten()
|
.flatten()
|
||||||
{
|
{
|
||||||
|
// How strong the climb boost is relative to a normal jump
|
||||||
|
const CLIMB_BOOST_JUMP_FACTOR: f32 = 0.5;
|
||||||
// They've climbed atop something, give them a boost
|
// They've climbed atop something, give them a boost
|
||||||
update
|
update.local_events.push_front(LocalEvent::Jump(
|
||||||
.local_events
|
data.entity,
|
||||||
.push_front(LocalEvent::Jump(data.entity, 0.5 * impulse / data.mass.0));
|
CLIMB_BOOST_JUMP_FACTOR * impulse / data.mass.0,
|
||||||
|
));
|
||||||
};
|
};
|
||||||
update.character = CharacterState::Idle {};
|
update.character = CharacterState::Idle {};
|
||||||
return update;
|
return update;
|
||||||
|
@ -668,6 +668,8 @@ impl<'a> PhysicsData<'a> {
|
|||||||
)
|
)
|
||||||
.join()
|
.join()
|
||||||
{
|
{
|
||||||
|
// Note: updating ori with the rest of the cache values above was attempted but
|
||||||
|
// it did not work (investigate root cause?)
|
||||||
previous_phys_cache.ori = ori.to_quat();
|
previous_phys_cache.ori = ori.to_quat();
|
||||||
}
|
}
|
||||||
drop(guard);
|
drop(guard);
|
||||||
|
Loading…
Reference in New Issue
Block a user