AGX Dynamics  2.37.2.0
Types.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 #pragma once
17 
18 
19 
20 #include <agx/agxCore_export.h>
21 #include <agx/version.h>
22 
23 #include <agx/String.h>
24 #include <agx/Vec2.h>
25 #include <agx/Vec3.h>
26 #include <agx/Quat.h>
27 #include <agx/Range.h>
28 #include <agx/Matrix3x3.h>
29 #include <agx/SPDMatrix3x3.h>
30 
31 
32 
33 namespace agxStream
34 {
35  namespace ElementTypes
36  {
37  enum Type {
39  };
40  inline agx::UInt32 getElementType(const float&)
41  {
42  return FLOAT;
43  }
44 
45  inline agx::UInt32 getElementType(const double&)
46  {
47  return DOUBLE;
48  }
49 
50  template <typename T>
52  {
53  if (sizeof(T) == sizeof(float))
54  return VEC2F;
55  else
56  return VEC2D;
57  }
58 
59  template <typename T>
61  {
62  if (sizeof(T) == sizeof(float))
63  return VEC3F;
64  else
65  return VEC3D;
66  }
67 
68  template <typename T>
70  {
71  if (sizeof(T) == sizeof(float))
72  return VEC4F;
73  else
74  return VEC4D;
75  }
76 
77  template <typename T>
79  {
80  if (sizeof(T) == sizeof(float))
81  return QUATF;
82  else
83  return QUATD;
84  }
85 
86  template <typename T>
88  {
89  return OTHER;
90  }
91  }
92 }
93 
A class holding 4 dimensional vectors and providing basic arithmetic.
Definition: Vec4Template.h:34
The object holding quaternions and providing operations on these.
Definition: QuatTemplate.h:56
agx::UInt32 getElementType(const float &)
Definition: Types.h:40
A class holding 3 dimensional vectors and providing basic arithmetic.
Definition: Vec3Template.h:45
This namespace contain classes for streaming classes into archives, ASCII, binary for storage (serial...
uint32_t UInt32
Definition: Integer.h:40