Changeset 2587


Ignore:
Timestamp:
Mar 13, 2013, 1:48:14 PM (7 years ago)
Author:
sam
Message:

base: roll our own constants because it’s always a pain in the ass
to get M_PI from the platform headers and cast it to float.

Location:
trunk
Files:
1 added
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/Makefile.am

    r2575 r2587  
    3939    lol/math/functions.h lol/math/vector.h lol/math/half.h lol/math/real.h \
    4040    lol/math/remez.h lol/math/geometry.h lol/math/interp.h lol/math/rand.h \
     41    lol/math/constants.h \
    4142    \
    4243    lol/sys/all.h \
  • trunk/src/easymesh/csgbsp.cpp

    r2232 r2587  
    1717#if defined HAVE_CONFIG_H
    1818#   include "config.h"
    19 #endif
    20 
    21 #if defined _XBOX
    22 #   define _USE_MATH_DEFINES /* for M_PI */
    23 #   include <xtl.h>
    24 #   undef near /* Fuck Microsoft */
    25 #   undef far /* Fuck Microsoft again */
    26 #elif defined _WIN32
    27 #   define _USE_MATH_DEFINES /* for M_PI */
    28 #   define WIN32_LEAN_AND_MEAN
    29 #   include <windows.h>
    30 #   undef near /* Fuck Microsoft */
    31 #   undef far /* Fuck Microsoft again */
    3219#endif
    3320
  • trunk/src/easymesh/easymesh.cpp

    r2523 r2587  
    1818#if defined HAVE_CONFIG_H
    1919#   include "config.h"
    20 #endif
    21 
    22 #if defined _XBOX
    23 #   define _USE_MATH_DEFINES /* for M_PI */
    24 #   include <xtl.h>
    25 #   undef near /* Fuck Microsoft */
    26 #   undef far /* Fuck Microsoft again */
    27 #elif defined _WIN32
    28 #   define _USE_MATH_DEFINES /* for M_PI */
    29 #   define WIN32_LEAN_AND_MEAN
    30 #   include <windows.h>
    31 #   undef near /* Fuck Microsoft */
    32 #   undef far /* Fuck Microsoft again */
    3320#endif
    3421
     
    14611448     * is a vertex at [0 1 0] and [0 -1 0] after normalisation. */
    14621449    float phi = 0.5f + 0.5f * sqrt(5.f);
    1463     mat3 mat = mat3::rotate(asin(1.f / sqrt(2.f + phi)) * (180.f / (float)M_PI),
     1450    mat3 mat = mat3::rotate(asin(1.f / sqrt(2.f + phi)) * (180.f / F_PI),
    14641451                            vec3(0.f, 0.f, 1.f));
    14651452    for (int i = 0; i < 4; i++)
     
    15091496                p[k] = normalize(p[k]);
    15101497
    1511                 uv[k].x = (lol::atan2(p[k].z, p[k].x) + (float)M_PI) / ((float)M_PI * 2.f);
     1498                uv[k].x = (lol::atan2(p[k].z, p[k].x) + F_PI) / (F_PI * 2.f);
    15121499                if (abs(p[k].y) >= 1.0f)
    15131500                    uv[k].x = -1.f;
    1514                 uv[k].y = lol::atan2(p[k].y, dot(p[k], normalize(p[k] * vec3(1.f,0.f,1.f)))) / (float)M_PI + 0.5f;
     1501                uv[k].y = lol::atan2(p[k].y, dot(p[k], normalize(p[k] * vec3(1.f,0.f,1.f)))) / F_PI + 0.5f;
    15151502                if (h)
    15161503                {
     
    16031590
    16041591            //Location on the donut
    1605             float x = 0.5f * (r2 - r1) * (float)lol::cos(2.0 * M_PI * i2 / nidiv) + 0.5f * (r1 + r2);
    1606             float y = 0.5f * (r2 - r1) * (float)lol::sin(2.0 * M_PI * i2 / nidiv);
     1592            float x = 0.5f * (r2 - r1) * (float)lol::cos(2.f * F_PI * i2 / nidiv) + 0.5f * (r1 + r2);
     1593            float y = 0.5f * (r2 - r1) * (float)lol::sin(2.f * F_PI * i2 / nidiv);
    16071594            float z = 0.0f;
    16081595
    16091596            //Center circle
    1610             float ca = (float)lol::cos(2.0 * M_PI * j2 / njdiv);
    1611             float sa = (float)lol::sin(2.0 * M_PI * j2 / njdiv);
     1597            float ca = (float)lol::cos(2.f * F_PI * j2 / njdiv);
     1598            float sa = (float)lol::sin(2.f * F_PI * j2 / njdiv);
    16121599
    16131600            //Actual location
     
    23832370                        //Calculate new master vertex
    23842371                        float n = (float)connected_vert.Count();
    2385                         //b(n) = 5/4 - pow(3 + 2 * cos(2 * M_PI / n), 2) / 32
    2386                         float beta = 3.f + 2.f * cos(2.f * (float)M_PI / n);
     2372                        //b(n) = 5/4 - pow(3 + 2 * cos(2.f * F_PI / n), 2) / 32
     2373                        float beta = 3.f + 2.f * cos(2.f * F_PI / n);
    23872374                        beta = 5.f / 4.f - beta * beta / 32.f;
    23882375                        //a(n) = n * (1 - b(n)) / b(n)
  • trunk/src/gpu/lolfx.cpp

    r2216 r2587  
    1616#if defined HAVE_CONFIG_H
    1717#   include "config.h"
    18 #endif
    19 
    20 #if defined _XBOX
    21 #   define _USE_MATH_DEFINES /* for M_PI */
    22 #   include <xtl.h>
    23 #   undef near /* Fuck Microsoft */
    24 #   undef far /* Fuck Microsoft again */
    25 #elif defined _WIN32
    26 #   define _USE_MATH_DEFINES /* for M_PI */
    27 #   define WIN32_LEAN_AND_MEAN
    28 #   include <windows.h>
    29 #   undef near /* Fuck Microsoft */
    30 #   undef far /* Fuck Microsoft again */
    3118#endif
    3219
  • trunk/src/image/color/cie1931.cpp

    r2207 r2587  
    2727float Color::DistanceCIEDE2000(vec3 lab1, vec3 lab2)
    2828{
    29     float const pi = 3.141592653589793f;
    30 
    3129    float C1 = length(lab1.yz);
    3230    float C2 = length(lab2.yz);
     
    4947    float hp1 = atan2(lab1.z, ap1);
    5048    float hp2 = atan2(lab2.z, ap2);
    51     float dhp = fmod(hp2 - hp1 + 3.f * pi, 2.f * pi) - pi; /* -pi .. pi */
     49    float dhp = fmod(hp2 - hp1 + 3.f * F_PI, 2.f * F_PI) - F_PI; /* -pi .. pi */
    5250    float dHp = 2.f * sqrt(Cp1 * Cp2) * sin(0.5f * dhp);
    53     float Hp_ = Cp1 * Cp2 ? fmod(hp1 + 0.5f * dhp + 2.f * pi, 2.f * pi) : hp1 + hp2; /* 0 .. 2pi */
    54 
    55     float T = 1.f - 0.17f * cos(Hp_ - pi / 6.f)
     51    float Hp_ = Cp1 * Cp2 ? fmod(hp1 + 0.5f * dhp + 2.f * F_PI, 2.f * F_PI) : hp1 + hp2; /* 0 .. 2pi */
     52
     53    float T = 1.f - 0.17f * cos(Hp_ - F_PI / 6.f)
    5654                  + 0.24f * cos(2.f * Hp_)
    57                   + 0.32f * cos(3.f * Hp_ + pi / 30.f)
    58                   - 0.20f * cos(4.f * Hp_ - 0.35f * pi);
     55                  + 0.32f * cos(3.f * Hp_ + F_PI / 30.f)
     56                  - 0.20f * cos(4.f * Hp_ - 0.35f * F_PI);
    5957    float SL = 1.f + 0.015f * (L_ - 50) * (L_ - 50)
    6058                            / sqrt(20.f + (L_ - 50) * (L_ - 50));
     
    6260    float SH = 1.f + 0.015f * Cp_ * T;
    6361    float RT = -2.f * sqrt(pow(Cp_, 7.f) / (pow(Cp_, 7.f) + pow(25.f, 7.f)))
    64                     * sin(pi / 3.f * exp(-pow((Hp_ * 180.f / pi - 275.f) / 25.f, 2.f)));
     62                    * sin(F_PI / 3.f * exp(-pow((Hp_ * 180.f / F_PI - 275.f) / 25.f, 2.f)));
    6563
    6664    dLp /= SL;
  • trunk/src/lol/math/all.h

    r2524 r2587  
    1212#define __LOL_MATH_ALL_H__
    1313
     14#include <lol/math/constants.h>
    1415#include <lol/math/functions.h>
    1516#include <lol/math/half.h>
  • trunk/src/lolcore.vcxproj

    r2550 r2587  
    217217    <ClInclude Include="lol\image\image.h" />
    218218    <ClInclude Include="lol\math\all.h" />
     219    <ClInclude Include="lol\math\constants.h" />
    219220    <ClInclude Include="lol\math\functions.h" />
    220221    <ClInclude Include="lol\math\geometry.h" />
  • trunk/src/lolcore.vcxproj.filters

    r2524 r2587  
    531531      <Filter>lol\sys</Filter>
    532532    </ClInclude>
     533    <ClInclude Include="lol\math\constants.h">
     534      <Filter>lol\math</Filter>
     535    </ClInclude>
     536    <ClInclude Include="lol\math\functions.h">
     537      <Filter>lol\math</Filter>
     538    </ClInclude>
    533539    <ClInclude Include="lol\math\functions.h">
    534540      <Filter>lol\math</Filter>
  • trunk/src/math/geometry.cpp

    r2232 r2587  
    1212#if defined HAVE_CONFIG_H
    1313#   include "config.h"
    14 #endif
    15 
    16 #if defined _XBOX
    17 #   define _USE_MATH_DEFINES /* for M_PI */
    18 #   include <xtl.h>
    19 #   undef near /* Fuck Microsoft */
    20 #   undef far /* Fuck Microsoft again */
    21 #elif defined _WIN32
    22 #   define _USE_MATH_DEFINES /* for M_PI */
    23 #   define WIN32_LEAN_AND_MEAN
    24 #   include <windows.h>
    25 #   undef near /* Fuck Microsoft */
    26 #   undef far /* Fuck Microsoft again */
    2714#endif
    2815
  • trunk/src/math/real.cpp

    r2394 r2587  
    1111#if defined HAVE_CONFIG_H
    1212#   include "config.h"
    13 #endif
    14 
    15 #if defined _XBOX
    16 #   define _USE_MATH_DEFINES /* for M_PI */
    17 #   include <xtl.h>
    18 #   undef near /* Fuck Microsoft */
    19 #   undef far /* Fuck Microsoft again */
    20 #elif defined WIN32
    21 #   define _USE_MATH_DEFINES /* for M_PI */
    22 #   define WIN32_LEAN_AND_MEAN
    23 #   include <windows.h>
    24 #   undef near /* Fuck Microsoft */
    25 #   undef far /* Fuck Microsoft again */
    2613#endif
    2714
     
    797784     * also be useful to sort the ck values by decreasing absolute value
    798785     * and do the addition in this order. */
    799     int a = ceilf(logf(2) / logf(2 * M_PI) * real::BIGITS * real::BIGIT_BITS);
     786    int a = ceilf(logf(2) / logf(2 * F_PI) * real::BIGITS * real::BIGIT_BITS);
    800787
    801788    real ret = sqrt(real::R_PI() * 2);
  • trunk/src/math/trig.cpp

    r2183 r2587  
    2424{
    2525
    26 static const double PI     = 3.14159265358979323846264;
    27 static const double NEG_PI = -3.14159265358979323846264;
    2826static const double PI_2   = 1.57079632679489661923132;
    2927static const double PI_4   = 0.785398163397448309615661;
     
    256254     * result. */
    257255#if defined __CELLOS_LV2__
    258     double sign = lol_fsel(x, PI, NEG_PI);
     256    double sign = lol_fsel(x, D_PI, -D_PI);
    259257    double num_cycles = lol_round(absx);
    260258    double is_even = lol_trunc(num_cycles * HALF) - (num_cycles * HALF);
     
    292290
    293291#if !defined __CELLOS_LV2__
    294     sign *= (x >= 0.0) ? PI : NEG_PI;
     292    sign *= (x >= 0.0) ? D_PI : -D_PI;
    295293#endif
    296294
     
    353351        double taylor = sub2 * x2 + sub1;
    354352
    355         return x1 * taylor * sign * PI;
     353        return x1 * taylor * sign * D_PI;
    356354    }
    357355#endif
     
    402400    double is_even = lol_trunc(num_cycles * HALF) - (num_cycles * HALF);
    403401
    404     double sin_sign = lol_fsel(x, PI, NEG_PI);
     402    double sin_sign = lol_fsel(x, D_PI, -D_PI);
    405403    sin_sign = lol_fsel(is_even, sin_sign, -sin_sign);
    406404    double cos_sign = lol_fsel(is_even, ONE, NEG_ONE);
     
    437435        double subc2 = (SC[4] * x4 + SC[2]) * x4 + SC[0];
    438436        double taylorc = subc2 * x2 + subc1;
    439         *cosx = x1 * taylorc * cos_sign * PI;
     437        *cosx = x1 * taylorc * cos_sign * D_PI;
    440438
    441439        return;
     
    444442
    445443#if !defined __CELLOS_LV2__
    446     sin_sign *= (x >= 0.0) ? PI : NEG_PI;
     444    sin_sign *= (x >= 0.0) ? D_PI : -D_PI;
    447445#endif
    448446
  • trunk/src/math/vector.cpp

    r2348 r2587  
    1313#endif
    1414
    15 #if defined _XBOX
    16 #   define _USE_MATH_DEFINES /* for M_PI */
    17 #   include <xtl.h>
    18 #   undef near /* Fuck Microsoft */
    19 #   undef far /* Fuck Microsoft again */
    20 #elif defined _WIN32
    21 #   define _USE_MATH_DEFINES /* for M_PI */
    22 #   define WIN32_LEAN_AND_MEAN
    23 #   include <windows.h>
    24 #   undef near /* Fuck Microsoft */
    25 #   undef far /* Fuck Microsoft again */
    26 #endif
    27 
    2815#include <cstdlib> /* free() */
    2916#include <cstring> /* strdup() */
     
    349336template<> mat2 mat2::rotate(float degrees)
    350337{
    351     degrees *= (M_PI / 180.0f);
     338    degrees *= (F_PI / 180.0f);
    352339
    353340    float st = sin(degrees);
     
    367354template<> mat3 mat3::rotate(float degrees, float x, float y, float z)
    368355{
    369     degrees *= (M_PI / 180.0f);
     356    degrees *= (F_PI / 180.0f);
    370357
    371358    float st = sin(degrees);
     
    486473template<> quat quat::rotate(float degrees, vec3 const &v)
    487474{
    488     degrees *= (M_PI / 360.0f);
     475    degrees *= (F_PI / 360.0f);
    489476
    490477    vec3 tmp = normalize(v) * sin(degrees);
     
    532519                   1.f - 2.f * (q.z * q.z + q.y * q.y)));
    533520
    534     return (float)(180.0f / M_PI / n) * ret;
     521    return (180.0f / F_PI / n) * ret;
    535522}
    536523
     
    539526    mat3 ret;
    540527
    541     vec3 radians = (float)(M_PI / 180.0f) * v;
     528    vec3 radians = (F_PI / 180.0f) * v;
    542529    float s0 = sin(radians[0]), c0 = cos(radians[0]);
    543530    float s1 = sin(radians[1]), c1 = cos(radians[1]);
     
    605592static inline quat quat_fromeuler_generic(vec3 const &v, int i, int j, int k)
    606593{
    607     vec3 half_angles = (float)(M_PI / 360.0f) * v;
     594    vec3 half_angles = (F_PI / 360.0f) * v;
    608595    float s0 = sin(half_angles[0]), c0 = cos(half_angles[0]);
    609596    float s1 = sin(half_angles[1]), c1 = cos(half_angles[1]);
     
    755742                                  float height, float near, float far)
    756743{
    757     fov_y *= (M_PI / 180.0f);
     744    fov_y *= (F_PI / 180.0f);
    758745
    759746    float t2 = tanf(fov_y * 0.5f);
  • trunk/test/benchmark/trig.cpp

    r2520 r2587  
    1111#if defined HAVE_CONFIG_H
    1212#   include "config.h"
    13 #endif
    14 
    15 #if defined _XBOX
    16 #   define _USE_MATH_DEFINES /* for M_PI */
    17 #   include <xtl.h>
    18 #elif defined _WIN32
    19 #   define _USE_MATH_DEFINES /* for M_PI */
    20 #   define WIN32_LEAN_AND_MEAN
    21 #   include <windows.h>
    2213#endif
    2314
     
    5647        case 2:
    5748            for (size_t i = 0; i < TRIG_TABLE_SIZE; i++)
    58                 pf[i] = rand(-M_PI, M_PI);
     49                pf[i] = rand(-F_PI, F_PI);
    5950            break;
    6051        case 3:
  • trunk/test/btphystest.cpp

    r2476 r2587  
    88#if defined HAVE_CONFIG_H
    99#   include "config.h"
    10 #endif
    11 
    12 #if defined _XBOX
    13 #   define _USE_MATH_DEFINES /* for M_PI */
    14 #   include <xtl.h>
    15 #   undef near /* Fuck Microsoft */
    16 #   undef far /* Fuck Microsoft again */
    17 #elif defined _WIN32
    18 #   define _USE_MATH_DEFINES /* for M_PI */
    19 #   define WIN32_LEAN_AND_MEAN
    20 #   include <windows.h>
    21 #   undef near /* Fuck Microsoft */
    22 #   undef far /* Fuck Microsoft again */
    23 #else
    24 #   include <cmath>
    2510#endif
    2611
     
    278263
    279264    m_loop_value += seconds;
    280     if (m_loop_value > M_PI * 2.0f)
    281         m_loop_value -= M_PI * 2.0f;
     265    if (m_loop_value > F_PI * 2.0f)
     266        m_loop_value -= F_PI * 2.0f;
    282267
    283268    vec3 GroundBarycenter = vec3(.0f);
  • trunk/tools/neercs/neercs.cpp

    r2241 r2587  
    77#if defined HAVE_CONFIG_H
    88#   include "config.h"
    9 #endif
    10 
    11 #if defined _XBOX
    12 #   define _USE_MATH_DEFINES /* for M_PI */
    13 #   include <xtl.h>
    14 #   undef near /* Fuck Microsoft */
    15 #   undef far /* Fuck Microsoft again */
    16 #elif defined _WIN32
    17 #   define _USE_MATH_DEFINES /* for M_PI */
    18 #   define WIN32_LEAN_AND_MEAN
    19 #   include <windows.h>
    20 #   undef near /* Fuck Microsoft */
    21 #   undef far /* Fuck Microsoft again */
    22 #else
    23 #   include <cmath>
    249#endif
    2510
  • trunk/tools/neercs/old/wm.cpp

    r2183 r2587  
    1616#endif
    1717
    18 #if defined _XBOX
    19 #   define _USE_MATH_DEFINES /* for M_PI */
    20 #   include <xtl.h>
    21 #   undef near /* Fuck Microsoft */
    22 #   undef far /* Fuck Microsoft again */
    23 #elif defined _WIN32
    24 #   define _USE_MATH_DEFINES /* for M_PI */
    25 #   define WIN32_LEAN_AND_MEAN
    26 #   include <windows.h>
    27 #endif
    28 
    2918#include <stdio.h>
    3019#include <stdlib.h>
     
    3322
    3423#include "core.h"
     24
     25using namespace lol;
    3526
    3627extern "C" {
     
    459450                90.0f * ((float)cur_time / (float)screen_list->cube.duration);
    460451
    461             angle *= (M_PI / 180.0f);
     452            angle *= (F_PI / 180.0f);
    462453
    463454            if (screen_list->cube.side == 1)
  • trunk/tools/neercs/term/term.cpp

    r2177 r2587  
    55#if defined HAVE_CONFIG_H
    66#   include "config.h"
    7 #endif
    8 
    9 #if defined _XBOX
    10 #   define _USE_MATH_DEFINES /* for M_PI */
    11 #   include <xtl.h>
    12 #elif defined _WIN32
    13 #   define _USE_MATH_DEFINES /* for M_PI */
    14 #   define WIN32_LEAN_AND_MEAN
    15 #   include <windows.h>
    167#endif
    178
     
    208199    for(int i = 0; i < h; i++)
    209200    {
    210         float a = M_PI / 180 * i * 16 + m_time * 4;
    211         float b = M_PI / 180 * i * 12;
     201        float a = F_PI / 180 * i * 16 + m_time * 4;
     202        float b = F_PI / 180 * i * 12;
    212203        int x = w / 2  - 14 + w / 4 * lol::cos(a) + w / 4 * lol::sin(b);
    213204        caca_put_str(m_caca, x, i, "LOL WUT! NEERCS SI TEH RULEZ");
     
    217208    for(int i = 0; i < w; i++)
    218209    {
    219         float a = m_time * 1 + M_PI / 180 * i * 8;
    220         float b = m_time * -2 + M_PI / 180 * i * 5;
     210        float a = m_time * 1 + F_PI / 180 * i * 8;
     211        float b = m_time * -2 + F_PI / 180 * i * 5;
    221212        int y = h / 2 + h / 4 * lol::cos(a) + h / 4 * lol::sin(b);
    222213        caca_set_color_argb(m_caca, hex_color(0.25f + 0.5f / w * i - 0.25f / h * y, 0.25f, 0.25f + 0.25f / w * i + 0.25f / h * y), bg_color);
  • trunk/tools/neercs/video/render.cpp

    r2318 r2587  
    55#if defined HAVE_CONFIG_H
    66#   include "config.h"
    7 #endif
    8 
    9 #if defined _XBOX
    10 #   define _USE_MATH_DEFINES /* for M_PI */
    11 #   include <xtl.h>
    12 #elif defined _WIN32
    13 #   define _USE_MATH_DEFINES /* for M_PI */
    14 #   define WIN32_LEAN_AND_MEAN
    15 #   include <windows.h>
    167#endif
    178
     
    4536LOLFX_RESOURCE_DECLARE(radial);
    4637
    47 #define PID M_PI/180.0f    // pi ratio
     38#define PID F_PI/180.0f    // pi ratio
    4839
    4940/*
     
    16691660        shader_postfx->SetUniform(shader_postfx_vignetting, postfx_vignetting);
    16701661        shader_postfx->SetUniform(shader_postfx_aberration, postfx_aberration);
    1671         shader_postfx->SetUniform(shader_postfx_moire_h, vec4(postfx_moire_h.xyz, postfx_moire_h.w * (float)(2 * M_PI)));
    1672         shader_postfx->SetUniform(shader_postfx_moire_v, vec4(postfx_moire_v.xyz, postfx_moire_v.w * (float)(2 * M_PI)));
    1673         shader_postfx->SetUniform(shader_postfx_scanline_h, vec4(postfx_scanline_h.xyz, postfx_scanline_h.w * (float)(2 * M_PI)));
    1674         shader_postfx->SetUniform(shader_postfx_scanline_v, vec4(postfx_scanline_v.xyz, postfx_scanline_v.w * (float)(2 * M_PI)));
     1662        shader_postfx->SetUniform(shader_postfx_moire_h, vec4(postfx_moire_h.xyz, postfx_moire_h.w * (2 * F_PI)));
     1663        shader_postfx->SetUniform(shader_postfx_moire_v, vec4(postfx_moire_v.xyz, postfx_moire_v.w * (2 * F_PI)));
     1664        shader_postfx->SetUniform(shader_postfx_scanline_h, vec4(postfx_scanline_h.xyz, postfx_scanline_h.w * (2 * F_PI)));
     1665        shader_postfx->SetUniform(shader_postfx_scanline_v, vec4(postfx_scanline_v.xyz, postfx_scanline_v.w * (2 * F_PI)));
    16751666        shader_postfx->SetUniform(shader_postfx_corner, postfx_corner);
    16761667        shader_postfx->SetUniform(shader_postfx_sync, (float)fabs(sync_value * cosf((main_angle - sync_angle) * 6.0f)));
  • trunk/tutorial/12_voronoi.cpp

    r2585 r2587  
    1111#if defined HAVE_CONFIG_H
    1212#   include "config.h"
    13 #endif
    14 
    15 #if defined _XBOX
    16 #   define _USE_MATH_DEFINES /* for M_PI */
    17 #   include <xtl.h>
    18 #   undef near /* Fuck Microsoft */
    19 #   undef far /* Fuck Microsoft again */
    20 #elif defined _WIN32
    21 #   define _USE_MATH_DEFINES /* for M_PI */
    22 #   define WIN32_LEAN_AND_MEAN
    23 #   include <windows.h>
    24 #   undef near /* Fuck Microsoft */
    25 #   undef far /* Fuck Microsoft again */
    2613#endif
    2714
     
    189176            for (int i = 0; i < maxi; ++i)
    190177            {
    191                 voronoi_points.Push(vec3(256.f) + 196.f * vec3((float)lol::cos(m_time + (double)i * 2.0 * M_PI / (double)maxi), (float)lol::sin(m_time + (double)i * 2.0 * M_PI / (double)maxi), .0f), vec2(.0f));
    192                 voronoi_points.Push(vec3(256.f) + 128.f * vec3((float)lol::cos(-m_time + (double)i * 2.0 * M_PI / (double)maxi), (float)lol::sin(-m_time + (double)i * 2.0 * M_PI / (double)maxi), .0f), vec2(.0f));
    193                 voronoi_points.Push(vec3(256.f) + 64.f *  vec3((float)lol::cos(m_time + (double)i * 2.0 * M_PI / (double)maxi), (float)lol::sin(m_time + (double)i * 2.0 * M_PI / (double)maxi), .0f), vec2(.0f));
    194                 voronoi_points.Push(vec3(256.f) + 32.f *  vec3((float)lol::cos(-m_time + (double)i * 2.0 * M_PI / (double)maxi), (float)lol::sin(-m_time + (double)i * 2.0 * M_PI / (double)maxi), .0f), vec2(.0f));
     178                voronoi_points.Push(vec3(256.f) + 196.f * vec3(lol::cos(m_time + i * 2.f * F_PI / maxi), lol::sin(m_time + i * 2.f * F_PI / maxi), .0f), vec2(.0f));
     179                voronoi_points.Push(vec3(256.f) + 128.f * vec3(lol::cos(-m_time + i * 2.f * F_PI / maxi), lol::sin(-m_time + i * 2.f * F_PI / maxi), .0f), vec2(.0f));
     180                voronoi_points.Push(vec3(256.f) + 64.f *  vec3(lol::cos(m_time + i * 2.f * F_PI / maxi), lol::sin(m_time + i * 2.f * F_PI / maxi), .0f), vec2(.0f));
     181                voronoi_points.Push(vec3(256.f) + 32.f *  vec3(lol::cos(-m_time + i * 2.f * F_PI / maxi), lol::sin(-m_time + i * 2.f * F_PI / maxi), .0f), vec2(.0f));
    195182            }
    196183            voronoi_points.Push(vec3(256.f), vec2(.0f));
Note: See TracChangeset for help on using the changeset viewer.