AGX Dynamics  2.35.0.1
agx.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. 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 
17 #ifdef _MSC_VER
18 # pragma warning(push)
19 # pragma warning(disable: 4251) // warning C4251: class X needs to have dll-interface to be used by clients of class Y
20 #endif
21 
22 #ifndef AGX_AGX_H
23 #define AGX_AGX_H
24 
25 #include <agx/config.h>
26 #include <agx/macros.h>
27 #include <agx/build_flags.h>
28 
29 #include <agx/agxPhysics_export.h>
30 #include <agx/agxCore_export.h>
31 #include <string.h>
32 
33 #include <agx/Math.h>
34 #include <agx/stdint.h>
35 #include <agx/debug.h>
36 
37 // Workaround for a bug in Visual Studio 2008-2013 where a C2039 could be issued when referencing a function foo
38 // defined in the same unnamed namespace with ::foo.
39 // See http://stackoverflow.com/questions/5503901/how-to-correctly-reference-a-function-in-an-anonymous-namespace
40 namespace {}
41 
46 namespace agx
47 {
52 
57 
62 
74  {
75  public:
78  };
79 
80 
81 
106  };
107 
110 
111 
117 
122  void AGXCORE_EXPORT setNumThreads(size_t numThreads);
123 
129 
135 
136  class Thread;
141 
142 
149 
154 
159 
164 
170  template <typename T>
171  AGX_FORCE_INLINE operator T() const {
172  return (T) - 1;
173  }
174 
175  // Comparison operators
176  template <typename T>
177  AGX_FORCE_INLINE bool operator == (T val) const {
178  return val == (T) - 1;
179  }
180 
181  template <typename T>
182  AGX_FORCE_INLINE bool operator != (T val) const {
183  return val != (T) - 1;
184  }
185  };
186 
187 
188  // Comparison operators
189  template <typename T>
191  {
192  return val == (T) - 1;
193  }
194 
195  template <typename T>
197  {
198  return val != (T) - 1;
199  }
200 
201  extern AGXCORE_EXPORT const InvalidIndexStruct InvalidIndex;
202 }
203 
210 namespace agxCore
211 {
216 
221 
226 }
227 
228 #ifdef _MSC_VER
229 # pragma warning(pop)
230 #endif
231 
232 #endif
#define AGXCORE_EXPORT
#define AGXPHYSICS_EXPORT
Convenience class to automatically call agx::init / agx::shutdown.
Definition: agx.h:74
agx::Thread is a representation of an OS specific implementation of a computational thread.
Definition: Thread.h:198
#define AGX_FORCE_INLINE
Definition: macros.h:58
Contains function for initialization and shutdown of agxCore library when agxPhysics is not used.
bool AGXCORE_EXPORT isShutdown()
void AGXCORE_EXPORT shutdown()
Shutdown the AGX API, after this call no AGX API calls should be done.
void AGXCORE_EXPORT init()
Deprecated, no need for explicit initialization.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
bool AGXPHYSICS_EXPORT isShutdown()
std::string AGXCORE_EXPORT getBuildConfigurationString(BuildConfiguration config)
void AGXCORE_EXPORT resetStartTick()
Reset the startTick value to the current tick.
void AGXCORE_EXPORT setNumThreads(size_t numThreads)
Set the number of threads to use (including the main thread).
uint64_t UInt64
Definition: Integer.h:41
BuildConfiguration
Specifies flags set at build time. Used when querying what is enabled in this current build.
Definition: agx.h:83
@ USE_COMPOSITE
Definition: agx.h:102
@ USE_OSG
Definition: agx.h:95
@ USE_64BIT_ARCHITECTURE
Definition: agx.h:84
@ USE_SSE
Definition: agx.h:88
@ USE_PARTICLE_SYSTEM
Definition: agx.h:99
@ NUM_BUILD_CONFIGURATIONS
Definition: agx.h:105
@ SABRE_USE_PADDING
Definition: agx.h:90
@ USE_OPENCL
Definition: agx.h:100
@ USE_DEBUG
Definition: agx.h:101
@ USE_OPENGL_INSTANCING
Definition: agx.h:86
@ USE_TOLUA
Definition: agx.h:92
@ USE_LUA
Definition: agx.h:91
@ SABRE_USE_SSE3
Definition: agx.h:89
@ WINDOWS_PLATFORM
Definition: agx.h:103
@ USE_TINYXML
Definition: agx.h:93
@ USE_AGXSENSOR
Definition: agx.h:97
@ USE_OPENGL
Definition: agx.h:94
@ UNITTEST_ENABLED
Definition: agx.h:96
@ USE_PREFETCHING
Definition: agx.h:87
@ USE_AGXCALLABLE
Definition: agx.h:98
@ SABRE_USE_METIS
Definition: agx.h:85
@ USE_ASSIMP
Definition: agx.h:104
AGXCORE_EXPORT bool getEntityCreationThreadSafe()
agx::Index AGXCORE_EXPORT getNumThreads()
bool operator!=(T val, InvalidIndexStruct)
Definition: agx.h:196
bool operator==(T val, InvalidIndexStruct)
Definition: agx.h:190
UInt64 AGXCORE_EXPORT getStartTick()
bool AGXCORE_EXPORT isBuiltWith(BuildConfiguration config)
void AGXPHYSICS_EXPORT shutdown()
Shutdown agx.
AGXCORE_EXPORT const InvalidIndexStruct InvalidIndex
void AGXPHYSICS_EXPORT init()
Initialize agx.
agx::Index AGXCORE_EXPORT getNumThreadsIncludingRegistered()
AGXCORE_EXPORT Thread * getCurrentThread()
AGXCORE_EXPORT void setEntityCreationThreadSafe(bool)
Iff true you can move the entity to another thread (but you may only use it from one thread at the ti...
UInt32 Index
Definition: Integer.h:52
Tag for invalid UInt values.
Definition: agx.h:169