Beispiel #1
0
void	Quat::EncodeQuat( const Quat& q, ushort& s0, ushort& s1, ushort& s2 )
{
	if ( q.w < 0.0f )
	{
		s0 = EncodeComponent( -q.x );
		s1 = EncodeComponent( -q.y );
		s2 = EncodeComponent( -q.z );
	}
	else
	{
		s0 = EncodeComponent( q.x );
		s1 = EncodeComponent( q.y );
		s2 = EncodeComponent( q.z );	
	}
}
Beispiel #2
0
/*!
    \fn swText::Transform( const std::string& _str )
 */
PStr swText::Transform( const std::string& _str )
{
    if( _str.length() ) instring << _str;
    std::string s;
    _clear=false;
    _pos = 0;
    result = 0l;
    //////// DEBUG TRACE TESTS
    //Debug << " splitting contents:\n" <<
//             " \"" << CHigh << CRed << instring.data() << CReset << "\"";
    ///////////////////////////////////

    // Decomposer le texte en liste de composants <tag>,"texte"
    String::split(components, instring.data(), '<','>', true);
    

    //////// DEBUG TRACE TESTS
    //Dbg << "Number of components:" << CBrown << components.size() << CReset;
    /////////////////////////////
    std::list<std::string>::iterator it;
    _len  = instring.len();
    init_result();
    // Boucle centrale du parser
    for( it = components.begin(); it != components.end(); it++){
        s = *it;
      //  Dbg << "Encoding " << "'" << CCyan << s << CReset << "' @pos=" << _pos;
        (void)EncodeComponent( *it ); // return value is no use here.
    }

    ///////////////////////////////////
    //Dbg << "Clearing unneeded components list items. Not destroying result since it will by the owner";
    if( components.size() ) components.clear();
    //DEND;
    result[_pos] = (TCell)0; //
    return result;
    
}