transfered from codeberg
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
#include "player_renderer.h"
|
||||
|
||||
#include "player.h"
|
||||
|
||||
#include "raylib.h"
|
||||
|
||||
/**
|
||||
* Renders the third-person representation of the player character,
|
||||
* including the 3D model, animations, and equipped items.
|
||||
*/
|
||||
void draw_player(struct player_struct *player) {
|
||||
highlight_block_being_watched(player);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Renders a 3D wireframe or highlight effect around the voxel
|
||||
* currently targeted by the player's view ray.
|
||||
*/
|
||||
void highlight_block_being_watched(struct player_struct *player) {
|
||||
if (player->should_highlight_block)
|
||||
{
|
||||
DrawCubeWires(player->block_being_watched, 1.02f, 1.02f, 1.02f, BLACK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
#ifndef player_renderer_h
|
||||
#define player_renderer_h
|
||||
|
||||
struct player_struct;
|
||||
|
||||
/**
|
||||
* Renders the third-person representation of the player character,
|
||||
* including the 3D model, animations, and equipped items.
|
||||
*/
|
||||
void draw_player(struct player_struct *player);
|
||||
|
||||
/**
|
||||
* Renders a 3D wireframe or highlight effect around the voxel
|
||||
* currently targeted by the player's view ray.
|
||||
*/
|
||||
void highlight_block_being_watched(struct player_struct *player);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user