physic.h
上传用户:qccn516
上传日期:2013-05-02
资源大小:3382k
文件大小:2k
源码类别:

游戏引擎

开发平台:

Visual C++

  1. /* Physic
  2.  *
  3.  * Copyright (C) 2003-2004, Alexander Zaprjagaev <frustum@frustum.org>
  4.  *
  5.  * This program is free software; you can redistribute it and/or modify
  6.  * it under the terms of the GNU General Public License as published by
  7.  * the Free Software Foundation; either version 2 of the License, or
  8.  * (at your option) any later version.
  9.  *
  10.  * This program is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  * GNU General Public License for more details.
  14.  *
  15.  * You should have received a copy of the GNU General Public License
  16.  * along with this program; if not, write to the Free Software
  17.  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  18.  */
  19. #ifndef __PHYSIC_H__
  20. #define __PHYSIC_H__
  21. class Joint;
  22. class RigidBody;
  23. class Physic {
  24. public:
  25. static void update(float ifps);
  26. protected:
  27. friend class RigidBody;
  28. friend class Joint;
  29. friend class JointBall;
  30. friend class JointHinge;
  31. friend class JointUniversal;
  32. static float time;
  33. static float time_step;
  34. static float gravitation;
  35. static float velocity_max;
  36. static float velocity_threshold;
  37. static float angularVelocity_threshold;
  38. static float time_to_frost;
  39. static float penetration_speed;
  40. static int num_first_iterations;
  41. static int num_second_iterations;
  42. static int all_joints;
  43. static int num_joints;
  44. static Joint **joints;
  45. static int all_rigidbodies;
  46. static int num_rigidbodies;
  47. static RigidBody **rigidbodies;
  48. };
  49. #endif /* __PHYSIC_H__ */