Skip to content

Instantly share code, notes, and snippets.

View stevewoolcock's full-sized avatar

Dead Reckoned stevewoolcock

  • Melbourne, Australia
View GitHub Profile
# Add skip-worktree flag all modified files
git ls-files --modified | tr '\012' '\000' | xargs -0 git update-index --skip-worktree
# Remove skip-worktree flags on all files
git ls-files -v | grep -i ^S | cut -c 3- | tr '\012' '\000' | xargs -0 git update-index --no-skip-worktree
@stevewoolcock
stevewoolcock / TrajectoryFunctions.cs
Last active April 13, 2022 03:48
Trajectory Functions
/// <summary>
/// Gets a position along a parabolic trajectory, given an origin and initial velocity.
/// </summary>
/// <param name="origin">The origin point.</param>
/// <param name="initialVelocity">The initial velocity.</param>
/// <param name="gravity">The gravity acceleration.</param>
/// <param name="t">The time along the curve (0...1).</param>
/// <returns>The position along the parabola at time <paramref name="t"/>.</returns>
public Vector3 Parabola(Vector3 origin, Vector3 initialVelocity, float gravity, float t)
{
@stevewoolcock
stevewoolcock / TurnSystem.cs
Created July 13, 2014 06:01
A simple roguelike turn system, very similar to that of Angband.
// A Roguelike turn system
// http://blog.deadreckoned.com/post/91616626322/havenguard-turn-system
// Requires a fast max-heap Priority Queue (I like this one: http://blog.mischel.com/2007/06/22/priority-queue-in-c/)
public class TurnEntity
{
/// <summary>
/// The delegate to execute when the object's turn is executed.
/// </summary>
public Action TurnHandler { get; set; }