Render a hand
This commit is contained in:
@@ -333,6 +333,21 @@ export function begin_mode_3d(new_camera: Camera) {
|
||||
write_mvp();
|
||||
}
|
||||
|
||||
// 3d drawing in front of the camera instead of in the world, for the item in the player's hand: x right, y up, looking
|
||||
// down -z. depth is cleared first, so it's never hidden inside a wall, like minecraft's first person hand
|
||||
export function begin_view_model(fov: number) {
|
||||
flush_batch();
|
||||
if (pass) {
|
||||
pass.end();
|
||||
pass = undefined;
|
||||
}
|
||||
pending_depth_clear = true;
|
||||
|
||||
mode3d = true;
|
||||
mat4.perspectiveZO(mvp, fov, canvas.width / canvas.height, 0.01, 10);
|
||||
write_mvp();
|
||||
}
|
||||
|
||||
export function end_mode_3d() {
|
||||
if (!mode3d) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user