blob: c1aee9419d5596743ce10837e557665a13a59803 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
#ifndef PLAYERCONTROLLER_H
#define PLAYERCONTROLLER_H
#include "playercam.h"
#include <Godot.hpp>
#include <RigidBody.hpp>
#include <RayCast.hpp>
#include <NavigationAgent.hpp>
#include <PhysicsDirectBodyState.hpp>
#include <Label3D.hpp>
#include <SceneTree.hpp>
#include <Viewport.hpp>
#include <ClippedCamera.hpp>
namespace godot {
class PlayerController : public RigidBody {
GODOT_CLASS(PlayerController, RigidBody)
public:
String team;
int health;
Node *weapon;
Spatial *world;
Camera *cam;
float mouse_sensitivity;
float FOV;
Vector2 mouse_axis;
Spatial *head;
Spatial *neck;
RayCast *useray;
Label3D *nametag;
Vector3 velocity;
Vector3 direction;
Vector2 move_axis;
Vector3 floorspeed;
bool jumping;
bool can_jump;
NavigationAgent *nav;
float FLOOR_MAX_ANGLE;
float jump_height;
bool in_water;
float swim_speed;
float climb_speed;
bool controlling_machine;
RigidBody *machine;
bool is_player;
Spatial *ladder_m;
PhysicsDirectBodyState *player_state;
bool is_on_floor;
Vector3 floor_normal;
float acceleration;
float walk_speed;
float c_friction;
float air_control;
//public:
static void _register_methods();
PlayerController();
~PlayerController();
void _init();
void _ready();
Dictionary get_init_info();
void mp_init(Dictionary init_info);
void set_phys_transform(Transform trfrm, Vector3 lvel);
void _process(float _delta);
void initiate_use();
void set_net_owner(Variant owner_id);
void deselect_character();
void take_control_of_machine(RigidBody *slave_machine);
void lose_machine();
void _physics_process(float delta);
bool on_floor_test();
void _integrate_forces(PhysicsDirectBodyState *state);
void walk(float _delta);
void jump();
void swim(float _delta);
void enter_water();
void exit_water();
void mount_ladder(Spatial *target_ladder);
void climb_ladder(float delta);
void leave_ladder();
void damage(int dmg_amt, String _type, Array shooter, String extra);
void remove_dead_character();
void net_apply_impulse(Vector3 impulse_v);
Spatial* get_neck();
Spatial* get_head();
};
}
#endif
|