Skip to content

Instantly share code, notes, and snippets.

View chuwilliamson's full-sized avatar
:octocat:

Matthew Williamson chuwilliamson

:octocat:
View GitHub Profile
@chuwilliamson
chuwilliamson / GridGenerator.cs
Created December 4, 2015 18:20
Grid Gen for Shelby
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class GridGenerator : MonoBehaviour
{
[SerializeField]
private GameObject _gridPrefab;
public int rows;
public int cols;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public enum SpringType
{
manhattan,
structural,
shear,
bend
public bool IsColliding (GameObject a, GameObject b)
{
Vector3 minA = a.GetComponent<AABB> ().Min;
Vector3 maxA = a.GetComponent<AABB> ().Max;
Vector3 minB = b.GetComponent<AABB> ().Min;
Vector3 maxB = b.GetComponent<AABB> ().Max;
bool xColliding = false;
bool yColliding = false;
bool zColliding = false;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Student
{
@chuwilliamson
chuwilliamson / perlin.cpp
Last active February 3, 2024 15:23
perlinLyfe
#define GLM_FORCE_PURE
#include <vector>
#include "stdio.h"
#include <gl_core_4_4.h>
#include <GLFW/glfw3.h>
#include <glm/fwd.hpp>
#include <glm\glm.hpp>
#include <glm\ext.hpp>
#include <iostream>
#include <fstream>
#define GLM_FORCE_PURE
#include <vector>
#include "stdio.h"
#include <gl_core_4_4.h>
#include <GLFW/glfw3.h>
#include <glm/fwd.hpp>
#include <glm\glm.hpp>
#include <glm\ext.hpp>
#include <iostream>
#include <fstream>
@chuwilliamson
chuwilliamson / FSM.cs
Created February 24, 2016 15:36
FSM in c#
//written by Ryan adaire aka the boss aka commit dis aka ya boy aka holla at
using System;
using System.Linq;
using System.Collections.Generic;
using UnityEngine;
public class FSM<T>
{
private List<TransitionObject> good_transitions;
void BringTheNoise()
{
/*
To start with, we will be using glm’s perlin noise function to generate our noise instead of
implementing our own. The glm function simply takes in a vec2 and returns a float between -1 and 1.
Before just passing in our x and y we want to make some changes to them. First, we scale our point
down, in this case by 10. This is because Perlin noise always returns 0 on integer boundaries. The
Perlin noise function also returns a number between -1 and 1. For our height map we want a
number between 0 and 1 so we can later multiply it by our max height. To do this we multiply by 0.5
@chuwilliamson
chuwilliamson / Interfaces.cs
Last active February 3, 2024 15:20
interface example
using System;
using System.Collections;
using System.Collections.Generic;
public interface IDamageable
{
void TakeDamage(int totalDamage);
}
class Wall : IDamageable
using System;
using System.Collections.Generic;
public interface IDamager
{
/// <summary>
/// OUTGOING DAMAGE
/// </summary>
/// <returns>return how much damage was SENT</returns>