Exemplo n.º 1
0
animated_object* animated_object_new() {

  animated_object* ao = malloc(sizeof(animated_object));
  ao->position = vec3_zero();
  ao->scale = vec3_one();
  ao->rotation = quat_id();
  
  ao->renderable = asset_hndl_null();
  ao->skeleton = asset_hndl_null();
  ao->animation = asset_hndl_null();
  ao->animation_time = 0;
  
  ao->pose = NULL;
  
  return ao;
}
Exemplo n.º 2
0
ui_rectangle* ui_rectangle_new() {

    ui_rectangle* r = malloc(sizeof(ui_rectangle));

    r->top_left = vec2_new(10, 10);
    r->bottom_right = vec2_new(20, 20);
    r->color = vec4_white();
    r->glitch = 0.0;
    r->time = 0.0;

    r->texture = asset_hndl_null();
    r->texture_width = 1;
    r->texture_height = 1;
    r->texture_tile = false;

    r->border_size = 0.0;
    r->border_color = vec4_black();

    r->blend_src = GL_SRC_ALPHA;
    r->blend_dst = GL_ONE_MINUS_SRC_ALPHA;

    r->active = true;

    return r;

}
Exemplo n.º 3
0
animated_object* animated_object_new() {

  animated_object* ao = malloc(sizeof(animated_object));
  ao->position = vec3_zero();
  ao->scale = vec3_one();
  ao->rotation = quaternion_id();
  
  ao->active = true;
  ao->recieve_shadows = true;
  ao->cast_shadows = true;
  
  ao->renderable = asset_hndl_null();
  ao->skeleton = asset_hndl_null();
  ao->animation = asset_hndl_null();
  ao->animation_time = 0;
  
  ao->pose = NULL;
  
  return ao;
}
Exemplo n.º 4
0
void vegetation_init() {
  
  blocks = malloc(X_NUM * Y_NUM * sizeof(static_object*));
  
  for(int x = 0; x < X_NUM; x++)
  for(int y = 0; y < Y_NUM; y++) {
    
    char blockname[512];
    sprintf(blockname, "vegblock_%i_%i", x, y);
    
    static_object* block = entity_new(blockname, static_object);
    block->renderable = asset_hndl_null();
    
    blocks[x + y*X_NUM] = block;
  }

}