AGX Dynamics 2.41.3.2
Loading...
Searching...
No Matches
agx.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx 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
26
27#include <agx/config.h>
28#include <agx/macros.h>
29#include <agx/build_flags.h>
30
32#include <agx/agxCore_export.h>
33#include <string.h>
34
35#include <agx/Math.h>
36#include <agx/stdint.h>
37#include <agx/debug.h>
38
39// Workaround for a bug in Visual Studio 2008-2013 where a C2039 could be issued when referencing a function foo
40// defined in the same unnamed namespace with ::foo.
41// See http://stackoverflow.com/questions/5503901/how-to-correctly-reference-a-function-in-an-anonymous-namespace
42namespace {}
43
48namespace agx
49{
55
63
68
75
89 {
90 public:
93 };
94
117 };
118
121
122
128
133 void AGXCORE_EXPORT setNumThreads(size_t numThreads);
134
140
146
147 class Thread;
152
153
160
165
170
175
181 template <
182 typename T,
183 typename EnableT = std::enable_if_t<std::is_integral_v<T> || std::is_enum_v<T>>
184 >
185 AGX_FORCE_INLINE operator T() const {
186 return (T) - 1;
187 }
188
189 // Comparison operators
190 template <
191 typename T,
192 typename EnableT = std::enable_if_t<std::is_integral_v<T> || std::is_enum_v<T>>
193 >
194 AGX_FORCE_INLINE bool operator == (T val) const {
195 return val == static_cast<T>(-1);
196 }
197
198 template <
199 typename T,
200 typename EnableT = std::enable_if_t<std::is_integral_v<T> || std::is_enum_v<T>>
201 >
202 AGX_FORCE_INLINE bool operator != (T val) const {
203 return val != static_cast<T>(-1);
204 }
205 };
206
207
208 // Comparison operators
209 template <
210 typename T,
211 typename EnableT = std::enable_if_t<std::is_integral_v<T> || std::is_enum_v<T>>
212 >
214 {
215 return val == static_cast<T>(-1);
216 }
217
218 template <
219 typename T,
220 typename EnableT = std::enable_if_t<std::is_integral_v<T> || std::is_enum_v<T>>
221 >
223 {
224 return val != static_cast<T>(-1);
225 }
226
227 template <
228 typename T,
229 typename EnableT = std::enable_if_t<std::is_integral_v<T> || std::is_enum_v<T>>
230 >
232 {
233 return val == static_cast<T>(-1);
234 }
235
236 template <
237 typename T,
238 typename EnableT = std::enable_if_t<std::is_integral_v<T> || std::is_enum_v<T>>
239 >
241 {
242 return val != static_cast<T>(-1);
243 }
244
245 extern AGXCORE_EXPORT const InvalidIndexStruct InvalidIndex;
246}
247
248
249
256namespace agxCore
257{
262
267
272}
273
274#endif
#define AGXCORE_EXPORT
#define AGXPHYSICS_EXPORT
Convenience class to automatically call agx::init / agx::shutdown.
Definition: agx.h:89
agx::Thread is a representation of an OS specific implementation of a computational thread.
Definition: Thread.h:200
#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()
This method indicates if agx::shutdown() has been started or already done.
bool isValidIndex(T val)
Definition: agx.h:240
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:33
bool operator!=(T val, InvalidIndexStruct)
Definition: agx.h:222
AGXCORE_EXPORT Thread * getCurrentThread()
BuildConfiguration
Specifies flags set at build time. Used when querying what is enabled in this current build.
Definition: agx.h:96
@ USE_COMPOSITE
Definition: agx.h:113
@ USE_OSG
Definition: agx.h:106
@ USE_64BIT_ARCHITECTURE
Definition: agx.h:97
@ USE_SSE
Definition: agx.h:101
@ USE_PARTICLE_SYSTEM
Definition: agx.h:110
@ NUM_BUILD_CONFIGURATIONS
Definition: agx.h:116
@ SABRE_USE_PADDING
Definition: agx.h:103
@ USE_OPENCL
Definition: agx.h:111
@ USE_DEBUG
Definition: agx.h:112
@ USE_OPENGL_INSTANCING
Definition: agx.h:99
@ SABRE_USE_SSE3
Definition: agx.h:102
@ WINDOWS_PLATFORM
Definition: agx.h:114
@ USE_TINYXML
Definition: agx.h:104
@ USE_AGXSENSOR
Definition: agx.h:108
@ USE_OPENGL
Definition: agx.h:105
@ UNITTEST_ENABLED
Definition: agx.h:107
@ USE_PREFETCHING
Definition: agx.h:100
@ USE_AGXCALLABLE
Definition: agx.h:109
@ SABRE_USE_METIS
Definition: agx.h:98
@ USE_ASSIMP
Definition: agx.h:115
AGXCORE_EXPORT bool getEntityCreationThreadSafe()
agx::Index AGXCORE_EXPORT getNumThreads()
bool operator==(T val, InvalidIndexStruct)
Definition: agx.h:213
UInt64 AGXCORE_EXPORT getStartTick()
bool AGXCORE_EXPORT isBuiltWith(BuildConfiguration config)
void AGXPHYSICS_EXPORT shutdown()
Shutdown of the AGX Dynamics API will be done when the number of shutdown matches the number of calls...
bool AGXPHYSICS_EXPORT isInitialized()
AGXCORE_EXPORT const InvalidIndexStruct InvalidIndex
bool isInvalidIndex(T val)
Definition: agx.h:231
void AGXPHYSICS_EXPORT init()
Initialize AGX Dynamics API including thread resources and must be executed before using the AGX API.
agx::Index AGXCORE_EXPORT getNumThreadsIncludingRegistered()
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:44
Tag for invalid UInt values.
Definition: agx.h:180