transfered from codeberg
This commit is contained in:
25
source_code/renderers_module/chunk_renderer/chunk_renderer.c
Normal file
25
source_code/renderers_module/chunk_renderer/chunk_renderer.c
Normal file
@@ -0,0 +1,25 @@
|
||||
#include "chunk_renderer.h"
|
||||
|
||||
#include "chunk.h"
|
||||
#include "chunk_position_to_vector_3/chunk_position_to_vector_3.h"
|
||||
#include "frustum.h"
|
||||
|
||||
#include "raylib.h"
|
||||
|
||||
|
||||
/**
|
||||
* Renders a single chunk to the screen, performing frustum culling
|
||||
* using the provided array of clipping planes.
|
||||
*/
|
||||
void draw_chunk(struct chunk_struct* chunk,
|
||||
const struct frustum_plane_struct* frustum)
|
||||
{
|
||||
if (!is_axis_aligned_bounding_box_in_frustum(frustum, chunk->bounds))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
DrawModel(chunk->model, chunk_position_to_vector_3(chunk->position), 1.0f, WHITE);
|
||||
}
|
||||
|
||||
|
||||
14
source_code/renderers_module/chunk_renderer/chunk_renderer.h
Normal file
14
source_code/renderers_module/chunk_renderer/chunk_renderer.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#ifndef chunk_renderer_h
|
||||
#define chunk_renderer_h
|
||||
|
||||
struct chunk_struct;
|
||||
struct frustum_plane_struct;
|
||||
|
||||
/**
|
||||
* Renders a single chunk to the screen, performing frustum culling
|
||||
* using the provided array of clipping planes.
|
||||
*/
|
||||
void draw_chunk(struct chunk_struct* chunk,
|
||||
const struct frustum_plane_struct* frustum_planes);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user