Skip to content

Instantly share code, notes, and snippets.

{
fleece: golden
}
@Kzumueller
Kzumueller / Unity3DCameraMovement.cs
Last active August 31, 2019 14:58
Controls for a camera with 5 degrees of freedom in Unity3D
using UnityEngine;
/**
* Controls for a free-roaming camera with 5 degrees of freedom (rotation around z is disabled)
* Uses default input axes with the scroll wheel for moving up and down - Shift/Control is also a nice idea
*/
public class CameraMovement : MonoBehaviour
{
/** absolute rotations kept separately from the attached GameObject */
private float rotationX = 0f;
@Kzumueller
Kzumueller / NoClue.php
Created April 10, 2018 09:36
Nope, we don't know what to do here either
/**
* @param string $key
*
* @return bool
*/
public function isValidOrderKey($key)
{
return true;
//TODO: ???
/*if(in_array($key,$this->validOrderKeys)) {
@Kzumueller
Kzumueller / shortcuts.js
Last active March 18, 2018 19:55
Pure JS DOMLand shortcuts
// this is some vile monkey patching, think of it what you will, I find it useful
if('undefined' === typeof window.qs) {
window.qs = document.querySelector.bind(document);
}
if('undefined' === typeof window.qsa) {
window.qsa = document.querySelectorAll.bind(document);
}
@Kzumueller
Kzumueller / rotationByMouseMovement.js
Last active March 5, 2020 12:04
Calculating the angle for rotating an Element around its center
//module ...
/**
* rotates rotationTarget around its center point depending on the mouse position
* CTRL key must be pressed
*
* trigonometry powers, activate!
*
* @param event MouseEvent
*/