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;
|
// If no wall is in front of character or we stopped climbing;
|
||||||
let (wall_dir, climb) = if let (Some(wall_dir), Some(climb), None) = (
|
let (wall_dir, climb) = if let (Some(wall_dir), Some(climb), None) = (
|
||||||
|
// PHYSICSSTATE TODO
|
||||||
data.physics.state.on_wall,
|
data.physics.state.on_wall,
|
||||||
data.inputs.climb,
|
data.inputs.climb,
|
||||||
|
// PHYSICSSTATE TODO
|
||||||
data.physics.state.on_ground,
|
data.physics.state.on_ground,
|
||||||
) {
|
) {
|
||||||
(wall_dir, climb)
|
(wall_dir, climb)
|
||||||
@ -102,6 +104,7 @@ impl CharacterBehavior for Data {
|
|||||||
// Smooth orientation
|
// Smooth orientation
|
||||||
data.ori.slerped_towards(
|
data.ori.slerped_towards(
|
||||||
Ori::from(ori_dir),
|
Ori::from(ori_dir),
|
||||||
|
// PHYSICSSTATE TODO
|
||||||
if data.physics.state.on_ground.is_some() {
|
if data.physics.state.on_ground.is_some() {
|
||||||
9.0
|
9.0
|
||||||
} else {
|
} else {
|
||||||
|
@ -79,10 +79,13 @@ impl CharacterBehavior for Data {
|
|||||||
let mut update = StateUpdate::from(data);
|
let mut update = StateUpdate::from(data);
|
||||||
|
|
||||||
// If player is on ground, end glide
|
// If player is on ground, end glide
|
||||||
|
// PHYSICSSTATE TODO
|
||||||
if data.physics.state.on_ground.is_some()
|
if data.physics.state.on_ground.is_some()
|
||||||
|
// PHYSICSSTATE TODO
|
||||||
&& (data.vel.0 - data.physics.state.ground_vel).magnitude_squared() < 2_f32.powi(2)
|
&& (data.vel.0 - data.physics.state.ground_vel).magnitude_squared() < 2_f32.powi(2)
|
||||||
{
|
{
|
||||||
update.character = CharacterState::GlideWield(glide_wield::Data::from(data));
|
update.character = CharacterState::GlideWield(glide_wield::Data::from(data));
|
||||||
|
// PHYSICSSTATE TODO
|
||||||
} else if data.physics.state.in_liquid().is_some()
|
} else if data.physics.state.in_liquid().is_some()
|
||||||
|| data
|
|| data
|
||||||
.inventory
|
.inventory
|
||||||
@ -172,6 +175,7 @@ impl CharacterBehavior for Data {
|
|||||||
Quaternion::rotation_3d(
|
Quaternion::rotation_3d(
|
||||||
PI / 2.0
|
PI / 2.0
|
||||||
* accel_factor
|
* accel_factor
|
||||||
|
// PHYSICSSTATE TODO
|
||||||
* if data.physics.state.on_ground.is_some() {
|
* if data.physics.state.on_ground.is_some() {
|
||||||
-1.0
|
-1.0
|
||||||
} else {
|
} else {
|
||||||
|
@ -39,6 +39,7 @@ impl CharacterBehavior for Data {
|
|||||||
handle_wield(data, &mut update);
|
handle_wield(data, &mut update);
|
||||||
handle_jump(data, output_events, &mut update, 1.0);
|
handle_jump(data, output_events, &mut update, 1.0);
|
||||||
|
|
||||||
|
// PHYSICSSTATE TODO
|
||||||
if !data.physics.state.skating_active {
|
if !data.physics.state.skating_active {
|
||||||
update.character = CharacterState::Idle(idle::Data {
|
update.character = CharacterState::Idle(idle::Data {
|
||||||
is_sneaking: false,
|
is_sneaking: false,
|
||||||
|
@ -62,6 +62,7 @@ impl CharacterBehavior for Data {
|
|||||||
match self.static_data.movement_behavior {
|
match self.static_data.movement_behavior {
|
||||||
MovementBehavior::ForwardGround | MovementBehavior::Stationary => {},
|
MovementBehavior::ForwardGround | MovementBehavior::Stationary => {},
|
||||||
MovementBehavior::AxeHover => {
|
MovementBehavior::AxeHover => {
|
||||||
|
// PHYSICSSTATE TODO
|
||||||
update.movement = update.movement.with_movement(if data.physics.state.on_ground.is_some() {
|
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: 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?
|
// 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) {
|
fn basic_move(data: &JoinData<'_>, update: &mut StateUpdate, efficiency: f32) {
|
||||||
let efficiency = efficiency * data.stats.move_speed_modifier * data.stats.friction_modifier;
|
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 {
|
let accel = if let Some(block) = data.physics.state.on_ground {
|
||||||
// FRIC_GROUND temporarily used to normalize things around expected values
|
// FRIC_GROUND temporarily used to normalize things around expected values
|
||||||
data.body.base_accel() * block.get_traction() * block.get_friction() / FRIC_GROUND
|
data.body.base_accel() * block.get_traction() * block.get_friction() / FRIC_GROUND
|
||||||
@ -410,6 +411,7 @@ pub fn handle_forced_movement(
|
|||||||
match movement {
|
match movement {
|
||||||
ForcedMovement::Forward { strength } => {
|
ForcedMovement::Forward { strength } => {
|
||||||
let strength = strength * data.stats.move_speed_modifier * data.stats.friction_modifier;
|
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| {
|
if let Some(accel) = data.physics.state.on_ground.map(|block| {
|
||||||
// FRIC_GROUND temporarily used to normalize things around expected values
|
// FRIC_GROUND temporarily used to normalize things around expected values
|
||||||
data.body.base_accel() * block.get_traction() * block.get_friction() / FRIC_GROUND
|
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°
|
// unit is multiples of 180°
|
||||||
let half_turns_per_tick = data.body.base_ori_rate()
|
let half_turns_per_tick = data.body.base_ori_rate()
|
||||||
* efficiency
|
* efficiency
|
||||||
|
// PHYSICSSTATE TODO
|
||||||
* if data.physics.state.on_ground.is_some() {
|
* if data.physics.state.on_ground.is_some() {
|
||||||
1.0
|
1.0
|
||||||
} else {
|
} 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))
|
Density((update.density.0 + data.dt.0 * rate * change).clamp(min, max))
|
||||||
};
|
};
|
||||||
let def_density = ship.density().0;
|
let def_density = ship.density().0;
|
||||||
|
// PHYSICSSTATE TODO
|
||||||
if data.physics.state.in_liquid().is_some() {
|
if data.physics.state.in_liquid().is_some() {
|
||||||
let hull_density = ship.hull_density().0;
|
let hull_density = ship.hull_density().0;
|
||||||
update.density.0 =
|
update.density.0 =
|
||||||
|
Loading…
Reference in New Issue
Block a user