Skip to content

Instantly share code, notes, and snippets.

View fesoliveira014's full-sized avatar

Felipe Santos fesoliveira014

View GitHub Profile
@fesoliveira014
fesoliveira014 / substance.c
Last active August 18, 2017 20:24
Substance problem
#include <stdio.h>
#include <malloc.h>
#define MAX_SIZE 500
#define MIN_SIZE 10
#define MAX_SUBS 300
struct list_t
{
int nodes[MAX_SUBS];
private IEnumerator UpdateChunks(){
for (int i = 1; i < VIEW_RANGE; i += ChunkWidth) {
float vr = i;
for (float x = transform.position.x - vr; x < transform.position.x + vr; x += ChunkWidth) {
for (float z = transform.position.z - vr; z < transform.position.z + vr; z += ChunkWidth) {
_pos.Set(x, 0, z); // no y, yet
_pos.x = Mathf.Floor(_pos.x/ChunkWidth)*ChunkWidth;
_pos.z = Mathf.Floor(_pos.z/ChunkWidth)*ChunkWidth;
/**
markdeep.js
Version 0.10
Copyright 2015-2016, Morgan McGuire, http://casual-effects.com
All rights reserved.
-------------------------------------------------------------
See http://casual-effects.com/markdeep for documentation on how to