Skip to content

Instantly share code, notes, and snippets.

View rms80's full-sized avatar

Ryan Schmidt rms80

View GitHub Profile
@rms80
rms80 / gist:67f0a6164b701241f889dcf776530864
Created April 20, 2017 16:52
func to generate borders of HUDShapes
public static fCurveGameObject MakeBackgroundMeshBorder(HUDShape Shape, float LineWidth, Colorf LineColor)
{
if (Shape.Type == HUDShapeType.Disc) {
fCircleGameObject go = GameObjectFactory.CreateCircleGO("border", Shape.Radius, LineColor, LineWidth);
go.SetSteps(Shape.Slices);
return go;
} else if (Shape.Type == HUDShapeType.Rectangle) {
List<Vector3f> Vertices = new List<Vector3f>() {
new Vector3f(-Shape.Width / 2, 0, -Shape.Height / 2),
new Vector3f(Shape.Width / 2, 0, -Shape.Height / 2),
@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; }
}
}