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.io.Bytes; | |
class BytesUtil { | |
/** | |
* Represent a Bytes object as single bits in a string | |
* @param b The bytes | |
* @return A string of '0's and '1's representing the bytes | |
*/ | |
public static function toBits(b:Bytes):String { | |
var s:String = ""; |
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
package; | |
import luxe.Mesh; | |
import haxe.io.StringInput; | |
import luxe.options.MeshOptions; | |
import luxe.Vector; | |
import phoenix.Batcher; | |
import phoenix.geometry.Geometry; | |
import PlyParser; | |
import phoenix.geometry.Vertex; | |
/** |
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 screenShape = new Polygon(Polygon.rect(0, 0, Luxe.screen.w, Luxe.screen.h, true)); | |
screenShape.fluidEnabled = true; | |
//Density of 0.3, Viscosity of 3. These are values you just have to experiment with until it feels right | |
screenShape.fluidProperties = new FluidProperties(0.3, 3); | |
//It's important to set the collisionMask (second parameter) to 0 here, | |
//so the shape doesn't collide with anything (we want everything to just move through it) | |
screenShape.filter = new InteractionFilter(1, 0); | |
//Set up a body holding the shape and add it to the space | |
var screenBody = new Body(BodyType.STATIC); |
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
/* | |
* Author: Richard Lord | |
* Copyright (c) Big Room Ventures Ltd. 2007 | |
* Version: 1.0.2 | |
* Modified and extended by Tilman Schmidt (@KeyMaster_) | |
* - Fixed key buffer size to contain enough bits for all keys | |
* - Added buffering for entity component system framework | |
* - Added keyUp and keyDown lookups | |
* | |
* Licence Agreement |
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
package ; | |
import luxe.Component; | |
import luxe.Rectangle; | |
import luxe.Vector; | |
class PhysBody { | |
public var rect:Rectangle; | |
public var vel:Vector; | |
public var acc:Vector; |
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
//Rotate the camera such that z points up and x to the right | |
var o:Quaternion = new Quaternion().setFromEuler(new Vector().set_xyz(-90, 0, 0).radians()); | |
//Rotate by Arctan(sin(45°)) (grabbed from wikipedia) around x, to get the top-down part | |
var q:Quaternion = new Quaternion().setFromEuler(new Vector().set_xyz(Math.atan(Math.sin(45 * Maths.DEG2RAD)), 0, 0)); | |
//Rotate around z by -45° to get the side-on part | |
var p:Quaternion = new Quaternion().setFromEuler(new Vector().set_xyz(0, 0, -45).radians()); | |
//Combine the rotations and apply to the camera |
OlderNewer