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
import haxe.macro.Expr; | |
import haxe.macro.Context; | |
import haxe.macro.Type; | |
import haxe.macro.TypeTools; | |
import haxe.macro.MacroStringTools; | |
class FunctionFinder { | |
macro public static function get_functions(e:Expr, fun_signature:Expr) { | |
var function_type:Type = switch(fun_signature.expr) { | |
case EConst(c): |
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
hex_abc = '0123456789abcdef' | |
function to_hex(num) | |
local str = '' | |
for i=0,7 do --8 packs of 4 bits for 32 bit number | |
local digit = num | |
local shift = (i - 4)*4 | |
if shift < 0 then digit = shl(digit, -shift) | |
else digit = shr(digit, shift) end |
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
import luxe.GameConfig; | |
import luxe.Input; | |
import luxe.Vector; | |
class Main extends luxe.Game { | |
//--- The actual important stuff -- | |
var verts:Array<Vector>; //Holds the '3D model' vertices, i.e. actual 3D coordinates |
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
import luxe.GameConfig; | |
import luxe.Input; | |
import luxe.Vector; | |
class Main extends luxe.Game { | |
//--- The actual important stuff -- | |
var verts:Array<Vector>; //Holds the '3D model' vertices, i.e. actual 3D coordinates |
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
// Just position and velocity along one dimension. We're assuming the particle has a mass of 1. | |
#[derive(Clone)] | |
struct State { | |
x: f64, | |
v: f64, | |
} | |
trait Integrator { | |
fn step(&mut self, state: State, sim: &Simulation, dt: f64) -> State; |
OlderNewer