File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed
src/client/player/systems Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ name = "server"
42
42
path = " src/server/main.rs"
43
43
44
44
[features ]
45
- default = [" chat" , " player_controller " ]
45
+ default = [" chat" ]
46
46
dynamic_linking = [" bevy/dynamic_linking" ]
47
47
48
48
# both
@@ -58,7 +58,7 @@ skip_chunk_padding = []
58
58
wireframe = []
59
59
debug_ui = []
60
60
ortho_camera = []
61
- player_controller = []
61
+ lock_player = []
62
62
physics_debug = []
63
63
raycast_debug = []
64
64
visual_debug = [" wireframe" , " physics_debug" , " raycast_debug" ]
Original file line number Diff line number Diff line change 1
1
use crate :: prelude:: * ;
2
2
3
- // const SPAWN_POINT: Vec3 = Vec3::new(0.0, 32.0, 0.0);
3
+ #[ cfg( not( feature = "lock_player" ) ) ]
4
+ const SPAWN_POINT : Vec3 = Vec3 :: new ( 0.0 , 32.0 , 0.0 ) ;
5
+ #[ cfg( feature = "lock_player" ) ]
4
6
const SPAWN_POINT : Vec3 = Vec3 :: new ( 128.0 , 96.0 , -128.0 ) ;
5
7
6
8
pub fn setup_player_camera ( mut commands : Commands ) {
@@ -48,17 +50,25 @@ pub fn setup_controller_on_area_ready_system(
48
50
} ,
49
51
ActiveEvents :: COLLISION_EVENTS ,
50
52
Velocity :: zero ( ) ,
53
+ #[ cfg ( feature = "lock_player" ) ]
51
54
RigidBody :: Fixed ,
55
+ #[ cfg ( not ( feature = "lock_player" ) ) ]
56
+ RigidBody :: Dynamic ,
52
57
Sleeping :: disabled ( ) ,
53
58
LockedAxes :: ROTATION_LOCKED ,
54
59
AdditionalMassProperties :: Mass ( 1.0 ) ,
55
60
GravityScale ( 0.0 ) ,
56
61
Ccd { enabled : true } , // Prevent clipping when going fast
57
62
Transform :: from_translation ( SPAWN_POINT ) ,
58
63
LogicalPlayer ,
64
+ #[ cfg ( not ( feature = "lock_player" ) ) ]
65
+ FpsControllerInput {
66
+ pitch : -TAU / 20.0 ,
67
+ yaw : TAU * 5.0 / 12.0 ,
68
+ ..default ( )
69
+ } ,
70
+ #[ cfg ( feature = "lock_player" ) ]
59
71
FpsControllerInput {
60
- // pitch: -TAU / 20.0,
61
- // yaw: TAU * 5.0 / 12.0,
62
72
pitch : 0.0 ,
63
73
yaw : 0.0 ,
64
74
..default ( )
You can’t perform that action at this time.
0 commit comments