AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
agx.h
Go to the documentation of this file.
1/*
2Copyright 2007-2024. 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
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 <typename T>
182 AGX_FORCE_INLINE operator T() const {
183 return (T) - 1;
184 }
185
186 // Comparison operators
187 template <typename T>
188 AGX_FORCE_INLINE bool operator == (T val) const {
189 return val == (T) - 1;
190 }
191
192 template <typename T>
193 AGX_FORCE_INLINE bool operator != (T val) const {
194 return val != (T) - 1;
195 }
196 };
197
198
199 // Comparison operators
200 template <typename T>
202 {
203 return val == (T) - 1;
204 }
205
206 template <typename T>
208 {
209 return val != (T) - 1;
210 }
211
212 extern AGXCORE_EXPORT const InvalidIndexStruct InvalidIndex;
213}
214
221namespace agxCore
222{
227
232
237}
238
239#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:199
#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.
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
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:207
bool operator==(T val, InvalidIndexStruct)
Definition agx.h:201
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
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