line ending cleanups, and define some more math stuff

This commit is contained in:
Scott Brooks 2009-07-04 03:37:44 +00:00
parent 0046a49560
commit 4a16c915d1
2 changed files with 448 additions and 409 deletions

View File

@ -60,266 +60,266 @@ vec4_t g_color_table[8] =
};
//Makro - new table; this allows for a much faster DirToByte function
vec3_t bytedirs[NUMVERTEXNORMALS] =
{
{ 1.00000000f, 0.00000000f, 0.00000000f },
{ 0.92387950f, 0.38268346f, 0.00000000f },
{ 0.70710677f, 0.70710677f, 0.00000000f },
{ 0.38268343f, 0.92387950f, 0.00000000f },
{ -0.00000004f, 1.00000000f, 0.00000000f },
{ -0.38268340f, 0.92387956f, 0.00000000f },
{ -0.70710677f, 0.70710677f, 0.00000000f },
{ -0.92387950f, 0.38268349f, 0.00000000f },
{ -1.00000000f, -0.00000009f, 0.00000000f },
{ -0.92387950f, -0.38268343f, 0.00000000f },
{ -0.70710683f, -0.70710671f, 0.00000000f },
{ -0.38268358f, -0.92387950f, 0.00000000f },
{ 0.00000001f, -1.00000000f, 0.00000000f },
{ 0.38268360f, -0.92387944f, 0.00000000f },
{ 0.70710665f, -0.70710689f, 0.00000000f },
{ 0.92387956f, -0.38268343f, 0.00000000f },
{ 0.92387950f, 0.00000000f, -0.38268346f },
{ 0.85355335f, 0.35355341f, -0.38268346f },
{ 0.65328145f, 0.65328145f, -0.38268346f },
{ 0.35355338f, 0.85355335f, -0.38268346f },
{ -0.00000004f, 0.92387950f, -0.38268346f },
{ -0.35355335f, 0.85355341f, -0.38268346f },
{ -0.65328145f, 0.65328145f, -0.38268346f },
{ -0.85355335f, 0.35355341f, -0.38268346f },
{ -0.92387950f, -0.00000008f, -0.38268346f },
{ -0.85355335f, -0.35355338f, -0.38268346f },
{ -0.65328151f, -0.65328139f, -0.38268346f },
{ -0.35355350f, -0.85355335f, -0.38268346f },
{ 0.00000001f, -0.92387950f, -0.38268346f },
{ 0.35355353f, -0.85355330f, -0.38268346f },
{ 0.65328133f, -0.65328157f, -0.38268346f },
{ 0.85355341f, -0.35355338f, -0.38268346f },
{ 0.70710677f, 0.00000000f, -0.70710677f },
{ 0.65328145f, 0.27059805f, -0.70710677f },
{ 0.49999997f, 0.49999997f, -0.70710677f },
{ 0.27059805f, 0.65328145f, -0.70710677f },
{ -0.00000003f, 0.70710677f, -0.70710677f },
{ -0.27059802f, 0.65328151f, -0.70710677f },
{ -0.49999997f, 0.49999997f, -0.70710677f },
{ -0.65328145f, 0.27059808f, -0.70710677f },
{ -0.70710677f, -0.00000006f, -0.70710677f },
{ -0.65328145f, -0.27059805f, -0.70710677f },
{ -0.50000000f, -0.49999994f, -0.70710677f },
{ -0.27059814f, -0.65328145f, -0.70710677f },
{ 0.00000001f, -0.70710677f, -0.70710677f },
{ 0.27059817f, -0.65328139f, -0.70710677f },
{ 0.49999991f, -0.50000006f, -0.70710677f },
{ 0.65328151f, -0.27059805f, -0.70710677f },
{ 0.38268343f, 0.00000000f, -0.92387950f },
{ 0.35355338f, 0.14644662f, -0.92387950f },
{ 0.27059805f, 0.27059805f, -0.92387950f },
{ 0.14644660f, 0.35355338f, -0.92387950f },
{ -0.00000002f, 0.38268343f, -0.92387950f },
{ -0.14644660f, 0.35355338f, -0.92387950f },
{ -0.27059805f, 0.27059805f, -0.92387950f },
{ -0.35355338f, 0.14644663f, -0.92387950f },
{ -0.38268343f, -0.00000003f, -0.92387950f },
{ -0.35355338f, -0.14644660f, -0.92387950f },
{ -0.27059805f, -0.27059802f, -0.92387950f },
{ -0.14644666f, -0.35355338f, -0.92387950f },
{ 0.00000000f, -0.38268343f, -0.92387950f },
{ 0.14644668f, -0.35355335f, -0.92387950f },
{ 0.27059799f, -0.27059808f, -0.92387950f },
{ 0.35355338f, -0.14644660f, -0.92387950f },
{ -0.00000004f, 0.00000000f, -1.00000000f },
{ -0.00000004f, -0.00000002f, -1.00000000f },
{ -0.00000003f, -0.00000003f, -1.00000000f },
{ -0.00000002f, -0.00000004f, -1.00000000f },
{ 0.00000000f, -0.00000004f, -1.00000000f },
{ 0.00000002f, -0.00000004f, -1.00000000f },
{ 0.00000003f, -0.00000003f, -1.00000000f },
{ 0.00000004f, -0.00000002f, -1.00000000f },
{ 0.00000004f, 0.00000000f, -1.00000000f },
{ 0.00000004f, 0.00000002f, -1.00000000f },
{ 0.00000003f, 0.00000003f, -1.00000000f },
{ 0.00000002f, 0.00000004f, -1.00000000f },
{ -0.00000000f, 0.00000004f, -1.00000000f },
{ -0.00000002f, 0.00000004f, -1.00000000f },
{ -0.00000003f, 0.00000003f, -1.00000000f },
{ -0.00000004f, 0.00000002f, -1.00000000f },
{ -0.38268340f, 0.00000000f, -0.92387956f },
{ -0.35355335f, -0.14644660f, -0.92387956f },
{ -0.27059802f, -0.27059802f, -0.92387956f },
{ -0.14644660f, -0.35355335f, -0.92387956f },
{ 0.00000002f, -0.38268340f, -0.92387956f },
{ 0.14644659f, -0.35355335f, -0.92387956f },
{ 0.27059802f, -0.27059802f, -0.92387956f },
{ 0.35355335f, -0.14644662f, -0.92387956f },
{ 0.38268340f, 0.00000003f, -0.92387956f },
{ 0.35355335f, 0.14644660f, -0.92387956f },
{ 0.27059805f, 0.27059799f, -0.92387956f },
{ 0.14644665f, 0.35355335f, -0.92387956f },
{ -0.00000000f, 0.38268340f, -0.92387956f },
{ -0.14644666f, 0.35355332f, -0.92387956f },
{ -0.27059796f, 0.27059805f, -0.92387956f },
{ -0.35355335f, 0.14644660f, -0.92387956f },
{ -0.70710677f, 0.00000000f, -0.70710677f },
{ -0.65328145f, -0.27059805f, -0.70710677f },
{ -0.49999997f, -0.49999997f, -0.70710677f },
{ -0.27059805f, -0.65328145f, -0.70710677f },
{ 0.00000003f, -0.70710677f, -0.70710677f },
{ 0.27059802f, -0.65328151f, -0.70710677f },
{ 0.49999997f, -0.49999997f, -0.70710677f },
{ 0.65328145f, -0.27059808f, -0.70710677f },
{ 0.70710677f, 0.00000006f, -0.70710677f },
{ 0.65328145f, 0.27059805f, -0.70710677f },
{ 0.50000000f, 0.49999994f, -0.70710677f },
{ 0.27059814f, 0.65328145f, -0.70710677f },
{ -0.00000001f, 0.70710677f, -0.70710677f },
{ -0.27059817f, 0.65328139f, -0.70710677f },
{ -0.49999991f, 0.50000006f, -0.70710677f },
{ -0.65328151f, 0.27059805f, -0.70710677f },
{ -0.92387950f, 0.00000000f, -0.38268349f },
{ -0.85355335f, -0.35355341f, -0.38268349f },
{ -0.65328145f, -0.65328145f, -0.38268349f },
{ -0.35355338f, -0.85355335f, -0.38268349f },
{ 0.00000004f, -0.92387950f, -0.38268349f },
{ 0.35355335f, -0.85355341f, -0.38268349f },
{ 0.65328145f, -0.65328145f, -0.38268349f },
{ 0.85355335f, -0.35355341f, -0.38268349f },
{ 0.92387950f, 0.00000008f, -0.38268349f },
{ 0.85355335f, 0.35355338f, -0.38268349f },
{ 0.65328151f, 0.65328139f, -0.38268349f },
{ 0.35355350f, 0.85355335f, -0.38268349f },
{ -0.00000001f, 0.92387950f, -0.38268349f },
{ -0.35355353f, 0.85355330f, -0.38268349f },
{ -0.65328133f, 0.65328157f, -0.38268349f },
{ -0.85355341f, 0.35355338f, -0.38268349f },
{ -1.00000000f, 0.00000000f, 0.00000009f },
{ -0.92387950f, -0.38268346f, 0.00000009f },
{ -0.70710677f, -0.70710677f, 0.00000009f },
{ -0.38268343f, -0.92387950f, 0.00000009f },
{ 0.00000004f, -1.00000000f, 0.00000009f },
{ 0.38268340f, -0.92387956f, 0.00000009f },
{ 0.70710677f, -0.70710677f, 0.00000009f },
{ 0.92387950f, -0.38268349f, 0.00000009f },
{ 1.00000000f, 0.00000009f, 0.00000009f },
{ 0.92387950f, 0.38268343f, 0.00000009f },
{ 0.70710683f, 0.70710671f, 0.00000009f },
{ 0.38268358f, 0.92387950f, 0.00000009f },
{ -0.00000001f, 1.00000000f, 0.00000009f },
{ -0.38268360f, 0.92387944f, 0.00000009f },
{ -0.70710665f, 0.70710689f, 0.00000009f },
{ -0.92387956f, 0.38268343f, 0.00000009f },
{ -0.92387950f, 0.00000000f, 0.38268343f },
{ -0.85355335f, -0.35355341f, 0.38268343f },
{ -0.65328145f, -0.65328145f, 0.38268343f },
{ -0.35355338f, -0.85355335f, 0.38268343f },
{ 0.00000004f, -0.92387950f, 0.38268343f },
{ 0.35355335f, -0.85355341f, 0.38268343f },
{ 0.65328145f, -0.65328145f, 0.38268343f },
{ 0.85355335f, -0.35355341f, 0.38268343f },
{ 0.92387950f, 0.00000008f, 0.38268343f },
{ 0.85355335f, 0.35355338f, 0.38268343f },
{ 0.65328151f, 0.65328139f, 0.38268343f },
{ 0.35355350f, 0.85355335f, 0.38268343f },
{ -0.00000001f, 0.92387950f, 0.38268343f },
{ -0.35355353f, 0.85355330f, 0.38268343f },
{ -0.65328133f, 0.65328157f, 0.38268343f },
{ -0.85355341f, 0.35355338f, 0.38268343f },
{ -0.70710683f, 0.00000000f, 0.70710671f },
{ -0.65328151f, -0.27059808f, 0.70710671f },
{ -0.50000000f, -0.50000000f, 0.70710671f },
{ -0.27059805f, -0.65328151f, 0.70710671f },
{ 0.00000003f, -0.70710683f, 0.70710671f },
{ 0.27059805f, -0.65328157f, 0.70710671f },
{ 0.50000000f, -0.50000000f, 0.70710671f },
{ 0.65328151f, -0.27059811f, 0.70710671f },
{ 0.70710683f, 0.00000006f, 0.70710671f },
{ 0.65328151f, 0.27059805f, 0.70710671f },
{ 0.50000006f, 0.49999997f, 0.70710671f },
{ 0.27059817f, 0.65328151f, 0.70710671f },
{ -0.00000001f, 0.70710683f, 0.70710671f },
{ -0.27059820f, 0.65328145f, 0.70710671f },
{ -0.49999994f, 0.50000012f, 0.70710671f },
{ -0.65328157f, 0.27059805f, 0.70710671f },
{ -0.38268358f, 0.00000000f, 0.92387950f },
{ -0.35355350f, -0.14644668f, 0.92387950f },
{ -0.27059814f, -0.27059814f, 0.92387950f },
{ -0.14644666f, -0.35355350f, 0.92387950f },
{ 0.00000002f, -0.38268358f, 0.92387950f },
{ 0.14644665f, -0.35355353f, 0.92387950f },
{ 0.27059814f, -0.27059814f, 0.92387950f },
{ 0.35355350f, -0.14644669f, 0.92387950f },
{ 0.38268358f, 0.00000003f, 0.92387950f },
{ 0.35355350f, 0.14644666f, 0.92387950f },
{ 0.27059817f, 0.27059811f, 0.92387950f },
{ 0.14644672f, 0.35355350f, 0.92387950f },
{ -0.00000000f, 0.38268358f, 0.92387950f },
{ -0.14644673f, 0.35355350f, 0.92387950f },
{ -0.27059811f, 0.27059820f, 0.92387950f },
{ -0.35355353f, 0.14644666f, 0.92387950f },
{ 0.00000001f, 0.00000000f, 1.00000000f },
{ 0.00000001f, 0.00000000f, 1.00000000f },
{ 0.00000001f, 0.00000001f, 1.00000000f },
{ 0.00000000f, 0.00000001f, 1.00000000f },
{ -0.00000000f, 0.00000001f, 1.00000000f },
{ -0.00000000f, 0.00000001f, 1.00000000f },
{ -0.00000001f, 0.00000001f, 1.00000000f },
{ -0.00000001f, 0.00000000f, 1.00000000f },
{ -0.00000001f, -0.00000000f, 1.00000000f },
{ -0.00000001f, -0.00000000f, 1.00000000f },
{ -0.00000001f, -0.00000001f, 1.00000000f },
{ -0.00000000f, -0.00000001f, 1.00000000f },
{ 0.00000000f, -0.00000001f, 1.00000000f },
{ 0.00000000f, -0.00000001f, 1.00000000f },
{ 0.00000001f, -0.00000001f, 1.00000000f },
{ 0.00000001f, -0.00000000f, 1.00000000f },
{ 0.38268360f, 0.00000000f, 0.92387944f },
{ 0.35355353f, 0.14644669f, 0.92387944f },
{ 0.27059817f, 0.27059817f, 0.92387944f },
{ 0.14644668f, 0.35355353f, 0.92387944f },
{ -0.00000002f, 0.38268360f, 0.92387944f },
{ -0.14644666f, 0.35355356f, 0.92387944f },
{ -0.27059817f, 0.27059817f, 0.92387944f },
{ -0.35355353f, 0.14644669f, 0.92387944f },
{ -0.38268360f, -0.00000003f, 0.92387944f },
{ -0.35355353f, -0.14644668f, 0.92387944f },
{ -0.27059820f, -0.27059814f, 0.92387944f },
{ -0.14644673f, -0.35355353f, 0.92387944f },
{ 0.00000000f, -0.38268360f, 0.92387944f },
{ 0.14644673f, -0.35355350f, 0.92387944f },
{ 0.27059811f, -0.27059820f, 0.92387944f },
{ 0.35355356f, -0.14644668f, 0.92387944f },
{ 0.70710665f, 0.00000000f, 0.70710689f },
{ 0.65328133f, 0.27059802f, 0.70710689f },
{ 0.49999991f, 0.49999991f, 0.70710689f },
{ 0.27059799f, 0.65328133f, 0.70710689f },
{ -0.00000003f, 0.70710665f, 0.70710689f },
{ -0.27059796f, 0.65328139f, 0.70710689f },
{ -0.49999991f, 0.49999991f, 0.70710689f },
{ -0.65328133f, 0.27059802f, 0.70710689f },
{ -0.70710665f, -0.00000006f, 0.70710689f },
{ -0.65328133f, -0.27059799f, 0.70710689f },
{ -0.49999994f, -0.49999985f, 0.70710689f },
{ -0.27059811f, -0.65328133f, 0.70710689f },
{ 0.00000001f, -0.70710665f, 0.70710689f },
{ 0.27059811f, -0.65328127f, 0.70710689f },
{ 0.49999982f, -0.49999997f, 0.70710689f },
{ 0.65328139f, -0.27059799f, 0.70710689f },
{ 0.92387956f, 0.00000000f, 0.38268343f },
{ 0.85355341f, 0.35355341f, 0.38268343f },
{ 0.65328151f, 0.65328151f, 0.38268343f },
{ 0.35355338f, 0.85355341f, 0.38268343f },
{ -0.00000004f, 0.92387956f, 0.38268343f },
{ -0.35355335f, 0.85355347f, 0.38268343f },
{ -0.65328151f, 0.65328151f, 0.38268343f },
{ -0.85355341f, 0.35355344f, 0.38268343f },
{ -0.92387956f, -0.00000008f, 0.38268343f },
{ -0.85355341f, -0.35355338f, 0.38268343f },
{ -0.65328157f, -0.65328145f, 0.38268343f },
{ -0.35355353f, -0.85355341f, 0.38268343f },
{ 0.00000001f, -0.92387956f, 0.38268343f },
{ 0.35355356f, -0.85355335f, 0.38268343f },
{ 0.65328139f, -0.65328163f, 0.38268343f },
{ 0.85355347f, -0.35355338f, 0.38268343f }
};
//Makro - new table; this allows for a much faster DirToByte function
vec3_t bytedirs[NUMVERTEXNORMALS] =
{
{ 1.00000000f, 0.00000000f, 0.00000000f },
{ 0.92387950f, 0.38268346f, 0.00000000f },
{ 0.70710677f, 0.70710677f, 0.00000000f },
{ 0.38268343f, 0.92387950f, 0.00000000f },
{ -0.00000004f, 1.00000000f, 0.00000000f },
{ -0.38268340f, 0.92387956f, 0.00000000f },
{ -0.70710677f, 0.70710677f, 0.00000000f },
{ -0.92387950f, 0.38268349f, 0.00000000f },
{ -1.00000000f, -0.00000009f, 0.00000000f },
{ -0.92387950f, -0.38268343f, 0.00000000f },
{ -0.70710683f, -0.70710671f, 0.00000000f },
{ -0.38268358f, -0.92387950f, 0.00000000f },
{ 0.00000001f, -1.00000000f, 0.00000000f },
{ 0.38268360f, -0.92387944f, 0.00000000f },
{ 0.70710665f, -0.70710689f, 0.00000000f },
{ 0.92387956f, -0.38268343f, 0.00000000f },
{ 0.92387950f, 0.00000000f, -0.38268346f },
{ 0.85355335f, 0.35355341f, -0.38268346f },
{ 0.65328145f, 0.65328145f, -0.38268346f },
{ 0.35355338f, 0.85355335f, -0.38268346f },
{ -0.00000004f, 0.92387950f, -0.38268346f },
{ -0.35355335f, 0.85355341f, -0.38268346f },
{ -0.65328145f, 0.65328145f, -0.38268346f },
{ -0.85355335f, 0.35355341f, -0.38268346f },
{ -0.92387950f, -0.00000008f, -0.38268346f },
{ -0.85355335f, -0.35355338f, -0.38268346f },
{ -0.65328151f, -0.65328139f, -0.38268346f },
{ -0.35355350f, -0.85355335f, -0.38268346f },
{ 0.00000001f, -0.92387950f, -0.38268346f },
{ 0.35355353f, -0.85355330f, -0.38268346f },
{ 0.65328133f, -0.65328157f, -0.38268346f },
{ 0.85355341f, -0.35355338f, -0.38268346f },
{ 0.70710677f, 0.00000000f, -0.70710677f },
{ 0.65328145f, 0.27059805f, -0.70710677f },
{ 0.49999997f, 0.49999997f, -0.70710677f },
{ 0.27059805f, 0.65328145f, -0.70710677f },
{ -0.00000003f, 0.70710677f, -0.70710677f },
{ -0.27059802f, 0.65328151f, -0.70710677f },
{ -0.49999997f, 0.49999997f, -0.70710677f },
{ -0.65328145f, 0.27059808f, -0.70710677f },
{ -0.70710677f, -0.00000006f, -0.70710677f },
{ -0.65328145f, -0.27059805f, -0.70710677f },
{ -0.50000000f, -0.49999994f, -0.70710677f },
{ -0.27059814f, -0.65328145f, -0.70710677f },
{ 0.00000001f, -0.70710677f, -0.70710677f },
{ 0.27059817f, -0.65328139f, -0.70710677f },
{ 0.49999991f, -0.50000006f, -0.70710677f },
{ 0.65328151f, -0.27059805f, -0.70710677f },
{ 0.38268343f, 0.00000000f, -0.92387950f },
{ 0.35355338f, 0.14644662f, -0.92387950f },
{ 0.27059805f, 0.27059805f, -0.92387950f },
{ 0.14644660f, 0.35355338f, -0.92387950f },
{ -0.00000002f, 0.38268343f, -0.92387950f },
{ -0.14644660f, 0.35355338f, -0.92387950f },
{ -0.27059805f, 0.27059805f, -0.92387950f },
{ -0.35355338f, 0.14644663f, -0.92387950f },
{ -0.38268343f, -0.00000003f, -0.92387950f },
{ -0.35355338f, -0.14644660f, -0.92387950f },
{ -0.27059805f, -0.27059802f, -0.92387950f },
{ -0.14644666f, -0.35355338f, -0.92387950f },
{ 0.00000000f, -0.38268343f, -0.92387950f },
{ 0.14644668f, -0.35355335f, -0.92387950f },
{ 0.27059799f, -0.27059808f, -0.92387950f },
{ 0.35355338f, -0.14644660f, -0.92387950f },
{ -0.00000004f, 0.00000000f, -1.00000000f },
{ -0.00000004f, -0.00000002f, -1.00000000f },
{ -0.00000003f, -0.00000003f, -1.00000000f },
{ -0.00000002f, -0.00000004f, -1.00000000f },
{ 0.00000000f, -0.00000004f, -1.00000000f },
{ 0.00000002f, -0.00000004f, -1.00000000f },
{ 0.00000003f, -0.00000003f, -1.00000000f },
{ 0.00000004f, -0.00000002f, -1.00000000f },
{ 0.00000004f, 0.00000000f, -1.00000000f },
{ 0.00000004f, 0.00000002f, -1.00000000f },
{ 0.00000003f, 0.00000003f, -1.00000000f },
{ 0.00000002f, 0.00000004f, -1.00000000f },
{ -0.00000000f, 0.00000004f, -1.00000000f },
{ -0.00000002f, 0.00000004f, -1.00000000f },
{ -0.00000003f, 0.00000003f, -1.00000000f },
{ -0.00000004f, 0.00000002f, -1.00000000f },
{ -0.38268340f, 0.00000000f, -0.92387956f },
{ -0.35355335f, -0.14644660f, -0.92387956f },
{ -0.27059802f, -0.27059802f, -0.92387956f },
{ -0.14644660f, -0.35355335f, -0.92387956f },
{ 0.00000002f, -0.38268340f, -0.92387956f },
{ 0.14644659f, -0.35355335f, -0.92387956f },
{ 0.27059802f, -0.27059802f, -0.92387956f },
{ 0.35355335f, -0.14644662f, -0.92387956f },
{ 0.38268340f, 0.00000003f, -0.92387956f },
{ 0.35355335f, 0.14644660f, -0.92387956f },
{ 0.27059805f, 0.27059799f, -0.92387956f },
{ 0.14644665f, 0.35355335f, -0.92387956f },
{ -0.00000000f, 0.38268340f, -0.92387956f },
{ -0.14644666f, 0.35355332f, -0.92387956f },
{ -0.27059796f, 0.27059805f, -0.92387956f },
{ -0.35355335f, 0.14644660f, -0.92387956f },
{ -0.70710677f, 0.00000000f, -0.70710677f },
{ -0.65328145f, -0.27059805f, -0.70710677f },
{ -0.49999997f, -0.49999997f, -0.70710677f },
{ -0.27059805f, -0.65328145f, -0.70710677f },
{ 0.00000003f, -0.70710677f, -0.70710677f },
{ 0.27059802f, -0.65328151f, -0.70710677f },
{ 0.49999997f, -0.49999997f, -0.70710677f },
{ 0.65328145f, -0.27059808f, -0.70710677f },
{ 0.70710677f, 0.00000006f, -0.70710677f },
{ 0.65328145f, 0.27059805f, -0.70710677f },
{ 0.50000000f, 0.49999994f, -0.70710677f },
{ 0.27059814f, 0.65328145f, -0.70710677f },
{ -0.00000001f, 0.70710677f, -0.70710677f },
{ -0.27059817f, 0.65328139f, -0.70710677f },
{ -0.49999991f, 0.50000006f, -0.70710677f },
{ -0.65328151f, 0.27059805f, -0.70710677f },
{ -0.92387950f, 0.00000000f, -0.38268349f },
{ -0.85355335f, -0.35355341f, -0.38268349f },
{ -0.65328145f, -0.65328145f, -0.38268349f },
{ -0.35355338f, -0.85355335f, -0.38268349f },
{ 0.00000004f, -0.92387950f, -0.38268349f },
{ 0.35355335f, -0.85355341f, -0.38268349f },
{ 0.65328145f, -0.65328145f, -0.38268349f },
{ 0.85355335f, -0.35355341f, -0.38268349f },
{ 0.92387950f, 0.00000008f, -0.38268349f },
{ 0.85355335f, 0.35355338f, -0.38268349f },
{ 0.65328151f, 0.65328139f, -0.38268349f },
{ 0.35355350f, 0.85355335f, -0.38268349f },
{ -0.00000001f, 0.92387950f, -0.38268349f },
{ -0.35355353f, 0.85355330f, -0.38268349f },
{ -0.65328133f, 0.65328157f, -0.38268349f },
{ -0.85355341f, 0.35355338f, -0.38268349f },
{ -1.00000000f, 0.00000000f, 0.00000009f },
{ -0.92387950f, -0.38268346f, 0.00000009f },
{ -0.70710677f, -0.70710677f, 0.00000009f },
{ -0.38268343f, -0.92387950f, 0.00000009f },
{ 0.00000004f, -1.00000000f, 0.00000009f },
{ 0.38268340f, -0.92387956f, 0.00000009f },
{ 0.70710677f, -0.70710677f, 0.00000009f },
{ 0.92387950f, -0.38268349f, 0.00000009f },
{ 1.00000000f, 0.00000009f, 0.00000009f },
{ 0.92387950f, 0.38268343f, 0.00000009f },
{ 0.70710683f, 0.70710671f, 0.00000009f },
{ 0.38268358f, 0.92387950f, 0.00000009f },
{ -0.00000001f, 1.00000000f, 0.00000009f },
{ -0.38268360f, 0.92387944f, 0.00000009f },
{ -0.70710665f, 0.70710689f, 0.00000009f },
{ -0.92387956f, 0.38268343f, 0.00000009f },
{ -0.92387950f, 0.00000000f, 0.38268343f },
{ -0.85355335f, -0.35355341f, 0.38268343f },
{ -0.65328145f, -0.65328145f, 0.38268343f },
{ -0.35355338f, -0.85355335f, 0.38268343f },
{ 0.00000004f, -0.92387950f, 0.38268343f },
{ 0.35355335f, -0.85355341f, 0.38268343f },
{ 0.65328145f, -0.65328145f, 0.38268343f },
{ 0.85355335f, -0.35355341f, 0.38268343f },
{ 0.92387950f, 0.00000008f, 0.38268343f },
{ 0.85355335f, 0.35355338f, 0.38268343f },
{ 0.65328151f, 0.65328139f, 0.38268343f },
{ 0.35355350f, 0.85355335f, 0.38268343f },
{ -0.00000001f, 0.92387950f, 0.38268343f },
{ -0.35355353f, 0.85355330f, 0.38268343f },
{ -0.65328133f, 0.65328157f, 0.38268343f },
{ -0.85355341f, 0.35355338f, 0.38268343f },
{ -0.70710683f, 0.00000000f, 0.70710671f },
{ -0.65328151f, -0.27059808f, 0.70710671f },
{ -0.50000000f, -0.50000000f, 0.70710671f },
{ -0.27059805f, -0.65328151f, 0.70710671f },
{ 0.00000003f, -0.70710683f, 0.70710671f },
{ 0.27059805f, -0.65328157f, 0.70710671f },
{ 0.50000000f, -0.50000000f, 0.70710671f },
{ 0.65328151f, -0.27059811f, 0.70710671f },
{ 0.70710683f, 0.00000006f, 0.70710671f },
{ 0.65328151f, 0.27059805f, 0.70710671f },
{ 0.50000006f, 0.49999997f, 0.70710671f },
{ 0.27059817f, 0.65328151f, 0.70710671f },
{ -0.00000001f, 0.70710683f, 0.70710671f },
{ -0.27059820f, 0.65328145f, 0.70710671f },
{ -0.49999994f, 0.50000012f, 0.70710671f },
{ -0.65328157f, 0.27059805f, 0.70710671f },
{ -0.38268358f, 0.00000000f, 0.92387950f },
{ -0.35355350f, -0.14644668f, 0.92387950f },
{ -0.27059814f, -0.27059814f, 0.92387950f },
{ -0.14644666f, -0.35355350f, 0.92387950f },
{ 0.00000002f, -0.38268358f, 0.92387950f },
{ 0.14644665f, -0.35355353f, 0.92387950f },
{ 0.27059814f, -0.27059814f, 0.92387950f },
{ 0.35355350f, -0.14644669f, 0.92387950f },
{ 0.38268358f, 0.00000003f, 0.92387950f },
{ 0.35355350f, 0.14644666f, 0.92387950f },
{ 0.27059817f, 0.27059811f, 0.92387950f },
{ 0.14644672f, 0.35355350f, 0.92387950f },
{ -0.00000000f, 0.38268358f, 0.92387950f },
{ -0.14644673f, 0.35355350f, 0.92387950f },
{ -0.27059811f, 0.27059820f, 0.92387950f },
{ -0.35355353f, 0.14644666f, 0.92387950f },
{ 0.00000001f, 0.00000000f, 1.00000000f },
{ 0.00000001f, 0.00000000f, 1.00000000f },
{ 0.00000001f, 0.00000001f, 1.00000000f },
{ 0.00000000f, 0.00000001f, 1.00000000f },
{ -0.00000000f, 0.00000001f, 1.00000000f },
{ -0.00000000f, 0.00000001f, 1.00000000f },
{ -0.00000001f, 0.00000001f, 1.00000000f },
{ -0.00000001f, 0.00000000f, 1.00000000f },
{ -0.00000001f, -0.00000000f, 1.00000000f },
{ -0.00000001f, -0.00000000f, 1.00000000f },
{ -0.00000001f, -0.00000001f, 1.00000000f },
{ -0.00000000f, -0.00000001f, 1.00000000f },
{ 0.00000000f, -0.00000001f, 1.00000000f },
{ 0.00000000f, -0.00000001f, 1.00000000f },
{ 0.00000001f, -0.00000001f, 1.00000000f },
{ 0.00000001f, -0.00000000f, 1.00000000f },
{ 0.38268360f, 0.00000000f, 0.92387944f },
{ 0.35355353f, 0.14644669f, 0.92387944f },
{ 0.27059817f, 0.27059817f, 0.92387944f },
{ 0.14644668f, 0.35355353f, 0.92387944f },
{ -0.00000002f, 0.38268360f, 0.92387944f },
{ -0.14644666f, 0.35355356f, 0.92387944f },
{ -0.27059817f, 0.27059817f, 0.92387944f },
{ -0.35355353f, 0.14644669f, 0.92387944f },
{ -0.38268360f, -0.00000003f, 0.92387944f },
{ -0.35355353f, -0.14644668f, 0.92387944f },
{ -0.27059820f, -0.27059814f, 0.92387944f },
{ -0.14644673f, -0.35355353f, 0.92387944f },
{ 0.00000000f, -0.38268360f, 0.92387944f },
{ 0.14644673f, -0.35355350f, 0.92387944f },
{ 0.27059811f, -0.27059820f, 0.92387944f },
{ 0.35355356f, -0.14644668f, 0.92387944f },
{ 0.70710665f, 0.00000000f, 0.70710689f },
{ 0.65328133f, 0.27059802f, 0.70710689f },
{ 0.49999991f, 0.49999991f, 0.70710689f },
{ 0.27059799f, 0.65328133f, 0.70710689f },
{ -0.00000003f, 0.70710665f, 0.70710689f },
{ -0.27059796f, 0.65328139f, 0.70710689f },
{ -0.49999991f, 0.49999991f, 0.70710689f },
{ -0.65328133f, 0.27059802f, 0.70710689f },
{ -0.70710665f, -0.00000006f, 0.70710689f },
{ -0.65328133f, -0.27059799f, 0.70710689f },
{ -0.49999994f, -0.49999985f, 0.70710689f },
{ -0.27059811f, -0.65328133f, 0.70710689f },
{ 0.00000001f, -0.70710665f, 0.70710689f },
{ 0.27059811f, -0.65328127f, 0.70710689f },
{ 0.49999982f, -0.49999997f, 0.70710689f },
{ 0.65328139f, -0.27059799f, 0.70710689f },
{ 0.92387956f, 0.00000000f, 0.38268343f },
{ 0.85355341f, 0.35355341f, 0.38268343f },
{ 0.65328151f, 0.65328151f, 0.38268343f },
{ 0.35355338f, 0.85355341f, 0.38268343f },
{ -0.00000004f, 0.92387956f, 0.38268343f },
{ -0.35355335f, 0.85355347f, 0.38268343f },
{ -0.65328151f, 0.65328151f, 0.38268343f },
{ -0.85355341f, 0.35355344f, 0.38268343f },
{ -0.92387956f, -0.00000008f, 0.38268343f },
{ -0.85355341f, -0.35355338f, 0.38268343f },
{ -0.65328157f, -0.65328145f, 0.38268343f },
{ -0.35355353f, -0.85355341f, 0.38268343f },
{ 0.00000001f, -0.92387956f, 0.38268343f },
{ 0.35355356f, -0.85355335f, 0.38268343f },
{ 0.65328139f, -0.65328163f, 0.38268343f },
{ 0.85355347f, -0.35355338f, 0.38268343f }
};
//==============================================================
@ -360,14 +360,14 @@ signed short ClampShort( int i ) {
// this isn't a real cheap function to call!
// Makro - a lot cheaper now
int DirToByte(vec3_t dir)
{
vec3_t angles;
vectoangles(dir, angles);
return ((int) (angles[YAW] * 16 / 360.0f) & 15) | ((((int) (angles[PITCH] * 16 / 360.0f)) & 15) << 4);
}
// Makro - a lot cheaper now
int DirToByte(vec3_t dir)
{
vec3_t angles;
vectoangles(dir, angles);
return ((int) (angles[YAW] * 16 / 360.0f) & 15) | ((((int) (angles[PITCH] * 16 / 360.0f)) & 15) << 4);
}
void ByteToDir( int b, vec3_t dir ) {
@ -1471,131 +1471,170 @@ int Q_isnan( float x )
return (int)( (unsigned int)fi.ui >> 31 );
}
// By NiceAss. Used for reflection of sparks on metal surfaces
int ReflectVectorByte(vec3_t dir, vec3_t plane)
{
vec3_t final;
float dot;
dot = DotProduct(dir, plane);
VectorMA(dir, -2 * dot, plane, final);
return DirToByte(final);
}
//Makro - moved from g_mover.c
/*
================
CreateRotationMatrix
================
*/
void CreateRotationMatrix(vec3_t angles, vec3_t matrix[3])
{
AngleVectors(angles, matrix[0], matrix[1], matrix[2]);
VectorInverse(matrix[1]);
}
/*
================
TransposeMatrix
================
*/
void TransposeMatrix(vec3_t matrix[3], vec3_t transpose[3])
{
int i, j;
for (i = 0; i < 3; i++) {
for (j = 0; j < 3; j++) {
transpose[i][j] = matrix[j][i];
}
}
}
/*
================
RotatePoint
================
*/
void RotatePoint(vec3_t point, vec3_t matrix[3])
{
vec3_t tvec;
VectorCopy(point, tvec);
point[0] = DotProduct(matrix[0], tvec);
point[1] = DotProduct(matrix[1], tvec);
point[2] = DotProduct(matrix[2], tvec);
}
//Makro - added
void ChangeRefSystem(vec3_t in, vec3_t neworg, vec3_t newaxis[], vec3_t out)
{
vec3_t result;
VectorScale(newaxis[0], in[0], result);
VectorMA(result, in[1], newaxis[1], result);
VectorMA(result, in[2], newaxis[2], result);
if (neworg)
VectorAdd(result, neworg, result);
VectorCopy(result, out);
}
//Makro - added
void ChangeBackRefSystem(vec3_t in, vec3_t neworg, vec3_t newaxis[], vec3_t out)
{
vec3_t dif;
if (neworg)
VectorSubtract(in, neworg, dif);
else
VectorCopy(in, dif);
out[0] = DotProduct(dif, newaxis[0]);
out[1] = DotProduct(dif, newaxis[1]);
out[2] = DotProduct(dif, newaxis[2]);
}
void ChangeAngleRefSystem(vec3_t in, vec3_t newaxis[], vec3_t out)
{
vec3_t result;
/*
result[YAW_AXIS] = in[YAW];
result[PITCH_AXIS] = in[PITCH];
result[ROLL_AXIS] = in[ROLL];
VectorCopy(result, in);
*/
VectorMA(vec3_origin, in[YAW], newaxis[YAW_AXIS], result);
VectorMA(result, in[PITCH], newaxis[PITCH_AXIS], result);
VectorMA(result, in[ROLL], newaxis[ROLL_AXIS], result);
//VectorCopy(result, out);
out[YAW] = result[YAW_AXIS];
out[PITCH] = result[PITCH_AXIS];
out[ROLL] = result[ROLL_AXIS];
//VectorCopy(in, out);
}
void ToAxisAngles(vec3_t in, vec3_t out)
{
vec3_t angles, result, forward;
VectorClear(result);
//yaw - around the Z axis
result[YAW_AXIS] = in[YAW];
//pitch - around the new Y axis
angles[YAW] = in[YAW];
angles[PITCH] = angles[ROLL] = 0;
AngleVectors(angles, NULL, forward, NULL);
VectorMA(result, -in[PITCH], forward, result);
result[PITCH_AXIS] = in[PITCH];
//roll - around the new X axis
angles[PITCH] = in[PITCH];
AngleVectors(angles, forward, NULL, NULL);
VectorMA(result, in[ROLL], forward, result);
VectorCopy(result, out);
}
// By NiceAss. Used for reflection of sparks on metal surfaces
int ReflectVectorByte(vec3_t dir, vec3_t plane)
{
vec3_t final;
float dot;
dot = DotProduct(dir, plane);
VectorMA(dir, -2 * dot, plane, final);
return DirToByte(final);
}
//Makro - moved from g_mover.c
/*
================
CreateRotationMatrix
================
*/
void CreateRotationMatrix(vec3_t angles, vec3_t matrix[3])
{
AngleVectors(angles, matrix[0], matrix[1], matrix[2]);
VectorInverse(matrix[1]);
}
/*
================
TransposeMatrix
================
*/
void TransposeMatrix(vec3_t matrix[3], vec3_t transpose[3])
{
int i, j;
for (i = 0; i < 3; i++) {
for (j = 0; j < 3; j++) {
transpose[i][j] = matrix[j][i];
}
}
}
/*
================
RotatePoint
================
*/
void RotatePoint(vec3_t point, vec3_t matrix[3])
{
vec3_t tvec;
VectorCopy(point, tvec);
point[0] = DotProduct(matrix[0], tvec);
point[1] = DotProduct(matrix[1], tvec);
point[2] = DotProduct(matrix[2], tvec);
}
//Makro - added
void ChangeRefSystem(vec3_t in, vec3_t neworg, vec3_t newaxis[], vec3_t out)
{
vec3_t result;
VectorScale(newaxis[0], in[0], result);
VectorMA(result, in[1], newaxis[1], result);
VectorMA(result, in[2], newaxis[2], result);
if (neworg)
VectorAdd(result, neworg, result);
VectorCopy(result, out);
}
//Makro - added
void ChangeBackRefSystem(vec3_t in, vec3_t neworg, vec3_t newaxis[], vec3_t out)
{
vec3_t dif;
if (neworg)
VectorSubtract(in, neworg, dif);
else
VectorCopy(in, dif);
out[0] = DotProduct(dif, newaxis[0]);
out[1] = DotProduct(dif, newaxis[1]);
out[2] = DotProduct(dif, newaxis[2]);
}
void ChangeAngleRefSystem(vec3_t in, vec3_t newaxis[], vec3_t out)
{
vec3_t result;
/*
result[YAW_AXIS] = in[YAW];
result[PITCH_AXIS] = in[PITCH];
result[ROLL_AXIS] = in[ROLL];
VectorCopy(result, in);
*/
VectorMA(vec3_origin, in[YAW], newaxis[YAW_AXIS], result);
VectorMA(result, in[PITCH], newaxis[PITCH_AXIS], result);
VectorMA(result, in[ROLL], newaxis[ROLL_AXIS], result);
//VectorCopy(result, out);
out[YAW] = result[YAW_AXIS];
out[PITCH] = result[PITCH_AXIS];
out[ROLL] = result[ROLL_AXIS];
//VectorCopy(in, out);
}
void ToAxisAngles(vec3_t in, vec3_t out)
{
vec3_t angles, result, forward;
VectorClear(result);
//yaw - around the Z axis
result[YAW_AXIS] = in[YAW];
//pitch - around the new Y axis
angles[YAW] = in[YAW];
angles[PITCH] = angles[ROLL] = 0;
AngleVectors(angles, NULL, forward, NULL);
VectorMA(result, -in[PITCH], forward, result);
result[PITCH_AXIS] = in[PITCH];
//roll - around the new X axis
angles[PITCH] = in[PITCH];
AngleVectors(angles, forward, NULL, NULL);
VectorMA(result, in[ROLL], forward, result);
VectorCopy(result, out);
}
/*
================
RotatePoint
================
*/
static void RotatePoint(vec3_t point, /*const*/ vec3_t matrix[3]) { // FIXME
vec3_t tvec;
VectorCopy(point, tvec);
point[0] = DotProduct(matrix[0], tvec);
point[1] = DotProduct(matrix[1], tvec);
point[2] = DotProduct(matrix[2], tvec);
}
/*
================
TransposeMatrix
================
*/
static void TransposeMatrix(/*const*/ vec3_t matrix[3], vec3_t transpose[3]) { // FIXME
int i, j;
for (i = 0; i < 3; i++) {
for (j = 0; j < 3; j++) {
transpose[i][j] = matrix[j][i];
}
}
}
/*
================
CreateRotationMatrix
================
*/
static void CreateRotationMatrix(const vec3_t angles, vec3_t matrix[3]) {
AngleVectors(angles, matrix[0], matrix[1], matrix[2]);
VectorInverse(matrix[1]);
}

View File

@ -79,16 +79,16 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define SURF_NODLIGHT 0x20000 // don't dlight even if solid (solid lava, skies)
#define SURF_DUST 0x40000 // leave a dust trail when walking on this surface
//Elder: new surfaces
#define SURF_GRAVEL 0x80000
#define SURF_WOOD 0x100000
#define SURF_CARPET 0x200000
#define SURF_METAL2 0x400000
#define SURF_GLASS 0x800000
#define SURF_GRASS 0x1000000
// JBravo: new sounds
#define SURF_SNOW 0x2000000
#define SURF_MUD 0x4000000
#define SURF_WOOD2 0x8000000
#define SURF_HARDMETAL 0x10000000
//Elder: new surfaces
#define SURF_GRAVEL 0x80000
#define SURF_WOOD 0x100000
#define SURF_CARPET 0x200000
#define SURF_METAL2 0x400000
#define SURF_GLASS 0x800000
#define SURF_GRASS 0x1000000
// JBravo: new sounds
#define SURF_SNOW 0x2000000
#define SURF_MUD 0x4000000
#define SURF_WOOD2 0x8000000
#define SURF_HARDMETAL 0x10000000