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())
|
||||
.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
|
||||
update
|
||||
.local_events
|
||||
.push_front(LocalEvent::Jump(data.entity, 0.5 * impulse / data.mass.0));
|
||||
update.local_events.push_front(LocalEvent::Jump(
|
||||
data.entity,
|
||||
CLIMB_BOOST_JUMP_FACTOR * impulse / data.mass.0,
|
||||
));
|
||||
};
|
||||
update.character = CharacterState::Idle {};
|
||||
return update;
|
||||
|
@ -668,6 +668,8 @@ impl<'a> PhysicsData<'a> {
|
||||
)
|
||||
.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();
|
||||
}
|
||||
drop(guard);
|
||||
|
Loading…
Reference in New Issue
Block a user