00001 /* COPYRIGHT 00002 * 00003 * This file is part of the Visual Effects Engine - VEE 00004 * 00005 * Read the "VEE-LICENSE" file for the license. 00006 * 00007 * Authors & Copyright: 00008 * 00009 * Tommi Ilmonen, Tuukka Heikura, Marko Myllymaa and 00010 * Janne Kontkanen 2001-2004 00011 * 00012 * Additional copyrights: Tekes 2003-2004 00013 * 00014 * firstname.lastname@hut.fi 00015 * 00016 */ 00017 00018 #ifndef VEE_GRAVITY_H 00019 #define VEE_GRAVITY_H 00020 00021 #include <vee_scene.h> 00022 #include <vee_object.h> 00023 00027 class VEE_Gravity : public VEE_ForceObject 00028 { 00029 public: 00030 VEE_Gravity(VEE_Vector3 g = VEE_Vector3(0.0, -9.81, 0.0)); 00031 ~VEE_Gravity() {} 00032 00033 virtual bool setValue(const char *, VEE_Value *); 00034 virtual VEE_Variable getVariable(const char *) const; 00035 00036 virtual VEE_Object *clone() const; 00037 00038 VEE_Vector3 *gravity() { return &m_gravity; } 00039 void setGravity(const VEE_Vector3 &g) { m_gravity = g; } 00040 00041 void updateVelocity(float) {} 00042 void update(float) {} 00043 00044 void getForce(VEE_Vector3 *force, 00045 const VEE_Vector3 &, 00046 const VEE_Vector3 &); 00047 void boundingBoxOfForce(VEE_BoundingBox *box); 00048 00049 static VEE_Object * factory(); 00050 00051 protected: 00052 00053 VEE_Vector3 m_gravity; 00054 00055 private: 00056 }; 00057 00058 #endif