ODETools.h

Go to the documentation of this file.
00001 /*************************************************************************
00002  *                                                                       *
00003  * Open Physics Abstraction Layer                                        *
00004  * Copyright (C) 2004-2005                                               *
00005  * Alan Fischer  alan.fischer@gmail.com                                  *
00006  * Andres Reinot  andres@reinot.com                                      *
00007  * Tyler Streeter  tylerstreeter@gmail.com                               *
00008  * Oleksandr Lozitskiy mr.olexander@gmail.com                            *
00009  * All rights reserved.                                                  *
00010  * Web: opal.sourceforge.net                                             *
00011  *                                                                       *
00012  * This library is free software; you can redistribute it and/or         *
00013  * modify it under the terms of EITHER:                                  *
00014  *   (1) The GNU Lesser General Public License as published by the Free  *
00015  *       Software Foundation; either version 2.1 of the License, or (at  *
00016  *       your option) any later version. The text of the GNU Lesser      *
00017  *       General Public License is included with this library in the     *
00018  *       file license-LGPL.txt.                                          *
00019  *   (2) The BSD-style license that is included with this library in     *
00020  *       the file license-BSD.txt.                                       *
00021  *                                                                       *
00022  * This library is distributed in the hope that it will be useful,       *
00023  * but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00024  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files    *
00025  * license-LGPL.txt and license-BSD.txt for more details.                *
00026  *                                                                       *
00027  *************************************************************************/
00028 
00029 #ifndef OPAL_ODETOOLS_H
00030 #define OPAL_ODETOOLS_H
00031 
00032 #include "../opal.h"
00033 
00034 namespace opal
00035 {
00036         opal::Vec3r toVec3r( dVector3 vector )
00037         {
00038                 opal::real x, y, z;
00039                 x = static_cast<opal::real>( vector[0] );
00040                 y = static_cast<opal::real>( vector[1] );
00041                 z = static_cast<opal::real>( vector[2] );
00042 
00043                 return opal::Vec3r( x, y, z );
00044         }
00045 
00046         opal::Vec3r toVec3r( const dReal * vector )
00047         {
00048                 opal::real x, y, z;
00049                 x = static_cast<opal::real>( vector[0] );
00050                 y = static_cast<opal::real>( vector[1] );
00051                 z = static_cast<opal::real>( vector[2] );
00052 
00053                 return opal::Vec3r( x, y, z );
00054         }
00055 
00056         opal::Vec3r toVec3r_RadToDeg( dVector3 vector )
00057         {
00058                 opal::real x, y, z;
00059                 x = opal::radToDeg( static_cast<opal::real>( vector[0] ) );
00060                 y = opal::radToDeg( static_cast<opal::real>( vector[1] ) );
00061                 z = opal::radToDeg( static_cast<opal::real>( vector[2] ) );
00062 
00063                 return opal::Vec3r( x, y, z );
00064         }
00065 
00066         opal::Vec3r toVec3r_RadToDeg( const dReal * vector )
00067         {
00068                 opal::real x, y, z;
00069                 x = opal::radToDeg( static_cast<opal::real>( vector[0] ) );
00070                 y = opal::radToDeg( static_cast<opal::real>( vector[1] ) );
00071                 z = opal::radToDeg( static_cast<opal::real>( vector[2] ) );
00072 
00073                 return opal::Vec3r( x, y, z );
00074         }
00075 
00076         opal::Vec3r toVec3r_DegToRad( dVector3 vector )
00077         {
00078                 opal::real x, y, z;
00079                 x = opal::degToRad( static_cast<opal::real>( vector[0] ) );
00080                 y = opal::degToRad( static_cast<opal::real>( vector[1] ) );
00081                 z = opal::degToRad( static_cast<opal::real>( vector[2] ) );
00082 
00083                 return opal::Vec3r( x, y, z );
00084         }
00085 }
00086 
00087 #endif

Generated on Tue May 16 17:49:51 2006 for OPAL by  doxygen 1.4.6-NO