lib/tdl-util.c
/**
 * Writes the position and orientation properly formated to a file.
 *
 * @param FILE *f - the file to write to
 * 		  float* pos - the position array 
 * 		  float* orient - the orientation array
 *
 */
Writes the position and orientation properly formated to a file.
@param FILE *f - the file to write to
float* pos - the position array
float* orient - the orientation array
Writes the position and orientation properly formated to a file . @param FILE * f - the file to write to float * pos - the position array float * orient - the orientation array
void tdl_write(FILE *f, float pos[3], float orient[9])
{
#ifdef _WIN32
	msg(MSG_ERROR, "This function is not defined on Windows.");
#else
	const int posSize = 3*(signed int)sizeof(float);
	const int orientSize = 9*(signed int)sizeof(float);
	if(fwrite(pos, posSize, 1, f) != 1)
	{
		perror("Writing position failed");
	}
	if(fwrite(orient, orientSize, 1, f) != 1)
	{
		perror("Writing orientation failed");
	}
#endif
}
void tdl_write ( FILE * f , float pos [ 3 ] , float orient [ 9 ] ) { #ifdef _WIN32 msg ( MSG_ERROR , " " ) ; #else const int posSize = 3 * ( signed int ) sizeof ( float ) ; const int orientSize = 9 * ( signed int ) sizeof ( float ) ; if ( fwrite ( pos , posSize , 1 , f ) != 1 ) { perror ( " " ) ; } if ( fwrite ( orient , orientSize , 1 , f ) != 1 ) { perror ( " " ) ; } #endif }
Writes the position and orientation properly formated to a file.
Writes the position and orientation properly formated to a file .