mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Grep for 'PHYSICSSTATE TODO'
This commit is contained in:
parent
338b377ef4
commit
50cce536b4
@ -60,8 +60,10 @@ impl CharacterBehavior for Data {
|
||||
|
||||
// If no wall is in front of character or we stopped climbing;
|
||||
let (wall_dir, climb) = if let (Some(wall_dir), Some(climb), None) = (
|
||||
// PHYSICSSTATE TODO
|
||||
data.physics.state.on_wall,
|
||||
data.inputs.climb,
|
||||
// PHYSICSSTATE TODO
|
||||
data.physics.state.on_ground,
|
||||
) {
|
||||
(wall_dir, climb)
|
||||
@ -102,6 +104,7 @@ impl CharacterBehavior for Data {
|
||||
// Smooth orientation
|
||||
data.ori.slerped_towards(
|
||||
Ori::from(ori_dir),
|
||||
// PHYSICSSTATE TODO
|
||||
if data.physics.state.on_ground.is_some() {
|
||||
9.0
|
||||
} else {
|
||||
|
@ -79,10 +79,13 @@ impl CharacterBehavior for Data {
|
||||
let mut update = StateUpdate::from(data);
|
||||
|
||||
// If player is on ground, end glide
|
||||
// PHYSICSSTATE TODO
|
||||
if data.physics.state.on_ground.is_some()
|
||||
// PHYSICSSTATE TODO
|
||||
&& (data.vel.0 - data.physics.state.ground_vel).magnitude_squared() < 2_f32.powi(2)
|
||||
{
|
||||
update.character = CharacterState::GlideWield(glide_wield::Data::from(data));
|
||||
// PHYSICSSTATE TODO
|
||||
} else if data.physics.state.in_liquid().is_some()
|
||||
|| data
|
||||
.inventory
|
||||
@ -172,6 +175,7 @@ impl CharacterBehavior for Data {
|
||||
Quaternion::rotation_3d(
|
||||
PI / 2.0
|
||||
* accel_factor
|
||||
// PHYSICSSTATE TODO
|
||||
* if data.physics.state.on_ground.is_some() {
|
||||
-1.0
|
||||
} else {
|
||||
|
@ -39,6 +39,7 @@ impl CharacterBehavior for Data {
|
||||
handle_wield(data, &mut update);
|
||||
handle_jump(data, output_events, &mut update, 1.0);
|
||||
|
||||
// PHYSICSSTATE TODO
|
||||
if !data.physics.state.skating_active {
|
||||
update.character = CharacterState::Idle(idle::Data {
|
||||
is_sneaking: false,
|
||||
|
@ -62,6 +62,7 @@ impl CharacterBehavior for Data {
|
||||
match self.static_data.movement_behavior {
|
||||
MovementBehavior::ForwardGround | MovementBehavior::Stationary => {},
|
||||
MovementBehavior::AxeHover => {
|
||||
// PHYSICSSTATE TODO
|
||||
update.movement = update.movement.with_movement(if data.physics.state.on_ground.is_some() {
|
||||
// TODO: Just remove axehover entirely with axe rework, it's really janky
|
||||
// TODO: Should 5 even be used here, or should body accel be used? Maybe just call handle_move?
|
||||
|
@ -363,6 +363,7 @@ pub fn handle_move(data: &JoinData<'_>, update: &mut StateUpdate, efficiency: f3
|
||||
fn basic_move(data: &JoinData<'_>, update: &mut StateUpdate, efficiency: f32) {
|
||||
let efficiency = efficiency * data.stats.move_speed_modifier * data.stats.friction_modifier;
|
||||
|
||||
// PHYSICSSTATE TODO
|
||||
let accel = if let Some(block) = data.physics.state.on_ground {
|
||||
// FRIC_GROUND temporarily used to normalize things around expected values
|
||||
data.body.base_accel() * block.get_traction() * block.get_friction() / FRIC_GROUND
|
||||
@ -410,6 +411,7 @@ pub fn handle_forced_movement(
|
||||
match movement {
|
||||
ForcedMovement::Forward { strength } => {
|
||||
let strength = strength * data.stats.move_speed_modifier * data.stats.friction_modifier;
|
||||
// PHYSICSSTATE TODO
|
||||
if let Some(accel) = data.physics.state.on_ground.map(|block| {
|
||||
// FRIC_GROUND temporarily used to normalize things around expected values
|
||||
data.body.base_accel() * block.get_traction() * block.get_friction() / FRIC_GROUND
|
||||
@ -475,6 +477,7 @@ pub fn handle_orientation(
|
||||
// unit is multiples of 180°
|
||||
let half_turns_per_tick = data.body.base_ori_rate()
|
||||
* efficiency
|
||||
// PHYSICSSTATE TODO
|
||||
* if data.physics.state.on_ground.is_some() {
|
||||
1.0
|
||||
} else {
|
||||
@ -580,6 +583,7 @@ pub fn fly_move(data: &JoinData<'_>, update: &mut StateUpdate, efficiency: f32)
|
||||
Density((update.density.0 + data.dt.0 * rate * change).clamp(min, max))
|
||||
};
|
||||
let def_density = ship.density().0;
|
||||
// PHYSICSSTATE TODO
|
||||
if data.physics.state.in_liquid().is_some() {
|
||||
let hull_density = ship.hull_density().0;
|
||||
update.density.0 =
|
||||
|
Loading…
Reference in New Issue
Block a user