Panda3D
physxLinearInterpolationValues.h
1 // Filename: physxLinearInterpolationValues.h
2 // Created by: enn0x (08Feb10)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef PHYSXLINEARINTERPOLATIONVALUES_H
16 #define PHYSXLINEARINTERPOLATIONVALUES_H
17 
18 #include "pandabase.h"
19 #include "pmap.h"
20 
21 #include "physx_includes.h"
22 
23 ////////////////////////////////////////////////////////////////////
24 // Class : PhysxLinearInterpolationValues
25 // Description :
26 ////////////////////////////////////////////////////////////////////
27 class EXPCL_PANDAPHYSX PhysxLinearInterpolationValues {
28 
29 public:
31  INLINE ~PhysxLinearInterpolationValues();
32 
33  void output(ostream &out) const;
34 
35  void clear();
36  void insert(float index, float value);
37  bool is_valid(float number) const;
38  float get_value(float number) const;
39  float get_value_at_index(int index) const;
40  unsigned int get_size() const;
41 
42 private:
43  float _min;
44  float _max;
45 
47  MapType _map;
48 };
49 
50 INLINE ostream &operator << (ostream &out, const PhysxLinearInterpolationValues &values) {
51  values.output(out);
52  return out;
53 }
54 
55 #include "physxLinearInterpolationValues.I"
56 
57 #endif // PHYSXLINEARINTERPOLATIONVALUES_H