Skip to content

Instantly share code, notes, and snippets.

View rms80's full-sized avatar

Ryan Schmidt rms80

View GitHub Profile
@rms80
rms80 / gist:771761c98dc96f17383cff63f754e2b2
Created December 9, 2016 16:20
profiling different ways to represent vector3f in C#
class vector1
{
public float x, y, z;
public vector1(float x, float y, float z) { this.x = x; this.y = y; this.z = z; }
public float this[int key]
{
get { return (key == 0) ? x : (key == 1) ? y : z; }
set { if (key == 0) x = value; else if (key == 1) y = value; else z = value; }
}
}