Changeset 249 for trunk/thune/eval.c

Show
Ignore:
Timestamp:
08/11/06 16:34:10 (2 years ago)
Author:
krobillard
Message:

Thune - Random, eq?, and zero? now handle vec3!.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/thune/eval.c

    r246 r249  
    15681568            break; 
    15691569 
     1570        case UT_COORD: 
     1571            if( ur_is(b, UT_COORD) ) 
     1572            { 
     1573                if( a->coord.len == b->coord.len ) 
     1574                { 
     1575                    int i; 
     1576                    for( i = 0; i < a->coord.len; ++i ) 
     1577                    { 
     1578                        if( a->coord.elem[i] != b->coord.elem[i] ) 
     1579                            return 0; 
     1580                    } 
     1581                    return 1; 
     1582                } 
     1583            } 
     1584            break; 
     1585 
     1586        case UT_VEC3: 
     1587            if( ur_is(b, UT_VEC3) ) 
     1588            { 
     1589                if( (a->vec3.xyz[0] == b->vec3.xyz[0]) && 
     1590                    (a->vec3.xyz[1] == b->vec3.xyz[1]) && 
     1591                    (a->vec3.xyz[2] == b->vec3.xyz[2]) ) 
     1592                    return 1; 
     1593            } 
     1594            break; 
     1595 
    15701596        case UT_BLOCK: 
    15711597        case UT_PAREN: 
     
    16741700        case UT_BLOCK: 
    16751701        case UT_PAREN: 
     1702        case UT_ARRAY: 
    16761703            if( (a->series.n == b->series.n) && 
    16771704                (a->series.it == b->series.it) ) 
     
    17161743    else if( ur_is(tos, UT_DECIMAL) ) 
    17171744        n = ur_decimal(tos) ? 0 : 1; 
     1745#ifdef UR_CONFIG_MATH3D 
     1746    else if( ur_is(tos, UT_VEC3) ) 
     1747    { 
     1748        n = (tos->vec3.xyz[0] == 0.0 && 
     1749             tos->vec3.xyz[1] == 0.0 && 
     1750             tos->vec3.xyz[2] == 0.0) ? 1 : 0; 
     1751    } 
     1752#endif 
    17181753    else 
    17191754        n = 0;