basic/geometry/vrml_reader/VrmlTranslation.cpp

Go to the documentation of this file.
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 // Parse
00012 //
00013 // Description: Parses the rotation node from the file
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         //read in 3 floating point numbers
00029         int result;
00030         int size = strlen( buffer );
00031         result = sscanf( buffer, "%f%f%f", &x, &y, &z );
00032         assert( result == 3 );
00033 
00034         //advance to the end of the line
00035         while( buffer[ 0 ] != '\n' )
00036         {
00037                 buffer++;
00038         }
00039 
00040         //build the internal matrix
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 }

Generated on Sat Apr 1 21:30:34 2006 for Motion Planning Kernel by  doxygen 1.4.6-NO