static int debugview = 0;
static int debugsdf = 0;
static int sv_debugcam = 0;
+static int sv_phys = 0;
+static int thirdperson = 0;
/* Components */
#include "road.h"
/* Physics */
v3f co, v, a;
v4f rot;
- float vswitch, slip_last;
+ float vswitch, slip, slip_last;
float iY; /* Yaw inertia */
int in_air;
v3f view;
v2f look_dir; /* TEMP */
+ v2f board_xy;
+ float grab;
float pitch;
m4x3f to_world, to_local;
- v3f handl_target, handr_target,
- handl, handr;
-
+ /* Opengl */
glmesh mesh;
submodel legl,
legu,
board,
torso,
wheels,
- feet;
+ foot,
+
+ /* NEW MODEL */
+ leg_r0, leg_r1, foot_r,
+ leg_l0, leg_l1, foot_l,
+ arm_r0, arm_r1, hand_r,
+ arm_l0, arm_l1, hand_l,
+ body, head;
+
+ /* Rendering */
+ m4x3f mleg_l, mknee_l, mleg_r, mknee_r, mboard;
+ m4x3f marm_l, melbow_l, marm_r, melbow_r, mbutt,
+ mfoot_l, mfoot_r;
+
+ v3f handl_target, handr_target,
+ handl, handr;
}
player;
q_m3x3( player.rot, player.to_world );
v3_copy( player.co, player.to_world[3] );
- v4f inv;
- q_inv( player.rot, inv );
- q_m3x3( inv, player.to_local );
- v3_negate( player.co, player.to_local[3] );
+ m4x3_invert_affine( player.to_world, player.to_local );
}
static int reset_player( int argc, char const *argv[] )
.persistent = 1
});
+ vg_convar_push( (struct vg_convar){
+ .name = "phys",
+ .data = &sv_phys,
+ .data_type = k_convar_dtype_i32,
+ .opt_i32 = { .min=0, .max=1, .clamp=1 },
+ .persistent = 1
+ });
+
+ vg_convar_push( (struct vg_convar){
+ .name = "thirdperson",
+ .data = &thirdperson,
+ .data_type = k_convar_dtype_i32,
+ .opt_i32 = { .min=0, .max=1, .clamp=1 },
+ .persistent = 1
+ });
+
vg_function_push( (struct vg_cmd){
.name = "reset",
.function = reset_player
player.board = *submodel_get( char_dev, "skateboard" );
player.torso = *submodel_get( char_dev, "torso" );
player.wheels = *submodel_get( char_dev, "wheels" );
- player.feet = *submodel_get( char_dev, "feet" );
+ player.foot = *submodel_get( char_dev, "foot" );
+
+ /* new model */
+ player.leg_r0 = *submodel_get( char_dev, "leg_r0" );
+ player.leg_r1 = *submodel_get( char_dev, "leg_r1" );
+ player.foot_r = *submodel_get( char_dev, "foot_r" );
+ player.leg_l0 = *submodel_get( char_dev, "leg_l0" );
+ player.leg_l1 = *submodel_get( char_dev, "leg_l1" );
+ player.foot_l = *submodel_get( char_dev, "foot_l" );
+ player.arm_r0 = *submodel_get( char_dev, "arm_r0" );
+ player.arm_r1 = *submodel_get( char_dev, "arm_r1" );
+ player.hand_r = *submodel_get( char_dev, "hand_r" );
+ player.arm_l0 = *submodel_get( char_dev, "arm_l0" );
+ player.arm_l1 = *submodel_get( char_dev, "arm_l1" );
+ player.hand_l = *submodel_get( char_dev, "hand_l" );
+ player.body = *submodel_get( char_dev, "body" );
+ player.head = *submodel_get( char_dev, "head" );
free(char_dev);
/* temp */
v3_muls( move_vel, 0.75f, move_vel );
v3_add( move_vel, player.view, player.view );
+
}
static void apply_gravity( v3f vel, float const timestep )
slip = (-vel[0] / vel[2]) * player.vswitch;
if( fabsf( slip ) > 1.2f )
slip = vg_signf( slip ) * 1.2f;
+ player.slip = slip;
-
+#if 0
if( player.slip_last*slip < 0.0f && fabsf(slip) > 0.7f )
{
vg_warn( "SWITCH\n" );
}
player.slip_last = slip;
+#endif
float substep = ktimestep * 0.2f;
player.iY -= 3.6f * ktimestep;
float steer = vg_get_axis( "horizontal" );
- player.iY -= vg_signf(steer)*powf(steer,2.0f) * 3.5f * ktimestep;
+ player.iY -= vg_signf(steer)*powf(steer,2.0f) * 1.5f * ktimestep;
}
static void player_physics_air(void)
player.iY -= vg_get_axis( "horizontal" ) * 3.6f * ktimestep;
}
+static void player_animate(void);
static void player_update(void)
{
/* temp */
+ if( freecam )
+ {
+ player_freecam();
+ return;
+ }
+
if( vg_get_axis("grabl")>0.0f)
reset_player(0,NULL);
if( vg_get_button( "forward" ) )
m3x3_mulv( player.to_world, dir, dir );
v3_muladds( player.v, dir, 5.0f * ktimestep, player.v );
}
-
float horizontal = vg_get_axis("horizontal"),
vertical = vg_get_axis("vertical");
player.joy_l[0] = vg_signf(horizontal) * powf( horizontal, 2.0f );
player.joy_l[1] = vg_signf(vertical) * powf( vertical, 2.0f );
- if( freecam )
+ /* Integrate velocity */
+ if( sv_phys )
{
- player_freecam();
- return;
+ apply_gravity( player.v, ktimestep );
+ v3_muladds( player.co, player.v, ktimestep, player.co );
}
-
- /* Integrate velocity */
- apply_gravity( player.v, ktimestep );
- v3_muladds( player.co, player.v, ktimestep, player.co );
/* Integrate inertia */
v4f rotate; v3f vup = {0.0f,1.0f,0.0f};
player_physics_ground();
/* Camera and character */
- float kheight = 1.8f,
- kleg = 0.6f;
-
- v3f head;
- head[0] = 0.0f;
- head[1] = kheight;
- head[2] = 0.0f;
-
- m4x3_mulv( player.to_world, head, head );
- v3_copy( head, player.view );
player_transform_update();
q_normalize(player.rot);
+ player_animate();
}
void vg_update(void)
/* Creating a skeleton of the player dynamically */
- v2f ac;
+ #if 0
+ player.handl_target[0] = head[0] + 0.2f;
+ player.handl_target[1] = head[1] - 0.8f*(1.0f-fabsf(slip));
+ player.handl_target[2] = head[2] + 0.2f + 0.7f*fabsf(slip);
+
+ player.handr_target[0] = head[0] + 0.2f;
+ player.handr_target[1] = head[1] - 0.8f*(1.0f-fabsf(slip));
+ player.handr_target[2] = head[2] - (0.2f + 0.7f*fabsf(slip));
+
+ if( vg_maxf(lslip,grab) > 0.5f )
+ {
+ if( player.slip < 0.0f && player.in_air )
+ {
+ player.handl_target[0] = 0.15f;
+ player.handl_target[1] = 0.1f;
+ player.handl_target[2] = 0.4f;
+ }
+ else
+ {
+ player.handr_target[0] = 0.15f;
+ player.handr_target[1] = 0.1f;
+ player.handr_target[2] = -0.4f;
+ }
+
+ if( grab > 0.5f )
+ {
+ player.handr_target[0] = -0.15f;
+ player.handr_target[1] = 0.1f;
+ player.handr_target[2] = 0.4f;
+ }
+ }
+
+ #endif
+}
+
+static void player_animate(void)
+{
+ /* Camera position */
static v3f last_vel = { 0.0f, 0.0f, 0.0f };
static v3f momentum, bob;
v3_copy( player.v, last_vel );
v3_add( momentum, player.a, momentum );
-
v3_lerp( momentum, (v3f){0.0f,0.0f,0.0f}, 0.1f, momentum );
v3f target;
momentum[1] = vg_clampf( momentum[1], -0.2f, 5.0f );
momentum[2] = vg_clampf( momentum[2], -2.0f, 2.0f );
v3_copy( momentum, target );
-
v3_lerp( bob, target, 0.2f, bob );
/* Head */
-#if 0
- float lslip = fabsf(slip); //vg_minf( 0.4f, slip );
+ float lslip = fabsf(player.slip); //vg_minf( 0.4f, slip );
- static float grab = 0.0f;
float grabt = vg_get_axis( "grabr" )*0.5f+0.5f;
- grab = vg_lerpf( grab, grabt, 0.04f );
+ player.grab = vg_lerpf( player.grab, grabt, 0.04f );
+
+ float kheight = 1.8f,
+ kleg = 0.6f;
v3f head;
- head[0] = 0.0f;//(-sinf(lslip)*0.9f * kheight) * 0.44f;
- head[1] = (0.3f + cosf(lslip)*0.5f) * kheight - grab*0.7f;
- head[2] = 0.0f;
+ head[0] = 0.0f;
+ head[1] = (0.3f+cosf(lslip)*0.5f*(1.0f-player.grab*0.7f)) * kheight;
+ head[2] = 0.0f;
v3f offset;
m3x3_mulv( player.to_local, bob, offset );
- offset[0] *= 0.25f;
+
+ offset[0] *= 0.3333f;
offset[1] *= -0.25f;
offset[2] *= 0.7f;
v3_muladds( head, offset, 0.7f, head );
+ head[1] = vg_clampf( head[1], 0.3f, kheight );
- head[1] = vg_clampf( head[1], 0.3f, 20.0f );
+ m4x3_mulv( player.to_world, head, head );
- player.handl_target[0] = head[0] + 0.2f;
- player.handl_target[1] = head[1] - 0.8f*(1.0f-fabsf(slip));
- player.handl_target[2] = head[2] + 0.2f + 0.7f*fabsf(slip);
+ v3_copy( head, player.view );
- player.handr_target[0] = head[0] + 0.2f;
- player.handr_target[1] = head[1] - 0.8f*(1.0f-fabsf(slip));
- player.handr_target[2] = head[2] - (0.2f + 0.7f*fabsf(slip));
+ /* New board transformation */
+ v4f board_rotation; v3f board_location;
+
+ /* TODO: Move this out of animate into update */
+ v2_lerp( player.board_xy, (v2f){ vg_get_axis("h1"), vg_get_axis("v1") },
+ ktimestep*3.0f, player.board_xy );
- if( vg_maxf(lslip,grab) > 0.5f )
+ v4f rz, rx;
+ q_axis_angle( rz, (v3f){ 0.0f, 0.0f, 1.0f }, player.board_xy[0] );
+ q_axis_angle( rx, (v3f){ 1.0f, 0.0f, 0.0f }, player.board_xy[1] );
+ q_mul( rx, rz, board_rotation );
+
+ q_m3x3( board_rotation, player.mboard );
+ m3x3_mulv( player.mboard, (v3f){ 0.0f, -0.5f, 0.0f }, board_location );
+ v3_add( (v3f){0.0f,0.5f,0.0f}, board_location, board_location );
+
+ m3x3_mul( player.to_world, player.mboard, player.mboard );
+ m4x3_mulv( player.to_world, board_location, player.mboard[3] );
+
+
+ /* In the air, the dude should grab with the side thats highest,
+ * while also sliding the same foot downwards a bit */
+
+ float foot_l = 0.3f,
+ foot_r = -0.4f;
+
+ player.handl_target[0] = 0.0f;
+ player.handl_target[1] = 0.0f;
+ player.handl_target[2] = 0.6f;
+
+ player.handr_target[0] = 0.0f;
+ player.handr_target[1] = 0.0f;
+ player.handr_target[2] = -0.6f;
+ if( 1||player.in_air )
{
- if( slip < 0.0f && in_air )
+ float tuck = player.board_xy[1],
+ tuck_amt = fabsf( tuck ) * (1.0f-fabsf(player.board_xy[0]));
+
+ if( tuck < 0.0f )
{
- player.handl_target[0] = 0.15f;
- player.handl_target[1] = 0.1f;
- player.handl_target[2] = 0.4f;
+ foot_l *= 1.0f-tuck_amt*1.5f;
+
+ if( player.grab > 0.1f )
+ {
+ m4x3_mulv( player.mboard, (v3f){0.1f,0.14f,0.6f},
+ player.handl_target );
+ m4x3_mulv( player.to_local,
+ player.handl_target, player.handl_target );
+ }
}
else
{
- player.handr_target[0] = 0.15f;
- player.handr_target[1] = 0.1f;
- player.handr_target[2] = -0.4f;
- }
+ foot_r *= 1.0f-tuck_amt*1.4f;
- if( grab > 0.5f )
- {
- player.handr_target[0] = -0.15f;
- player.handr_target[1] = 0.1f;
- player.handr_target[2] = 0.4f;
+ if( player.grab > 0.1f )
+ {
+ m4x3_mulv( player.mboard, (v3f){0.1f,0.14f,-0.6f},
+ player.handr_target );
+ m4x3_mulv( player.to_local,
+ player.handr_target, player.handr_target );
+ }
}
}
-#endif
-
-}
-
-static void debug_grid( v3f at )
-{
- v3f base;
- v3_floor( at, base );
-
- for( int y=0; y<16; y++ )
- {
- vg_line( (v3f){ base[0] - 8, base[1], base[2]+y-8 },
- (v3f){ base[0] + 8, base[1], base[2]+y-8 },
- 0x40ffffff );
- }
- for( int x=0; x<16; x++ )
+ else
{
- vg_line( (v3f){ base[0]+x-8, base[1], base[2]-8 },
- (v3f){ base[0]+x-8, base[1], base[2]+8 },
- 0x40ffffff );
}
-}
-static void draw_player(void)
-{
- mesh_bind( &player.mesh );
+ m3x3_copy( player.mboard, player.mfoot_l );
+ m4x3_mulv( player.mboard, (v3f){ 0.0f,0.16f,foot_l }, player.mfoot_l[3] );
+
+ m3x3_copy( player.mboard, player.mfoot_r );
+ m4x3_mulv( player.mboard, (v3f){ 0.0f,0.16f,foot_r }, player.mfoot_r[3] );
+
float const kleg_upper = 0.53f,
kleg_lower = 0.5f,
karm_ratio = 0.75f,
ik_arm_r = { .l1 = karm_upper, .l2 = karm_lower };
v3f butt, fwd;
+ v4f hip_rotation;
- m4x3_mulv( player.to_world, (v3f){ 0.0f,0.16f,-0.4f }, ik_leg_r.end );
- m4x3_mulv( player.to_world, (v3f){ 0.0f,0.16f, 0.3f }, ik_leg_l.end );
- m4x3_mulv( player.to_world, (v3f){ -0.6f,0.5f,-0.4f }, ik_leg_r.pole );
- m4x3_mulv( player.to_world, (v3f){ -0.6f,0.5f,0.35f }, ik_leg_l.pole );
-
+ /* create hip rotation */
+ q_axis_angle( hip_rotation, (v3f){0.0f,1.0f,0.0f}, sinf(vg_time) );
+ q_m3x3( hip_rotation, player.mbutt );
+ m3x3_mul( player.to_world, player.mbutt, player.mbutt );
+
+ /* offset */
m3x3_mulv( player.to_world, (v3f){ 0.2f,-0.55f,0.0f}, butt );
v3_add( butt, player.view, butt );
+ v3_copy( butt, player.mbutt[3] );
+
+ m4x3_mulv( player.mbutt, (v3f){0.0f,0.0f,-0.1f}, ik_leg_r.base );
+ m4x3_mulv( player.mbutt, (v3f){0.0f,0.0f, 0.1f}, ik_leg_l.base );
- m3x3_mulv( player.to_world, (v3f){0.0f,0.0f,-1.0f}, fwd );
- v3_muladds( butt, fwd, 0.1f, ik_leg_r.base );
- v3_muladds( butt, fwd,-0.1f, ik_leg_l.base );
+ m4x3_mulv( player.mboard, (v3f){ 0.0f,0.16f, foot_r }, ik_leg_r.end );
+ m4x3_mulv( player.mboard, (v3f){ 0.0f,0.16f, foot_l }, ik_leg_l.end );
+ m4x3_mulv( player.mboard, (v3f){ -0.6f,0.50f,-0.40f }, ik_leg_r.pole );
+ m4x3_mulv( player.mboard, (v3f){ -0.6f,0.50f, 0.35f }, ik_leg_l.pole );
/* Compute IK */
- m4x3f mleg_l, mknee_l, mleg_r, mknee_r, mboard;
-
- ik_basic( &ik_leg_r, mleg_r, mknee_r );
- ik_basic( &ik_leg_l, mleg_l, mknee_l );
+ ik_basic( &ik_leg_r, player.mleg_r, player.mknee_r );
+ ik_basic( &ik_leg_l, player.mleg_l, player.mknee_l );
/* Arms */
- v3f hl, hr, neckl = {0.2f,-0.1f, 0.2f},
- neckr = {0.2f,-0.1f,-0.2f};
+ v3f hl, hr, neckl = {0.0f, 0.5f, 0.2f},
+ neckr = {0.0f, 0.5f,-0.2f};
- v3_lerp( player.handl, player.handl_target, 0.04f, player.handl );
- v3_lerp( player.handr, player.handr_target, 0.04f, player.handr );
+ m4x3_mulv( player.mbutt, neckl, ik_arm_l.base );
+ m4x3_mulv( player.mbutt, neckr, ik_arm_r.base );
- m3x3_mulv( player.to_world, neckl, neckl );
- m3x3_mulv( player.to_world, neckr, neckr );
+ v3_lerp( player.handl, player.handl_target, 0.1f, player.handl );
+ v3_lerp( player.handr, player.handr_target, 0.1f, player.handr );
- v3_add( player.view, neckl, ik_arm_l.base );
- v3_add( player.view, neckr, ik_arm_r.base );
m4x3_mulv( player.to_world, player.handl, ik_arm_l.end );
m4x3_mulv( player.to_world, player.handr, ik_arm_r.end );
m4x3_mulv( player.to_world, (v3f){ 0.6f,0.7f, 0.4f }, ik_arm_l.pole );
m4x3_mulv( player.to_world, (v3f){ 0.6f,0.7f,-0.35f }, ik_arm_r.pole );
- m4x3f marm_l, melbow_l, marm_r, melbow_r;
- ik_basic( &ik_arm_l, marm_l, melbow_l );
- ik_basic( &ik_arm_r, marm_r, melbow_r );
- m4x3_scale( marm_l, karm_ratio );
- m4x3_scale( marm_r, karm_ratio );
- m4x3_scale( melbow_l, karm_ratio );
- m4x3_scale( melbow_r, karm_ratio );
+ ik_basic( &ik_arm_l, player.marm_l, player.melbow_l );
+ ik_basic( &ik_arm_r, player.marm_r, player.melbow_r );
+
+ if( thirdperson )
+ {
+ v3f nv;
+ v3_copy( player.v, nv );
+ v3_normalize( nv );
+ v3_muladds( player.view, nv, -3.0f, player.view );
+ }
+}
+
+static void draw_player(void)
+{
+ mesh_bind( &player.mesh );
/* Draw */
vg_tex2d_bind( &tex_grid, 0 );
glUniform4f( SHADER_UNIFORM(shader_standard_lit,"uColour"),
0.35f*kscale,0.35f*kscale,0.35f*kscale,1.0f );
- m4x3_expand( player.to_world, mat );
- glUniformMatrix4fv( kuMdl, 1, GL_FALSE, (float *)mat );
+ glUniformMatrix4x3fv( kuMdl, 1, GL_FALSE, (float *)player.mboard );
submodel_draw( &player.board );
glUniform4f( SHADER_UNIFORM(shader_standard_lit,"uColour"),
glUniform4f( SHADER_UNIFORM(shader_standard_lit,"uColour"),
0.2f*kscale,0.8f*kscale,0.4f*kscale,0.14f );
- submodel_draw( &player.feet );
+ glUniformMatrix4x3fv( kuMdl, 1, GL_FALSE, (float *)player.mfoot_l );
+ submodel_draw( &player.foot_l );
+ glUniformMatrix4x3fv( kuMdl, 1, GL_FALSE, (float *)player.mfoot_r );
+ submodel_draw( &player.foot_r );
- m4x3_expand( mleg_l, mat );
- glUniformMatrix4fv( kuMdl, 1, GL_FALSE, (float *)mat );
- submodel_draw( &player.legu );
+ glUniformMatrix4x3fv( kuMdl, 1, GL_FALSE, (float *)player.mleg_l );
+ submodel_draw( &player.leg_l0 );
- m4x3_expand( mknee_l, mat );
- glUniformMatrix4fv( kuMdl, 1, GL_FALSE, (float *)mat );
- submodel_draw( &player.legl );
+ glUniformMatrix4x3fv( kuMdl, 1, GL_FALSE, (float *)player.mknee_l );
+ submodel_draw( &player.leg_l1 );
- m4x3_expand( mleg_r, mat );
- glUniformMatrix4fv( kuMdl, 1, GL_FALSE, (float *)mat );
- submodel_draw( &player.legu );
+ glUniformMatrix4x3fv( kuMdl, 1, GL_FALSE, (float *)player.mleg_r );
+ submodel_draw( &player.leg_r0 );
- m4x3_expand( mknee_r, mat );
- glUniformMatrix4fv( kuMdl, 1, GL_FALSE, (float *)mat );
- submodel_draw( &player.legl );
+ glUniformMatrix4x3fv( kuMdl, 1, GL_FALSE, (float *)player.mknee_r );
+ submodel_draw( &player.leg_r1 );
/* arms */
- m4x3_expand( marm_l, mat );
- glUniformMatrix4fv( kuMdl, 1, GL_FALSE, (float *)mat );
- submodel_draw( &player.legu );
+ glUniformMatrix4x3fv( kuMdl, 1, GL_FALSE, (float *)player.marm_l );
+ submodel_draw( &player.arm_l0 );
- m4x3_expand( melbow_l, mat );
- glUniformMatrix4fv( kuMdl, 1, GL_FALSE, (float *)mat );
- submodel_draw( &player.legl );
+ glUniformMatrix4x3fv( kuMdl, 1, GL_FALSE, (float *)player.melbow_l );
+ submodel_draw( &player.arm_l1 );
- m4x3_expand( marm_r, mat );
- glUniformMatrix4fv( kuMdl, 1, GL_FALSE, (float *)mat );
- submodel_draw( &player.legu );
+ glUniformMatrix4x3fv( kuMdl, 1, GL_FALSE, (float *)player.marm_r );
+ submodel_draw( &player.arm_r0 );
- m4x3_expand( melbow_r, mat );
- glUniformMatrix4fv( kuMdl, 1, GL_FALSE, (float *)mat );
- submodel_draw( &player.legl );
+ glUniformMatrix4x3fv( kuMdl, 1, GL_FALSE, (float *)player.melbow_r );
+ submodel_draw( &player.arm_r1 );
/* body */
- m4x3f mbutt;
- m3x3_copy( player.to_world, mbutt );
- v3_copy( butt, mbutt[3] );
+ glUniformMatrix4x3fv( kuMdl, 1, GL_FALSE, (float *)player.mbutt );
+ submodel_draw( &player.body );
- m4x3_expand( mbutt, mat );
- glUniformMatrix4fv( kuMdl, 1, GL_FALSE, (float *)mat );
- submodel_draw( &player.torso );
+ glUniform4f( SHADER_UNIFORM(shader_standard_lit,"uColour"),
+ 0.2f*kscale,0.2f*kscale,0.2f*kscale,0.14f );
+ submodel_draw( &player.head );
glDisable(GL_BLEND);
glEnable( GL_DEPTH_TEST );
m4x4f world_4x4;
m4x3_expand( world_matrix, world_4x4 );
-
m4x4_projection( vg_pv,
freecam? 90.0f: 130.0f,
(float)vg_window_x / (float)vg_window_y,
glEnable( GL_DEPTH_TEST );
scene_foliage_shader_use();
- m4x4f temp1;
- m4x4_identity( temp1 );
- glUniformMatrix4fv( SHADER_UNIFORM( shader_debug_vcol, "uMdl" ),
+ m4x3f temp1;
+ m4x3_identity( temp1 );
+ glUniformMatrix4x3fv( SHADER_UNIFORM( shader_debug_vcol, "uMdl" ),
1, GL_FALSE, (float *)temp1 );
vg_tex2d_bind( &tex_norwey, 0 );
scene_debugsdf( &world.foliage );
SHADER_USE(shader_unlit);
- m4x4f temp2;
- m4x4_identity(temp2);
+ m4x3f temp2;
+ m4x3_identity(temp2);
//m4x4_translate( temp2, player.co );
- glUniformMatrix4fv( SHADER_UNIFORM( shader_unlit, "uMdl" ),
+ glUniformMatrix4x3fv( SHADER_UNIFORM( shader_unlit, "uMdl" ),
1, GL_FALSE, (float *)temp2 );
glUniformMatrix4fv( SHADER_UNIFORM( shader_unlit, "uPv" ),
1, GL_FALSE, (float *)vg_pv );
mesh_bind( &world.skydome );
mesh_draw( &world.skydome );
+#if 0
vg_tex2d_bind( &tex_cement, 0 );
mesh_bind( &world.cement );
mesh_draw( &world.cement );
+#endif
SHADER_USE(shader_standard_lit);
glUniformMatrix4fv( SHADER_UNIFORM( shader_standard_lit, "uPv" ),
1, GL_FALSE, (float *)vg_pv );
glUniform1i( SHADER_UNIFORM( shader_standard_lit, "uTexMain" ), 0 );
-
- glUniformMatrix4fv( SHADER_UNIFORM( shader_standard_lit, "uMdl" ),
+ glUniformMatrix4x3fv( SHADER_UNIFORM( shader_standard_lit, "uMdl" ),
1, GL_FALSE, (float *)temp1 );
vg_tex2d_bind( &tex_grid, 0 );
scene_bind( &world.geo );
-#if 0
+#if 1
glUniform4f( SHADER_UNIFORM(shader_standard_lit,"uColour"),
0.2f,0.36f,0.25f,1.0f );
submodel_draw( &world.terrain );
vg_lines_drawall( (float *)vg_pv );
/* Debugger camera */
- glViewport( 0,0, 512, 512 );
+ glViewport( 0,0, 800, 800 );
glClearColor( 0.1f, 0.0f, 0.2f, 1.0f );
glClear( GL_DEPTH_BUFFER_BIT );
if(sv_debugcam)
{
glEnable( GL_DEPTH_TEST );
+
draw_player();
}