Skip to content

Instantly share code, notes, and snippets.

View andykorth's full-sized avatar

Andy Korth andykorth

View GitHub Profile
@andykorth
andykorth / cpConvexMoment.c
Created May 17, 2012 15:14 — forked from slembcke/cpConvexMoment.c
Convex Moment
So I see two options right now:
Idea 1:
// add a convenience method to the API
cpMakeBodyAndShape(mass, NUM_VERTS, verts){
verts = AllThatConvexHullStuff(verts);
moment = cpMomentForPoly(verts, otherNumber, mass, etc);
@andykorth
andykorth / gist:5100871
Created March 6, 2013 16:53
GLFW for C#
using System;
using System.Runtime.InteropServices;
public class GLFW {
// TODO: Obviously don't do this.
public const string GLFW_LIB = "/Users/kortham/lib/libglfw.dylib";
public static int WINDOW = 0x00010001;
@andykorth
andykorth / gist:bf8e4509402c1f090c1c
Created April 30, 2014 18:48
Live drawing of FFT data in Unity3D
public AudioSource audioSauce;
public string CurrentAudioInput = "none";
int deviceNum = 0;
void Start()
{
string[] inputDevices = new string[Microphone.devices.Length];
deviceNum = 0;
Core engine classes
90 LOM/engine/Cubemap.cs <---- derives from Texture.cs
140 LOM/engine/FullScreenEffect.cs
56 LOM/engine/GameObject.cs <---- Basic GameObject, or entity.
242 LOM/engine/GameState.cs <---- Base class game state, manage objects, time, gameloop, input, matrix
17 LOM/engine/Input.cs
104 LOM/engine/Log.cs
83 LOM/engine/Main.cs
391 LOM/engine/Material.cs <---- Materials = shader, textures, and uniforms.
148 LOM/engine/RenderQueue.cs <---- Automatic batching and depth sorting.
kortham@Turing ~/projects/PencilAndy/Pencil.Gaming$ file natives*/*
natives32-glfw2/glfw.dll: PE32 executable for MS Windows (DLL) (console) Intel 80386 32-bit
natives32-glfw2/libglfw.dylib: Mach-O dynamically linked shared library i386
natives32-glfw2/libglfw.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped
natives32-glfw2/liblua.dylib: Mach-O dynamically linked shared library i386
natives32-glfw2/liblua.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped
natives32-glfw2/libopenal.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped
natives32-glfw2/lua.dll: PE32 executable for MS Windows (DLL) (console) Intel 80386 32-bit
natives32-glfw2/openal32.dll: PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit
natives32-glfw2/wrap_oal.dll: PE32 executable for MS Windows (DLL) (GUI) Intel 80386
@andykorth
andykorth / gist:c20fe488a973e76dd410
Created October 1, 2014 21:43
Use imageconvert to make icons.
def system(cmd)
puts cmd
Kernel.system(cmd)
end
def convert(filename, size)
ext = File.extname(filename)
base = File.basename(filename, ext)
dir = File.dirname(filename)
@andykorth
andykorth / gist:510c01f9e1fad12d3779
Last active August 29, 2015 14:12
Update calls with scheduling
2014-12-31 11:37:17.688 cocos2d: animation started with frame interval: 60.00
...
2014-12-31 11:45:41.834 Update called with dt=0.016794 time=3.183816
2014-12-31 11:45:41.850 Fixed Update called with dt=0.016667 time=3.200000
2014-12-31 11:45:41.851 Scheduled selector called #31 with t=0.100000
***************
2014-12-31 11:45:41.851 Update called with dt=0.016767 time=3.200583
2014-12-31 11:45:41.867 Fixed Update called with dt=0.016667 time=3.216667
// scheduling test object:
- (void) setupScheduleCallbackTimeTest
{
// Test pausing the content node with extra parent nodes.
self.subTitle = @"Andy is cool";
CCSprite *sprite = [SchedulerTestSprite spriteWithImageNamed:@"Sprites/bird.png"];
[self.contentNode addChild:sprite];
// *********************************
Supported extensions:
GL_ARB_color_buffer_float
GL_ARB_depth_buffer_float
GL_ARB_depth_clamp
GL_ARB_depth_texture
GL_ARB_draw_buffers
GL_ARB_draw_elements_base_vertex
GL_ARB_draw_instanced
GL_ARB_fragment_program
GL_ARB_fragment_program_shadow
@andykorth
andykorth / gist:375f9d699e33e71f6718
Created March 20, 2015 18:14
Move a parent to where the children are
[MenuItem("Selection/Center on first child", false, 301)]
static void Center() {
Object[] objs = Selection.GetFiltered(typeof(GameObject), SelectionMode.Editable | SelectionMode.ExcludePrefab);
foreach (GameObject go in objs){
Transform child = go.transform.GetChild(0);
Vector3 childPos = child.position;