CommonLibVR
hkBaseTypes.h
Go to the documentation of this file.
1 #pragma once
2 
3 namespace RE
4 {
5  using hkObjectIndex = std::uint16_t;
6  using hkTime = float;
7 
8  enum class hkResult
9  {
10  kSuccess = 0,
11  kFailure = 1
12  };
13 
14  // 16-bit float with 7-bit precision
15  class hkHalf
16  {
17  public:
18  hkHalf();
19  explicit hkHalf(const float& a_val);
20 
21  hkHalf& operator=(const float& a_val);
22  operator float() const;
23 
24  protected:
25  void SetFloat(const float& a_val);
26  [[nodiscard]] float GetFloat() const;
27 
28  // members
29  std::int16_t _value; // 0
30  private:
31  KEEP_FOR_RE()
32  };
33  static_assert(sizeof(hkHalf) == 0x2);
34 
35  // 8-bit float ranging [0.01, 1000000.0]
36  // value is an index in a lookup table
37  class hkUFloat8
38  {
39  public:
40  // members
41  std::uint8_t value; // 0
42  private:
43  KEEP_FOR_RE()
44  };
45  static_assert(sizeof(hkUFloat8) == 0x1);
46 }
#define KEEP_FOR_RE()
Definition: PCH.h:713
Definition: hkBaseTypes.h:16
void SetFloat(const float &a_val)
std::int16_t _value
Definition: hkBaseTypes.h:29
float GetFloat() const
hkHalf(const float &a_val)
hkHalf & operator=(const float &a_val)
Definition: hkBaseTypes.h:38
std::uint8_t value
Definition: hkBaseTypes.h:41
Definition: AbsorbEffect.h:6
std::uint16_t hkObjectIndex
Definition: hkBaseTypes.h:5
hkResult
Definition: hkBaseTypes.h:9
float hkTime
Definition: hkBaseTypes.h:6