Skip to content

Instantly share code, notes, and snippets.

View blewert's full-sized avatar
📖
thesis writing

Benjamin Williams blewert

📖
thesis writing
View GitHub Profile
%% Benjamin Williams <bwilliams@lincoln.ac.uk>
%% jake_charts.m (GNU Octave, not MATLAB)
%%
%% pdflatex rendering charts for our paper, 'a somatic approach to combating
%% cybersickness utilising airflow feedback'
close all
clear all

f

$$n \times (m_y / s_y)$$

SSQ sub-scales (250)

[207, 123]
[69, 38]
[136, 84]
/**
* @file ArcadeGameQuit.cs
* @author Benjamin Williams <bwilliams@lincoln.ac.uk>
*
* @license CC 3.0 <https://creativecommons.org/licenses/by-nc-nd/3.0/>
*/
using System.Collections;
using System.Collections.Generic;
using System.Linq;
%% Benjamin Williams <bwilliams@lincoln.ac.uk>
%% Get in touch if you have any questions or problems!
%% University of Lincoln Computer Science Thesis Template
% The document class -- remove [harvard] if you want
% numeric-style referencing.
\documentclass[harvard]{lincolncsthesis}
% Custom packages that you need to include
\input{preamble/packages.tex}
\def\@classname {lincolncsthesis}
\def\ifClassOption [#1]#2 {
\@ifclasswith{\@classname}{#1}{#2}{#3}
}
\def\defineThesisOption [#1] {
\ifClassOption [#1] {
\expandafter\def \csname __thesis#1\endcsname ##1{\empty}
Shader "Custom/sail-shader"
{
Properties
{
[Header(Appearance properties)]
_Color ("Color", Color) = (1,1,1,1)
_TintColor ("Tint color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
// _NoiseTex ("Noise Texture (RGB)", 2D) = "white" {}
[KeywordEnum(Normal, Toon)] _ToonShading("Shading mode", Int) = 1
@blewert
blewert / PhysXClock.cpp
Created February 15, 2019 09:01
A clock in PhysX using revolute joints + motors
//Make the minute and hour hands, the shapes
Capsule* minuteHand = new Capsule(PxTransform(PxVec3(0, 8, 0)), PxVec2(0.1f, 2));
Capsule* hourHand = new Capsule(PxTransform(PxVec3(0, 8, 0)), PxVec2(0.1f, 1));
//Turn off gravity
hourHand->Get()->setActorFlag(PxActorFlag::eDISABLE_GRAVITY, true);
minuteHand->Get()->setActorFlag(PxActorFlag::eDISABLE_GRAVITY, true);
//Add them to the scene
Add(hourHand);
@blewert
blewert / convex-mesh-pyramid.cpp
Last active February 5, 2019 08:40
Visualising local axes and velocity in PhysX 3.3.4
std::vector<PxVec3> verts = {
//
PxVec3(0, 1, 0),
PxVec3(-1, -1, 1),
PxVec3(1, -1, 1),
//
PxVec3(0, 1, 0),
PxVec3(-1, -1, 1),
@blewert
blewert / transform-extensions.md
Last active January 27, 2019 13:51
A way to get all components in a transform, including itself & children. Unity.

Unity: Find all components of a type in an object

Tired of writing out GetComponents<Blah>() and then GetComponentsInChildren<Blah>()? Well, here are two functions which do that for you.

To use it, just shove it in some file. Then, do transform.GetAllComponents<Blah>() and voila! You have all components of this type in a nice, enumerable format.

public static class TransformExtensions
{
    public static IEnumerable<T> GetAllComponents<T>(this Transform transform)
    {
@blewert
blewert / get_old_selection_idx.js
Last active November 30, 2018 16:51
Getting old selection indices using seedrandom, and hooking javascript functions
function get_old_selection_idx(seed)
{
Math.seedrandom(+seed);
return Math.floor(Math.random() * 4);
}