Skip to content

Instantly share code, notes, and snippets.

View chuwilliamson's full-sized avatar
:octocat:

Matthew Williamson chuwilliamson

:octocat:
View GitHub Profile
/// <summary>
/// Check points in this list for slope
/// uses dot product for clarity
/// points must be in order to form lines
/// </summary>
/// <param name="points">points to check</param>
/// <returns>points with slope</returns>
List<Vector3> PointsWithNoSlope(List<Vector3> points)
{
var result = new List<Vector3>();
@chuwilliamson
chuwilliamson / pointinrect.py
Created April 12, 2019 14:01
Write a function that will validate whether a point is inside of a rectangle. The design of the implementation is yours however you must justify why you made that decision. FYI: This will be something you use later, a lot . Pm for example.
class Rect(object):
def __init__(self, x, y , width, height):
'''thestuff'''
def Contains(self, point):
return point.'''thestuff'''
#pragma once
#include "Application.h"
#include <Renderer2D.h>
class RPG_Application : public aie::Application
{
public:
RPG_Application();
virtual ~RPG_Application();
bool startup() override;
@chuwilliamson
chuwilliamson / Texture.h
Created October 10, 2018 17:03
Header for Texture class
#pragma once
#include <string>
// a class for wrapping up an opengl texture image
class Texture {
public:
enum Format : unsigned int {
// ImGui GLFW binding with OpenGL3 + shaders
// You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this.
// If you use this binding you'll need to call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), ImGui::Render() and ImGui_ImplXXXX_Shutdown().
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
// https://github.com/ocornut/imgui
#include <imgui.h>
#include "imgui_impl_glfw_gl3.h"
// GL_CORE/GLFW
@chuwilliamson
chuwilliamson / imgui_impl_glfw_gl3.h
Created September 13, 2018 19:13
imgui_impl_glfw_gl3.h
// ImGui GLFW binding with OpenGL3 + shaders
// You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this.
// If you use this binding you'll need to call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), ImGui::Render() and ImGui_ImplXXXX_Shutdown().
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
// https://github.com/ocornut/imgui
#pragma once
struct GLFWwindow;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
using UnityEngine.Events;
namespace Zyron
{
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(GameEventTrigger))]
public class GameEventTriggerEditor : Editor
{
private SerializedProperty _mEntriesProperty;
private GUIContent _mIconToolbarMinus;
@chuwilliamson
chuwilliamson / PlayerController.cs
Created March 7, 2018 21:00
PlayerController to move with respect to camera
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : MonoBehaviour
{
public StringVariable Horizontal;
public StringVariable Vertical;
public StringVariable Jump;
public FloatVariable Speed;
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// Sometimes, it is useful to be able to run some editor script code in a project as soon as Unity launches without requiring action from the user.
/// You can do this by applying the InitializeOnLoad attribute to a class which has a static constructor.
/// A static constructor is a function with the same name as the class, declared static and without a return type or parameters.
/// </summary>