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
bool ccwN( sgVec2 dir1, sgVec2 dir2 ) { | |
return (dir1[0]*dir2[1] - dir2[0]*dir1[1]) > 0; | |
} | |
bool ccw( sgVec2 dir1, sgVec2 dir2 ) { | |
sgNormalizeVec2( dir1 ); | |
sgNormalizeVec2( dir2 ); | |
return ccwN(dir1,dir2); | |
} |
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.Input; | |
import luxe.Color; | |
import phoenix.geometry.CircleGeometry; | |
// NOTE: Using depth sort is reccomended, but if you want to use the | |
// zbuffer in addition (e.g. to mix with custom GL render passes) this | |
// is how to do it | |
// | |
// Add this to the 'build' section of your project.flow file |
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 <stdio.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <stdlib.h> | |
typedef struct | |
{ | |
size_t alloc_size; | |
} block_header; |
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 UnityEngine; | |
using System; | |
using System.Collections; | |
// This moves a node to follow "stepGoal" in a foot step like manner. stepGoal is | |
// typically an empty parented to your model that sits on the ground and is offset (left | |
// or right) from the center of mass. | |
// This just moves the foot, a separate IK controller is needed to follow wiht the legs |
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
#ifndef NDEBUG | |
AllocConsole(); | |
SetConsoleTitle( L"console window title" ); | |
freopen("CONOUT$", "w", stdout ); | |
#endif |
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
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/Headers/FSEvents.h | |
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
# Slow, bad K-Means image quantization. | |
# This code is in the public domain. | |
import os, sys | |
import random | |
from PIL import Image, ImageDraw | |
# Doesn't seem to get much better after this, YMMV... |
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
bool g_isMouseDown; | |
float g_mouseButtonPrevPressTime; | |
float g_mouseButtonLastPressTime; | |
Vector2 g_mouseDownPos; | |
Vector2 g_mousePos; | |
bool g_isDragging = false; | |
// Frame mouse events | |
bool _isDragStarted = false; |
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
#!/usr/bin/env python | |
# CGInclude Watcher | |
# Joel Davis (joeld42@gmail.com, @joeld42 on Twitter) | |
# | |
# Usage: Run this from a directory where you have shaders. | |
# | |
# Use at your own risk (and use an editor that properly handles | |
# open files being modified by another program). | |
# |
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
// c++ -std=c++11 thread.cpp -o thread && ./thread | |
#include <iostream> | |
#include <algorithm> | |
#include <vector> | |
#include <thread> | |
class TraceTile | |
{ | |
public: | |
int tileNum = 0; |
OlderNewer