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