Tags » Slight

Marshal an array of floats to an array of structs without copying?

Suppose I have the following code

public static class Main
{
    public struct Vec3
    {
        public float x, y, z;
    }

    public void Entry()
    {
        float[9] floats = new floats[9] { 1f, 2f, 3f, 4f, 5f, 6f, 7f, 8f, 9f };
        Vec3[3] vecs;
    }
}
… 55 more words
Recent Questions - Stack Overflow

Fastest way to determine if a 3D point is within an axis aligned cube?

Assume you are given a single 3D point to be tested and another two 3D points representing the maximum and minimum of a cube.

The obvious solution using, at worst, 6 conditional statements is as follows: 87 more words

Recent Questions - Stack Overflow