crosshair wip
This commit is contained in:
parent
eda5e44d3b
commit
09333b1b62
@ -686,7 +686,8 @@ void V_TickForever(WaveLaneCtx *lane)
|
|||||||
// dimensions of our shaded texture to prevent gaps at the edge of the screen
|
// dimensions of our shaded texture to prevent gaps at the edge of the screen
|
||||||
Vec2 shade_extra_dims = VEC2(1, 1);
|
Vec2 shade_extra_dims = VEC2(1, 1);
|
||||||
|
|
||||||
f32 max_shade_aspect_ratio = 16.0 / 10.0;
|
// f32 max_shade_aspect_ratio = 16.0 / 10.0;
|
||||||
|
f32 max_shade_aspect_ratio = 4.0 / 3.0;
|
||||||
frame->shade_dims.x = P_CellsPerMeter * meters_per_camera_width;
|
frame->shade_dims.x = P_CellsPerMeter * meters_per_camera_width;
|
||||||
frame->shade_dims.y = frame->shade_dims.x / (frame->screen_dims.x / frame->screen_dims.y);
|
frame->shade_dims.y = frame->shade_dims.x / (frame->screen_dims.x / frame->screen_dims.y);
|
||||||
frame->shade_dims.y = MinF32(frame->shade_dims.y, frame->shade_dims.x / max_shade_aspect_ratio);
|
frame->shade_dims.y = MinF32(frame->shade_dims.y, frame->shade_dims.x / max_shade_aspect_ratio);
|
||||||
@ -1986,6 +1987,7 @@ void V_TickForever(WaveLaneCtx *lane)
|
|||||||
|
|
||||||
Vec2 fire_pos = MulAffineVec2(wep_pix_to_world_af, fire_ray.pos);
|
Vec2 fire_pos = MulAffineVec2(wep_pix_to_world_af, fire_ray.pos);
|
||||||
Vec2 fire_dir = NormRot(MulAffineBasisVec2(wep_pix_to_world_af, fire_ray.dir));
|
Vec2 fire_dir = NormRot(MulAffineBasisVec2(wep_pix_to_world_af, fire_ray.dir));
|
||||||
|
Vec2 look_dir = NormRot(frame->look);
|
||||||
|
|
||||||
Vec2 line_start = fire_pos;
|
Vec2 line_start = fire_pos;
|
||||||
Vec2 line_end = AddVec2(line_start, fire_dir);
|
Vec2 line_end = AddVec2(line_start, fire_dir);
|
||||||
@ -1994,9 +1996,13 @@ void V_TickForever(WaveLaneCtx *lane)
|
|||||||
// Vec2 cross = fire_pos;
|
// Vec2 cross = fire_pos;
|
||||||
// Vec2 cross = MulAffineVec2(frame->af.screen_to_world, frame->look);
|
// Vec2 cross = MulAffineVec2(frame->af.screen_to_world, frame->look);
|
||||||
|
|
||||||
Vec2 cross = AddVec2(ent->xf.t, frame->look);
|
// f32 cross_dist = 1.0;
|
||||||
|
f32 cross_dist = Vec2Len(frame->look);
|
||||||
|
|
||||||
P_DebugDrawPoint(cross, Color_Red);
|
Vec2 cross = AddVec2(fire_pos, MulVec2(look_dir, cross_dist));
|
||||||
|
|
||||||
|
// P_DebugDrawPoint(AddVec2(MulAffineVec2(frame->af.screen_to_world, MulVec2(frame->screen_dims, 0.5)), frame->look), Color_Red);
|
||||||
|
P_DebugDrawPoint(cross, Color_Green);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user