This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Option<T> = { | |
label: string; | |
value: T; | |
} | |
type Options<T> = | |
| Record<string, T> | |
| Option<T>[] | |
| (() => Option<T>[]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function SingleWorkerExample(data, param1, param2) { | |
return new Promise(resolve => { | |
const blobURL = URL.createObjectURL(new Blob(['(', function() { | |
onmessage = e => { | |
const { data, param1, param2 } = e.data; | |
// Do work with data which is a SharedArrayBuffer | |
postMessage('done'); | |
}; | |
}.toString(), ')()'], { type: 'application/javascript' })); | |
const worker = new Worker(blobURL); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cbuffer worldMatrix : register(b0) | |
{ | |
matrix worldmat; | |
}; | |
cbuffer viewMatrix : register(b1) | |
{ | |
matrix viewmat; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <vector> | |
#include <cmath> | |
#include "Vector2.hpp" | |
namespace IntersectionFunctions | |
{ | |
struct IntersectionObject |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace FreeListClass | |
{ | |
public class FreeList<T> | |
{ | |
private class FreeListItem<T> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See the paper "Implementation of a method for hydraulic erosion" by Hans Theobald Beyer (http://www.firespark.de/resources/downloads/implementation%20of%20a%20methode%20for%20hydraulic%20erosion.pdf) which has examples for all the parameter values | |
// particleCount number of particles to drop on the terrain | |
// particleInertia 0 to 1 defines how much changes in the gradient change the direction of the particle. Values near 0.1 work best | |
// particleCapacity 0 to 100 ish, defines how much sediment each particle can hold onto. Larger values erodes mountains more | |
// particleDeposition 0 to 1 limits the sediment that is dropped if the sediment carried by the drop exceeds the drops carry capacity | |
// particleErosion 0 to 1 determines how much of the free capacity of a drop is filled with sediment in case of erosion | |
// particleEvaporation 0 to 1 defines how fast the particle's waterAmount decreases. Values less than 0.1 work best | |
// particleRadius, 1 to 10 ish Used during erosion to decide how far away from the part |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Log.hpp" | |
Section::Section(const char* name) : Name(name) | |
{ | |
} | |
LogProxy::LogProxy(const char* level) : message(new std::stringstream) | |
{ | |
*message << level; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A binary bit-based writer and reader designed for packets. | |
* @class | |
*/ | |
export class Packet { | |
/** | |
* The byte buffer for the packet. | |
*/ | |
#buffer:[]<uint32> | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Log.hpp" | |
#include <windows.h> | |
Section::Section(const char* name) : Name(name) | |
{ | |
} | |
LogProxy::LogProxy(const char* level) : message(new std::stringstream) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <var>A binary bit-based writer and reader used for packets.</var> | |
var Packet = | |
{ | |
Create: function() | |
{ | |
/// <signature> | |
/// <summary>Constructor.</summary> | |
/// <returns type="Packet" /> | |
/// </signature> | |
/// <signature> |