basic/geometry/vrml_reader/VrmlScale.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 "utility.h"
00007 #include "VrmlScale.h"
00008 
00009 //=============================================================================
00010 // Parse
00011 //
00012 // Description: Parses the rotation node from the file
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         //read in 3 floating point numbers
00028         int result;
00029         result = sscanf( buffer, "%f%f%f", &x, &y, &z );
00030         assert( result == 3 );
00031 
00032         //advance to the end of the line
00033         while( buffer[ 0 ] != '\n' )
00034         {
00035                 buffer++;
00036         }
00037 
00038         //build the internal matrix
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 }

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