C#: Distance from a ray to a point

Nice little piece of code found here

public static float DistanceToLine(Ray ray, Vector3 point)
{
    return Vector3.Cross(ray.direction, point - ray.origin).magnitude;
}

 

Advertisements

Disable Cache on Google Chrome

It took a while to nail this down. There are a few plug-ins for Google Chrome but, from looking at various forum posts, they seem to be unreliable. I eventually ended up running Google Chrome with two command line options as follows: –

--disk-cache-dir=null
--disk-cache-size=0

I’ve been using this for a while now, and it seems to work quite nicely

To add command line options on Windows, look here

To add the same cache disable from within Visual Studio code, add the following to your launch.json: –

"runtimeArgs": [
    "--disk-cache-dir=null",
    "--disk-cache-size=0"
]