Skip to content

Instantly share code, notes, and snippets.

View sylistine's full-sized avatar

Aaron Hull sylistine

  • Oculus VR
  • Seattle, WA
View GitHub Profile
// AKA'd as Lerp
// Returns the point between A and B if t is time or progress and is clamped between 0 and 1
function LinearBezier(A, B, t) : float {
return (1-t) * A +
(t) * B;
}
// Querp?
function QuadraticBezier(A, B, C, t) : float {
return (1-t) * LinearBezier(A, B, t) +
# -*- coding: utf-8 -*-
import sys
import subprocess
# 'environment variables' for the script.
# I guess you can import os.environ, but w/e
env = {"FUEL_ENV": "sandbox"}
def Execute(cmd):
print cmd
class MyClass {
str = "test string"; // not an error in babel + core-js
static x = 0; // not an error in babel + core-js
constructor() {
this.str = "test string";
this.x = 0;
console.log(this.str);
console.log(this.x);
}
class MyClass:
str = "test string" # not an error
x = 0 # not an error
def __init__(self):
print self.str
print self.x
# outside of class scope
Vector3 currentCameraPosition = cam.transform.position - (this.transform.position + lookOffset);
Vector3 currentCameraPositionXZ = new Vector3(relativeCameraPosition.x, 0, relativeCameraPosition.z);
float currentCameraPitch = Mathf.Atan2(currentCameraPosition.y, currentCameraPositionXZ.magnitude) * Mathf.Rad2Deg;
if (currentCameraPitch > maxCameraPitch)
{
// This camera is too damn high!
}
bool handlingInput = false;
void Update ()
{
if(!handlingInput)
if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began)
{
handlingInput = true;
StartCoroutine(HandleTouch());
}
class AaronBehaviour : MonoBehaviour
{
protected AudioController audio
{
get
{
return _audio;
}
}
float rayDist = 0.1;
RaycastHit hitA, hitB;
hitA = Physics.Raycast(
transform.position + transform.up * rayDist * 2,
transform.forward,
Mathf.Infinity,
layerMask
);