wider terrain
This commit is contained in:
parent
a092c10017
commit
6b8564cb0c
4 changed files with 10 additions and 8 deletions
BIN
game/client
BIN
game/client
Binary file not shown.
|
|
@ -181,7 +181,7 @@ float get_terrain_height(float x, float z) {
|
||||||
return height * 6.0f + 2.0f;
|
return height * 6.0f + 2.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define TERRAIN_SIZE 128
|
#define TERRAIN_SIZE 256
|
||||||
#define TERRAIN_SCALE 1.0f
|
#define TERRAIN_SCALE 1.0f
|
||||||
|
|
||||||
static Mesh generate_terrain_mesh(void) {
|
static Mesh generate_terrain_mesh(void) {
|
||||||
|
|
@ -854,6 +854,8 @@ int main(void) {
|
||||||
if (IsKeyDown(KEY_S))
|
if (IsKeyDown(KEY_S))
|
||||||
moveZ -= 1.0f;
|
moveZ -= 1.0f;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
uint8_t buttons = 0;
|
uint8_t buttons = 0;
|
||||||
if (IsKeyPressed(KEY_ONE))
|
if (IsKeyPressed(KEY_ONE))
|
||||||
buttons |= BTN_SWITCH_PISTOL;
|
buttons |= BTN_SWITCH_PISTOL;
|
||||||
|
|
|
||||||
BIN
game/server
BIN
game/server
Binary file not shown.
|
|
@ -28,7 +28,7 @@ typedef int socklen_t;
|
||||||
#define MAX_PLAYERS 16
|
#define MAX_PLAYERS 16
|
||||||
#define USERNAME_MAX 16
|
#define USERNAME_MAX 16
|
||||||
|
|
||||||
#define TICK_HZ 60
|
#define TICK_HZ 30
|
||||||
#define DT (1.0f / (float)TICK_HZ)
|
#define DT (1.0f / (float)TICK_HZ)
|
||||||
|
|
||||||
#define WEAPON_PISTOL 0
|
#define WEAPON_PISTOL 0
|
||||||
|
|
@ -147,7 +147,7 @@ float get_terrain_height(float x, float z) {
|
||||||
return height * 5.0f + 2.0f;
|
return height * 5.0f + 2.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define TERRAIN_SIZE 128
|
#define TERRAIN_SIZE 256
|
||||||
#define TERRAIN_SCALE 1.0f
|
#define TERRAIN_SCALE 1.0f
|
||||||
static dReal *gHeightData = NULL;
|
static dReal *gHeightData = NULL;
|
||||||
static dGeomID gTerrainGeom = NULL;
|
static dGeomID gTerrainGeom = NULL;
|
||||||
|
|
@ -816,7 +816,7 @@ int main(void) {
|
||||||
dz /= len;
|
dz /= len;
|
||||||
}
|
}
|
||||||
|
|
||||||
float speed = 6.0f;
|
float speed = 10.0f;
|
||||||
float fx = sinf(p->yaw) * dz - cosf(p->yaw) * dx;
|
float fx = sinf(p->yaw) * dz - cosf(p->yaw) * dx;
|
||||||
float fz = cosf(p->yaw) * dz + sinf(p->yaw) * dx;
|
float fz = cosf(p->yaw) * dz + sinf(p->yaw) * dx;
|
||||||
dBodySetLinearVel(p->body, fx * speed, lvel[1], fz * speed);
|
dBodySetLinearVel(p->body, fx * speed, lvel[1], fz * speed);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue