Changeset 664 for trunk/test


Ignore:
Timestamp:
Feb 18, 2011, 1:09:28 AM (10 years ago)
Author:
sam
Message:

Get rid of float3, float4, int3 etc. in favour of GLSL types.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/matrix.cpp

    r651 r664  
    3333    void setUp()
    3434    {
    35         identity = float4x4(1.0f);
    36         triangular = float4x4(float4(1.0f, 0.0f, 0.0f, 0.0f),
    37                               float4(7.0f, 2.0f, 0.0f, 0.0f),
    38                               float4(1.0f, 5.0f, 3.0f, 0.0f),
    39                               float4(8.0f, 9.0f, 2.0f, 4.0f));
    40         invertible = float4x4(float4( 1.0f,  1.0f,  2.0f, -1.0f),
    41                               float4(-2.0f, -1.0f, -2.0f,  2.0f),
    42                               float4( 4.0f,  2.0f,  5.0f, -4.0f),
    43                               float4( 5.0f, -3.0f, -7.0f, -6.0f));
     35        identity = mat4(1.0f);
     36        triangular = mat4(vec4(1.0f, 0.0f, 0.0f, 0.0f),
     37                          vec4(7.0f, 2.0f, 0.0f, 0.0f),
     38                          vec4(1.0f, 5.0f, 3.0f, 0.0f),
     39                          vec4(8.0f, 9.0f, 2.0f, 4.0f));
     40        invertible = mat4(vec4( 1.0f,  1.0f,  2.0f, -1.0f),
     41                          vec4(-2.0f, -1.0f, -2.0f,  2.0f),
     42                          vec4( 4.0f,  2.0f,  5.0f, -4.0f),
     43                          vec4( 5.0f, -3.0f, -7.0f, -6.0f));
    4444    }
    4545
     
    5656    void test_mat_mul()
    5757    {
    58         float4x4 m0 = identity;
    59         float4x4 m1 = identity;
    60         float4x4 m2 = m0 * m1;
     58        mat4 m0 = identity;
     59        mat4 m1 = identity;
     60        mat4 m2 = m0 * m1;
    6161
    6262        CPPUNIT_ASSERT(m2[0][0] == 1.0f);
     
    8383    void test_mat_inv()
    8484    {
    85         float4x4 m0 = invertible;
    86         float4x4 m1 = m0.invert();
     85        mat4 m0 = invertible;
     86        mat4 m1 = m0.invert();
    8787
    88         float4x4 m2 = m0 * m1;
     88        mat4 m2 = m0 * m1;
    8989
    9090        CPPUNIT_ASSERT(m2[0][0] == 1.0f);
     
    110110
    111111private:
    112     float4x4 triangular, identity, invertible;
     112    mat4 triangular, identity, invertible;
    113113};
    114114
Note: See TracChangeset for help on using the changeset viewer.