Panda3D

physxLinearInterpolationValues.h

00001 // Filename: physxLinearInterpolationValues.h
00002 // Created by:  enn0x (08Feb10)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef PHYSXLINEARINTERPOLATIONVALUES_H
00016 #define PHYSXLINEARINTERPOLATIONVALUES_H
00017 
00018 #include "pandabase.h"
00019 #include "pmap.h"
00020 
00021 #include "physx_includes.h"
00022 
00023 ////////////////////////////////////////////////////////////////////
00024 //       Class : PhysxLinearInterpolationValues
00025 // Description : 
00026 ////////////////////////////////////////////////////////////////////
00027 class EXPCL_PANDAPHYSX PhysxLinearInterpolationValues {
00028 
00029 public:
00030   INLINE PhysxLinearInterpolationValues();
00031   INLINE ~PhysxLinearInterpolationValues();
00032 
00033   void output(ostream &out) const;
00034 
00035   void clear();
00036   void insert(float index, float value);
00037   bool is_valid(float number) const;
00038   float get_value(float number) const;
00039   float get_value_at_index(int index) const;
00040   unsigned int get_size() const;
00041 
00042 private:
00043   float _min;
00044   float _max;
00045 
00046   typedef pmap<float, float> MapType;
00047   MapType _map;
00048 };
00049 
00050 INLINE ostream &operator << (ostream &out, const PhysxLinearInterpolationValues &values) {
00051   values.output(out);
00052   return out;
00053 }
00054 
00055 #include "physxLinearInterpolationValues.I"
00056 
00057 #endif // PHYSXLINEARINTERPOLATIONVALUES_H
 All Classes Functions Variables Enumerations