Skip to content

Instantly share code, notes, and snippets.

View oyagci's full-sized avatar
🎯
Focusing

Oguzhan Yagci oyagci

🎯
Focusing
View GitHub Profile
@oyagci
oyagci / ComputeGunLead.cs
Created March 24, 2021 19:56 — forked from brihernandez/ComputeGunLead.cs
Computes a point for a gun to aim at in order to hit a target using linear prediction.
/// <summary>
/// Computes a point for a gun to aim at in order to hit a target using linear prediction.
/// Assumes a bullet with no gravity or drag. I.e. A bullet that maintains a constant.
/// velocity after it's been fired.
/// </summary>
public static Vector3 ComputeGunLead(Vector3 targetPos, Vector3 targetVel, Vector3 ownPos, Vector3 ownVel, float muzzleVelocity)
{
// Extremely low muzzle velocities are unlikely to ever hit. This also prevents a
// possible division by zero if the muzzle velocity is zero for whatever reason.
if (muzzleVelocity < 1f)
@oyagci
oyagci / greedyvoxelmeshing.cs
Created December 18, 2019 18:44 — forked from Vercidium/greedyvoxelmeshing
Greedy Voxel Meshing ported to C#
// Code ported from https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/
// Note this implemenetation does not support different block types or block normals
// The original author describes how to do this here: https://0fps.net/2012/07/07/meshing-minecraft-part-2/
const int CHUNK_SIZE = 32;
// These variables store the location of the chunk in the world, e.g. (0,0,0), (32,0,0), (64,0,0)
@oyagci
oyagci / chroot.sh
Created August 7, 2018 07:15 — forked from uglide/chroot.sh
Chroot to Installed system on LVM
#!/bin/bash
fdisk -lu
pvscan
vgscan
vgchange -a y
lvscan
mount /dev/ubuntu-vg/root /mnt
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
@oyagci
oyagci / _readme.md
Created January 12, 2018 23:32 — forked from pongstr/_readme.md
ExpressJS: Nested Routing