Subastra
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Enumerations | Functions
entity.h File Reference
#include "../defs.h"
#include "../mat4.h"
#include "../rendering/context.h"
#include "../rendering/instances.h"
#include "../vec2i.h"
#include "construct.h"
Include dependency graph for entity.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  entity_t
 

Macros

#define ENTITY_ID_IDENTITY_MASK   ((entity_id_t)0x000FFFFFFFFFFFFF)
 
#define CONSTRUCT_MAXIMUM_COMPONENTS   255
 

Typedefs

typedef u64 entity_id_t
 
typedef entity_kind_t entity_kind_mask_t
 
typedef struct entity_t entity_t
 

Enumerations

enum  entity_kind_t {
  ENTITY_KIND_MASK_EMPTY = 0 , ENTITY_KIND_TOMBSTONE = 0 , ENTITY_KIND_CONSTRUCT = 0b1 , ENTITY_KIND_CAMERA = 0b10 ,
  ENTITY_KIND_count = 3
}
 

Functions

static u32 entity_id_get_generation (entity_id_t id)
 
static u64 entity_id_get_identity (entity_id_t id)
 
static u64 entity_id_new (u32 gen, u64 id)
 
static void entity_init_construct (entity_t *entity, allocator_t alloc, vec2i chunk_relative, vec2 chunk_local)
 
static void entity_construct_add_block (entity_t *entity, vec2i at, block_t block)
 
static void entity_init_camera (entity_t *entity, allocator_t alloc, vec2i chunk_relative, vec2 chunk_local, float scale)
 
static mat4 entity_camera_calculate_projection (const rendering_ctx_t *ctx, const entity_t *entity)
 

Macro Definition Documentation

◆ CONSTRUCT_MAXIMUM_COMPONENTS

#define CONSTRUCT_MAXIMUM_COMPONENTS   255

◆ ENTITY_ID_IDENTITY_MASK

#define ENTITY_ID_IDENTITY_MASK   ((entity_id_t)0x000FFFFFFFFFFFFF)

Typedef Documentation

◆ entity_id_t

typedef u64 entity_id_t

◆ entity_kind_mask_t

◆ entity_t

typedef struct entity_t entity_t

Enumeration Type Documentation

◆ entity_kind_t

Enumerator
ENTITY_KIND_MASK_EMPTY 
ENTITY_KIND_TOMBSTONE 
ENTITY_KIND_CONSTRUCT 
ENTITY_KIND_CAMERA 
ENTITY_KIND_count 

Function Documentation

◆ entity_camera_calculate_projection()

static mat4 entity_camera_calculate_projection ( const rendering_ctx_t ctx,
const entity_t entity 
)
static

◆ entity_construct_add_block()

static void entity_construct_add_block ( entity_t entity,
vec2i  at,
block_t  block 
)
static

◆ entity_id_get_generation()

static u32 entity_id_get_generation ( entity_id_t  id)
static

◆ entity_id_get_identity()

static u64 entity_id_get_identity ( entity_id_t  id)
static

◆ entity_id_new()

static u64 entity_id_new ( u32  gen,
u64  id 
)
static

◆ entity_init_camera()

static void entity_init_camera ( entity_t entity,
allocator_t  alloc,
vec2i  chunk_relative,
vec2  chunk_local,
float  scale 
)
static

◆ entity_init_construct()

static void entity_init_construct ( entity_t entity,
allocator_t  alloc,
vec2i  chunk_relative,
vec2  chunk_local 
)
static