Skip to content

Instantly share code, notes, and snippets.

View xj42's full-sized avatar

Drew Bell xj42

View GitHub Profile
@xj42
xj42 / Conky
Last active April 25, 2019 14:12
-----------------------------------------------------------------------------
-- conkyrc
-- Date : 04/26/2019
-- Author : Drew
-- Conky : >= 1.10
-- License : Distributed under the terms of GNU GPL version 2 or later
-----------------------------------------------------------------------------
conky.config = {
background = true,
/*
* I needed to counter sensor drift on the device input camera control. I did it using cordova-plugin-gyroscope as a trigger.
* This helps to stop the camera moving when the device isn't moving.
*
*/
import { Quaternion, ICameraInput, CameraInputTypes, Tools, Nullable } from 'babylonjs';
import { UserDeviceOrientationCamera } from './babylon.userdeviceOrientationCamera';
/**
* Takes information about the orientation of the device as reported by the deviceorientation event to orient the camera.
@xj42
xj42 / UserDeviceOrientationCamera.ts
Last active May 31, 2018 01:24
Extending a babylonJS Camera
/*
* I needed to add a function to a camera, so i copied a camera from babylonjs source and added the functionality i needed.
*/
import { Quaternion, FreeCamera, Vector3, Scene, Axis } from 'babylonjs';
// We're mainly based on the logic defined into the FreeCamera code
/**
* This is a camera specifically designed to react to device orientation events such as a modern mobile device
* being tilted forward or back and left or right.