00001 #pragma warning ( disable : 4786 )
00002
00003 #include <assert.h>
00004 #include <math/vector4.h>
00005 #include <stdio.h>
00006 #include "utility.h"
00007 #include "VrmlScale.h"
00008
00009
00010
00011
00012
00013
00014 void VrmlScale::Parse( char*& buffer )
00015 {
00016 EatWhite( buffer );
00017 if( buffer[ 0 ] == 's' )
00018 {
00019 Keyword k = VrmlNode::GetKeyword( buffer );
00020 assert( k = VRML_Scale );
00021 }
00022
00023 float x;
00024 float y;
00025 float z;
00026
00027
00028 int result;
00029 result = sscanf( buffer, "%f%f%f", &x, &y, &z );
00030 assert( result == 3 );
00031
00032
00033 while( buffer[ 0 ] != '\n' )
00034 {
00035 buffer++;
00036 }
00037
00038
00039 this->m_Matrix = Matrix4x4::Identity();
00040 this->m_Matrix.Scale( x, y, z );
00041
00042 EatWhite( buffer );
00043 if( buffer[ 0 ] == '}' )
00044 {
00045 buffer++;
00046 }
00047 }