00001 /********************************************************************* 00002 * lescegra * 00003 * * 00004 * http://geeky.kicks-ass.org/projects/lescegra.html * 00005 * * 00006 * Copyright 2003 by Enno Cramer <uebergeek@web.de> * 00007 * * 00008 * This library is free software; you can redistribute it and/or * 00009 * modify it under the terms of the GNU Library General Public * 00010 * License as published by the Free Software Foundation; either * 00011 * version 2 of the License, or (at your option) any later version. * 00012 * * 00013 * This library is distributed in the hope that it will be useful, * 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00016 * Library General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU Library General Public * 00019 * License along with this library; if not, write to the Free * 00020 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 00021 *********************************************************************/ 00022 00023 #ifndef LSG_SINE_ANIM_H 00024 #define LSG_SINE_ANIM_H 1 00025 00026 /** 00027 * \file sine_anim.h 00028 * \brief Animate a float using the sine function. 00029 * 00030 * \deprecated Can only update a single float value which leads to 00031 * out-of-date bounding boxes when used on node members. 00032 */ 00033 00034 #include <lescegra/sg/node.h> 00035 00036 /** 00037 * \brief Animate a float using the sine function. 00038 * 00039 * \deprecated Can only update a single float value which leads to 00040 * out-of-date bounding boxes when used on node members. 00041 */ 00042 typedef struct { 00043 Node super; 00044 float* target; 00045 float omega; 00046 float phi; 00047 float amplitude; 00048 float offset; 00049 } SineAnim; 00050 00051 SineAnim* sine_anim_create(float* target, float omega, float phi, float amp, float offs); 00052 void sine_anim_init(SineAnim* self, float* target, float omega, float phi, float amp, float offs); 00053 void sine_anim_update(SineAnim* self, float time); 00054 00055 #define sine_anim_clean(self) node_clean(&(self)->super) 00056 #define sine_anim_display(self, frust) node_display(&(self)->super, frust) 00057 #define sine_anim_destroy(self) node_destroy(&(self)->super) 00058 00059 #endif