root/OpenSceneGraph/trunk/src/osgPlugins/lib3ds/lib3ds_float.cpp
@
1563
| Revision 1563, 1.3 kB (checked in by robert, 10 years ago) | |
|---|---|
|
|
| Rev | Line | |
|---|---|---|
| [8] | 1 | /* |
| 2 | * The 3D Studio File Format Library | |
| 3 | * Copyright (C) 1996-2001 by J.E. Hoffmann <je-h@gmx.net> | |
| 4 | * All rights reserved. | |
| 5 | * | |
| 6 | * This program is free software; you can redistribute it and/or modify it | |
| [151] | 7 | * under the terms of the GNU Lesser General Public License as published by |
| 8 | * the Free Software Foundation; either version 2.1 of the License, or (at | |
| [8] | 9 | * your option) any later version. |
| 10 | * | |
| 11 | * This program is distributed in the hope that it will be useful, but | |
| 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | |
| [151] | 13 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public |
| [8] | 14 | * License for more details. |
| 15 | * | |
| 16 | * You should have received a copy of the GNU Lesser General Public License | |
| 17 | * along with this program; if not, write to the Free Software Foundation, | |
| 18 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
| 19 | * | |
| 20 | * $Id$ | |
| 21 | */ | |
| 22 | #define LIB3DS_EXPORT | |
| [1563] | 23 | #include "lib3ds_float.h" |
| [8] | 24 | |
| [151] | 25 | |
| [8] | 26 | /*! |
| 27 | * \defgroup float Floating Point Mathematics | |
| 28 | * | |
| 29 | * \author J.E. Hoffmann <je-h@gmx.net> | |
| 30 | */ | |
| 31 | ||
| [151] | 32 | |
| [8] | 33 | /*! |
| 34 | * \ingroup float | |
| 35 | */ | |
| 36 | Lib3dsFloat | |
| 37 | lib3ds_float_cubic(Lib3dsFloat a, Lib3dsFloat p, Lib3dsFloat q, Lib3dsFloat b, Lib3dsFloat t) | |
| 38 | { | |
| [151] | 39 | Lib3dsDouble x,y,z,w; |
| [8] | 40 | |
| [151] | 41 | x=2*t*t*t - 3*t*t + 1; |
| 42 | y=-2*t*t*t + 3*t*t; | |
| 43 | z=t*t*t - 2*t*t + t; | |
| 44 | w=t*t*t - t*t; | |
| 45 | return((Lib3dsFloat)(x*a + y*b + z*p + w*q)); | |
| [8] | 46 | } |
Note: See TracBrowser
for help on using the browser.
