Compare commits

...

213 Commits

Author SHA1 Message Date
SweetId a0f2b128d7 Rework Serialization functions
add name and handle more types
2024-03-05 17:26:07 -05:00
SirLynix 055634e77c Physics3D/RigidBody3D: Fix collisions after setting null collider 2024-02-25 18:27:47 +01:00
SirLynix 7f5f7668ec XMake: Don't install libxext/wayland if platform is disabled 2024-02-25 14:49:33 +01:00
SirLynix f572ae06a1 Switch FFMpeg plugin to LGPL and distribute it
This is possible now that ffmpeg package (from xmake-repo, see https://github.com/xmake-io/xmake-repo/pull/3315) allows building on Windows without GPL code
2024-02-25 14:33:08 +01:00
SirLynix 9f26fb00ad Network/ENetPeer: Fix crash when sending fragments 2024-02-24 22:29:15 +01:00
SirLynix f883305b3e Fix network unit tests 2024-02-24 20:38:42 +01:00
SirLynix 7b0165a7df Core/ByteArray: Make constructor taking a size set the size instead of capacity 2024-02-24 20:38:34 +01:00
SirLynix edac2e4af5 Network: Fix some warnings 2024-02-24 18:27:14 +01:00
SirLynix 7956e1552b Network: Remove NetPacket class
It was badly designed
2024-02-24 18:03:36 +01:00
SirLynix 03ff328b5b Core/ApplicationBase: Fix GetComponent 2024-02-23 23:28:10 +01:00
SirLynix e5da020b55 Fix missing include² 2024-02-23 23:12:38 +01:00
SirLynix 2137ddc94c Fix checkfiles 2024-02-23 22:53:36 +01:00
SirLynix 2d980bb304 Fix missing include 2024-02-23 22:50:38 +01:00
SirLynix 45019a0f97 Fix warning 2024-02-23 22:40:20 +01:00
SirLynix 23ea1989ef Core/ApplicationBase: Replace component indices with hashes
Fixes usage of components across DLL
2024-02-23 22:40:13 +01:00
SirLynix 1cb1750a74 Graphics/Model: Switch meshCallback to std::function 2024-02-22 20:15:47 +01:00
SirLynix f71d149785 Network/ENetPacket: Fix acknowledge callback on fragmented packets 2024-02-22 20:12:34 +01:00
SirLynix 62702ec481 Network/ENetPacket: Add OnAcknowledged signal 2024-02-22 19:38:25 +01:00
SirLynix f290cf2f9e Network/ENetProtocol: Fix missing inline keyword 2024-02-22 19:12:36 +01:00
SirLynix b08897628c Network/ENetPacket: Turn ENetPacketFlag into enum class 2024-02-22 19:12:20 +01:00
SirLynix e25fbe30e6 Math/Vector3: Add ProjectOnPlane 2024-02-22 19:11:25 +01:00
SirLynix 5180f24988 Math/Vector3: Add Project method 2024-02-22 18:04:07 +01:00
SirLynix 61764dfc3d Use embedded rule compile.shaders from nzsl package 2024-02-22 18:03:54 +01:00
SirLynix f121f32873 Core/Animation: Move Sequence and SequenceJoint to Animation 2024-02-19 22:45:55 +01:00
SirLynix 4d77a25a04 Update globalheaders 2024-02-19 22:43:14 +01:00
SirLynix 76136afe76 Core/Node: Remove "initial" methods prototypes
from 62a165126e
2024-02-19 17:20:42 +01:00
SirLynix 50ce9a4ea8 UnitTests/TCPTest: Give more time to test packet sending 2024-02-19 15:33:55 +01:00
SirLynix 5130a2ff84 Remove Config.hpp options and refactor headers
- Rename Config.hpp to Export.hpp
- Remove Debug.hpp and DebugOff.hpp (not used anymore)
2024-02-19 15:11:34 +01:00
SirLynix 3c7e2a1685 Core/Animation: Remove loop-point interpolation boolean 2024-02-19 11:00:04 +01:00
SirLynix d9ad489820 Core/Animation: Fix RemoveSequence not shifting indices and deleting name 2024-02-19 10:59:47 +01:00
SirLynix 62a165126e Core/Node: Remove initial position/rotation/scale 2024-02-19 09:44:01 +01:00
SirLynix 63c526cecc Core/Node: Refactor interface
- Removed overloads taking multiple scalars
- Removed CoordSys parameter (functions exists in two sets, local and global)
2024-02-19 09:44:01 +01:00
SirLynix 194dba5002 Core/Animation: Improve performance of AnimateSkeleton 2024-02-18 16:55:23 +01:00
SirLynix 0cb376a161 Update check-files 2024-02-15 11:19:31 +01:00
Lynix 3756f93f51 Grqphics. Make module depend on TextRenderer 2024-02-14 20:38:18 +01:00
Lynix 7e1c38435c Core/File: Improve implementation 2024-02-13 18:07:46 +01:00
Lynix 67904abd29 Replace Warning string concatenation by WarningFmt 2024-02-13 17:17:04 +01:00
Lynix ad5336eff7 Physics2D: Rename Physics2DSystem source file 2024-02-12 14:36:18 +01:00
SirLynix 66e3734942 Core/Node: Make destructor lighter 2024-02-11 22:50:20 +01:00
SirLynix e4c339293b Renderer: Fix warning and comment 2024-02-11 22:49:48 +01:00
SirLynix c6f87f9cd2 UnitTests: Increase process test delay 2024-02-11 22:48:38 +01:00
SirLynix e64c2b036e Remove Utility module and move its content to Core and TextRenderer modules 2024-02-11 22:48:38 +01:00
SirLynix 965a00182c Physics3D: Rename Physiscs3DStepListener to PhysWorld3DStepListener 2024-02-10 14:23:01 +01:00
SirLynix 8c41ac30c9 Physics3D: Rename Physics3DBody to PhysBody3D 2024-02-10 14:20:47 +01:00
SirLynix 9e3ca2472b Fix compilation 2024-02-10 13:50:10 +01:00
SirLynix 57ad486c01 Minor fixes 2024-02-10 13:42:19 +01:00
Lynix e336c8a514 Rename ChipmunkPhysics2D and JoltPhysics3D to Physics[2D|3D] 2024-02-09 22:24:15 +01:00
Lynix 139bed2b0a Remove BulletPhysics3D module
Having two physics engine seems redundant, Bullet3 development seems to have halted and JoltPhysics seems to be a better fit to Nazara
2024-02-09 22:24:15 +01:00
Jérôme Leclercq cb484a2432 Update coverage.yml 2024-02-09 21:58:08 +01:00
dependabot[bot] b65339deee Bump codecov/codecov-action from 3 to 4
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3 to 4.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-09 21:58:08 +01:00
SirLynix fe00b3fd16 Build: Don't link with system-installed libs on CI
Same but less aggressive
2024-02-09 16:57:21 +01:00
SirLynix bc6521cb7c Build: Don't link with system-installed libs on CI 2024-02-09 14:39:55 +01:00
SirLynix 89c08d3925 OpenGLRenderer/ContextObject: Fix destruction after move 2024-02-09 13:48:19 +01:00
SirLynix 23645fc398 Widgets: Add SimpleLabelWidget
A simpler alternative to LabelWidget
2024-02-08 00:24:31 +01:00
SirLynix f0b4674039 Plugins/Assimp: Don't use Matrix4f::Transform for a scale 2024-02-07 15:56:58 +01:00
SirLynix 18b6d14670 Graphics/Model: Add mesh callback parameter
It allows to query/save/update the mesh before it's used to create a GraphicalMesh and disposed of
2024-02-07 15:56:16 +01:00
SirLynix 5a46ebda36 Graphics/PropertyHandler: Warn if an option if set but doesn't exist in material 2024-02-07 15:55:14 +01:00
SirLynix 37e90ecea9 Graphics/Materials: Fix normal maps for PhongMaterial 2024-02-07 15:53:09 +01:00
SirLynix 8a5e5f7643 Core/PluginLoader: Add [[nodiscard]] qualifier to Load function 2024-02-07 15:51:07 +01:00
SirLynix b889c992ea VulkanRenderer/Loader: Don't rely on std::filesystem::path constructor taking a const char* 2024-02-06 17:06:39 +01:00
SirLynix 993722ed0b Fix unity build compilation 2024-02-06 13:50:51 +01:00
SirLynix d3f7e20473 Widgets/TextAreaWidget: Fix clipboard paste cursor with non-ascii chars 2024-02-06 13:28:08 +01:00
SirLynix 99952db736 Core/TaskScheduler: Fix shutdown data-race 2024-02-06 13:27:39 +01:00
SirLynix 17b6449472 UnitTests/Process: Increase waiting duration
GitHub CI seems very slow at this
2024-02-06 11:09:17 +01:00
SirLynix 67f78b25f2 Update EnTT version to 3.13.1 2024-02-06 11:08:38 +01:00
SirLynix ff4277e97f CI: Save asan packages in a different cache 2024-02-05 16:56:00 +01:00
SirLynix bcd64a0ad0 Core/TaskScheduler: Remove tsan workaround 2024-02-05 16:53:00 +01:00
SirLynix a4827a99a0 Core/TaskScheduler: Make implementation private 2024-02-05 15:59:45 +01:00
SirLynix 3eae055d3a Core/TaskScheduler: Replace atomic queue from wsq to concurrentqueue
This is because wsq makes stealing work by stealing from the opposite end of the queue which will be a problem in the long term
2024-02-05 15:08:36 +01:00
SirLynix a30f64ef49 Core/TaskScheduler: Increase shutdown performance
Tell all threads to exit and join them all at once instead of one by one
2024-02-04 13:46:06 +01:00
SirLynix b69c0bb444 Core/TaskScheduler: Fix deadlock when exiting
If a worker was not given a task, it could happen to ignore the exit signal (for example if it's set before the worker started, causing it to clear the notifier boolean and test it again before checking m_running)
2024-02-04 13:43:55 +01:00
SirLynix 44617bd14d Core/TaskScheduler: Another try to remove race condition 2024-02-04 13:04:29 +01:00
SirLynix c148bc2851 UnitTests: Increase task scheduler wait duration
it seems GitHub CI is pretty bad at scheduling threads
2024-02-03 23:24:41 +01:00
SirLynix 3a612d8655 Minor fixes 2024-02-03 22:56:58 +01:00
SirLynix 19935a2b07 CI: Remove macOS temporary fix against xmake issue 2024-02-03 22:56:48 +01:00
SirLynix aca5a7a00d CI: Fix msys2 package name 2024-02-03 22:52:08 +01:00
SirLynix e3ad9be759 Core/TaskScheduler: Fix work ending condition
Use remaining task count instead of idle worker count, this avoids a race condition where a worker signals idle after being tasked with a new job
2024-02-03 22:40:12 +01:00
SirLynix 59e172c2ee CI: Add static job 2024-02-03 22:35:55 +01:00
SirLynix 91c9706016 Build: Fix OpenGL/Vulkan packages in static/embedded_renderer
Build: Fix circular dependencies when compiling static

Update xmake.lua
2024-02-03 22:35:55 +01:00
SirLynix 8b9b47ba59 Core/TaskScheduler: Fix WaitForTasks returning before all tasks are executed
This could happen because a worker only counts as active when starting a job, but after acquiring one.

So one possibility was that :
1. All workers except W1 and W2 are idle
2. W1 is about to notify as idle, as W2 got a task (but did not notify as active yet)
3. W1 notifies as idle, idle count == worker count -> wake main thread
4. W2 didn't run its task yet
2024-02-03 14:41:10 +01:00
SirLynix 653e56f8ce Network/ENetHost: Remove unused mt19937_64 2024-02-03 14:31:52 +01:00
SirLynix d2b3b93646 Fix compilation 2024-02-02 23:48:35 +01:00
SirLynix c303bf9283 Core/TaskScheduler: Use WorkStealingQueue::pop
steal() can incorrectly return nullptr even if the list is not empty in case of concurrent access, but push and pop are not threadsafe so we use a spinlock to prevent concurrent uses
2024-02-02 23:19:29 +01:00
SirLynix 2e56bb4db4 Build: Disable -Wtrampolines on Clang 2024-02-02 21:19:27 +01:00
SirLynix e3fa6fed89 Core/TaskScheduler: Fix TSan false-positive and remove std::optional 2024-02-02 21:19:17 +01:00
SirLynix 06a42b4ecb Cleanup code 2024-02-02 17:31:12 +01:00
SirLynix adc6a5c0a5 Tests: Add task scheduler tests 2024-02-02 16:23:01 +01:00
SirLynix fa73e463a6 Core/TaskScheduler: Fix race conditions when calling AddTask while workers are not idle
Update TaskScheduler.cpp
2024-02-02 16:23:00 +01:00
SirLynix 44e55adcd9 Tests: Add negative Time formatting tests 2024-02-02 14:31:40 +01:00
SirLynix 56751072f5 Add SchedulerBenchmark test 2024-02-02 14:27:37 +01:00
SirLynix 7f1ef0fe41 Core/TaskScheduler: Rework using atomics and WorkStealingQueue 2024-02-02 14:27:18 +01:00
SirLynix 5db0c4ed09 Core/Time: Fix operator<< with negative values not using units 2024-02-01 12:57:29 +01:00
SirLynix 369f273894 Core/TaskScheduler: Fix AddTask 2024-02-01 09:53:17 +01:00
SirLynix 5d6a094bfe Core/TaskScheduler: Add std::hardware_destructive_interference_size fallback
It was implemented in GCC 12.1 which is not yet available on the CI
2024-01-31 22:16:35 +01:00
SirLynix 9db333fa80 Core/TaskScheduler: Remove jthread and stop_token
jthread/stop_token are not yet implemented in libc++ and on Apple Clang
2024-01-31 21:04:42 +01:00
Lynix 47283776e6 VulkanRenderer: Fix warning 2024-01-31 16:42:35 +01:00
Lynix 9d669f722e Core: Rework TaskScheduler (WIP) 2024-01-31 16:42:25 +01:00
Lynix 2b88f50c21 Minor improvements 2024-01-29 18:34:46 +01:00
SirLynix 0191256493 Fix Nz::ErrorFlags API and usage 2024-01-28 15:03:24 +01:00
SirLynix f06752b08d Renderer/WindowSwapchain: Fix calls to GetSize() happening after window destruction 2024-01-28 13:56:06 +01:00
SirLynix 01d3795dae Network/ENetPeer: Fix HasPendingCommands (fixes DisconnectLater) 2024-01-27 16:45:13 +01:00
SirLynix b29ecdf0db Widgets/AbstractTextAreaWidget: Add support for additional copy/cut/past shortcut
- ctrl + insert (copy)
- shift + insert (paste)
- shift + delete (cut)
2024-01-27 15:12:08 +01:00
SirLynix aad271febe Core/Algorithm: Use SafeCast to serialize string size 2024-01-26 17:23:32 +01:00
SirLynix 33374ed0c0 Widgets/TextAreaWidget: Improve text shifting when cursor is out of bounds 2024-01-26 16:16:13 +01:00
SirLynix c931e9a509 Widgets/TextAreaWidget: Add a way to limit text length 2024-01-26 16:15:53 +01:00
SirLynix f10671ac2a Core/StringExt: Add TrimLeftCount and TrimRightCount 2024-01-26 15:11:31 +01:00
SirLynix 22a047b3b1 Add tab outside of indent check 2024-01-26 14:38:59 +01:00
SirLynix 6757de1be8 Add end-of-line spaces checker 2024-01-26 10:43:00 +01:00
SirLynix 63c61c0827 Core/StringExt: Fix IsNumber returning true for "-" 2024-01-26 10:11:07 +01:00
SirLynix d3fabf21d6 Core/Posix: Use _exit instead of exit for intermediary process 2024-01-26 10:07:26 +01:00
SirLynix 625b4f2d9f Core/StringExt: Add Substring family of function (unicode-aware) 2024-01-26 10:02:15 +01:00
SirLynix 1f34bb58ea Core/EnttWorld: Use in_use instead of free_list to get entity count
Since in_use  seems to be deprecated
2024-01-26 10:00:25 +01:00
SirLynix 2d3d7a670f Update to latest NazaraUtils version 2024-01-25 17:36:44 +01:00
SirLynix 7f1641e4b6 Update EnTT version 2024-01-25 14:40:32 +01:00
SirLynix 9ada93b995 Remove spaces before line feed 2024-01-25 14:38:06 +01:00
SirLynix fccbaf435c Assets: Remove line feed to 2024-01-25 11:54:33 +01:00
SirLynix 771ab670c0 Widgets: Update default theme buttons to work better at low sizes 2024-01-25 10:16:10 +01:00
SirLynix 795ce90234 Build: Set C++ exceptions flags instead of leaving the compiler defaults 2024-01-25 10:15:43 +01:00
Lynix af55f9fcdb Fix unity build compilation on Windows 2024-01-24 20:34:18 +01:00
SirLynix a116f1fc8d Network: Add WebServiceAppComponent 2024-01-24 17:43:16 +01:00
SirLynix e01f6730ef Network/WebService: Add QueueRequest overload taking a builder functor 2024-01-24 17:42:43 +01:00
SirLynix 086152c97d Core/ApplicationBase: Add methods to query components 2024-01-24 17:41:57 +01:00
SirLynix e14614cf41 Update checkfiles system headers 2024-01-24 16:51:58 +01:00
SirLynix 0cec655af6 Update checkfiles.lua 2024-01-24 16:50:20 +01:00
SirLynix bb3b28279b Rename AppComponent classes (AppEntitySystemComponent => EntitySystemAppComponent) 2024-01-24 16:50:04 +01:00
SirLynix 3421c0f50b Update createclass.lua 2024-01-24 16:34:26 +01:00
SirLynix 72bd6efcc4 Replace OpenGL headers by opengl-headers xmake package 2024-01-24 16:34:22 +01:00
dependabot[bot] e9c3fe270a Bump actions/cache from 3 to 4
Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-24 13:38:16 +01:00
dependabot[bot] b97da658a8 Bump mymindstorm/setup-emsdk from 13 to 14
Bumps [mymindstorm/setup-emsdk](https://github.com/mymindstorm/setup-emsdk) from 13 to 14.
- [Release notes](https://github.com/mymindstorm/setup-emsdk/releases)
- [Commits](https://github.com/mymindstorm/setup-emsdk/compare/v13...v14)

---
updated-dependencies:
- dependency-name: mymindstorm/setup-emsdk
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-24 13:38:03 +01:00
SirLynix 88ae92baa0 CI: Cache asset downloading
Assets are downloaded from a single server which doesn't have enough bandwidth for 20 concurrent downloads
2024-01-24 12:00:07 +01:00
SirLynix 830e167027 CI: Install nightlies to the 0.0.0 nightly tag 2024-01-24 11:16:59 +01:00
SirLynix 9e9501e264 CI: Install dependencies with -vD (temp fix for macOS hang)
see https://github.com/xmake-io/xmake/issues/4645
2024-01-24 10:47:49 +01:00
SirLynix 496de948d2 Core/Posix: Fix O_CLOEXEC on pipes 2024-01-23 19:31:21 +01:00
SirLynix 37be90b1f7 Fix compilation on macOS 2024-01-23 19:31:21 +01:00
SirLynix 020f431c72 UnitTests/Process: Increase wait durations 2024-01-23 19:31:21 +01:00
SirLynix 0e5e3ab9dd UnitTests/Process: Flush files to avoid read issues 2024-01-23 19:31:21 +01:00
SirLynix a228325bd5 Add process unit tests 2024-01-23 19:31:21 +01:00
SirLynix a02990beff Core/Posix: Rework implementation (using posix_spawn) 2024-01-23 19:31:21 +01:00
SirLynix b63c9fcc49 Core/Process: Add Exists function 2024-01-23 19:31:21 +01:00
SirLynix b0648918a7 Core/Process: Add GetCurrentPid 2024-01-23 19:31:21 +01:00
SirLynix 9c102638c0 Fix unity build compilation 2024-01-23 19:31:21 +01:00
SirLynix 65c8d2e8de Add reference link 2024-01-23 19:31:21 +01:00
SirLynix 8ee128b475 Core/Process: Improve Posix implementation
- Handle chdir errors
- Calls _exit if execve failed
- Better format the code
2024-01-23 19:31:21 +01:00
SirLynix ac1422c221 Core: Add initial process support (Process::SpawnDetached) 2024-01-23 19:31:21 +01:00
SirLynix 278e59934b Fix compilation on macOS 2024-01-23 17:45:10 +01:00
SirLynix f4095d07a8 xmake check-files -f 2024-01-22 23:15:03 +01:00
SirLynix 05ee3d7a55 Core/Win32: Use native string instead of generic in Windows code 2024-01-22 23:08:31 +01:00
SirLynix 9caaff2898 Fix build on wasm 2024-01-22 21:02:02 +01:00
SirLynix 639f6708b0 Core/StringExt: Replace ptr + size by a view in IterateOnCodepoints parameter
Also increase buffer size to increase performance
2024-01-22 17:02:26 +01:00
SirLynix 8dab084037 Core/Win32: Add PathToWideTemp function 2024-01-22 16:58:12 +01:00
SirLynix 373309d6d9 Core: Move platform-specific code to PlatformImpl namespace 2024-01-22 16:49:21 +01:00
SirLynix 3557040246 Replace utf8cpp, Vulkan and VMA headers by xmake packages 2024-01-22 16:44:50 +01:00
SirLynix 0a433a8bd6 Core/FileLogger: Fix compilation 2024-01-16 18:15:38 +01:00
SirLynix 9b96503fde Remove test that was wrongly commited 2024-01-16 15:22:30 +01:00
SirLynix c8e07b3f3f Network/WebRequest: Fix missing option handling
That part belongs to f1de6f9198 but was not commited
2024-01-16 15:21:42 +01:00
SirLynix e355144bb6 Network/WebRequest: Add progress callback 2024-01-16 15:21:19 +01:00
SirLynix 964d32b34e Widgets: Add ProgressBarWidget 2024-01-16 14:13:06 +01:00
SirLynix c8776bc950 Core/Color: Add dark colors 2024-01-16 14:06:57 +01:00
SirLynix 8ca7c2e8ee Core/Color: Add some operators 2024-01-16 14:06:45 +01:00
SirLynix bbef5cfd1d Color: Replace std::ostringstream usage by Format 2024-01-16 14:06:19 +01:00
Lynix ea4b8eaaea VulkanRenderer: Fix descriptor pool sizes when using arrays 2024-01-15 14:30:56 +01:00
SirLynix d3899d71f3 CI: Fix webassembly archs 2024-01-14 23:05:50 +01:00
SirLynix f1de6f9198 Network/WebRequest: Add option flags 2024-01-14 23:03:45 +01:00
SirLynix c52ffa15c4 Widgets/BoxLayout: Center widgets on the other axis 2024-01-14 22:04:02 +01:00
SirLynix db83413536 Graphics: Fix issue when unregistering viewer then adding it again before resources are cleaned 2024-01-14 16:01:55 +01:00
SirLynix 5c7059c8fc Minor fixes 2024-01-13 16:19:46 +01:00
Lynix f45c2c5008 Build: Cleanup Windows syslinks
Use correct cases (just in case) and remove gdi32 link as it's not necessary (gdi32 is loaded dynamically by OpenGL Renderer)
2024-01-08 18:18:04 +01:00
SirLynix 6a4d3008c9 Fix compilation 2024-01-05 11:37:45 +01:00
SirLynix 2bdd6f9351 Graphics/Model: Add model loader 2024-01-05 11:24:25 +01:00
SirLynix 201ac025e2 Graphics: Fix compilation 2024-01-05 11:23:55 +01:00
SirLynix e8a362b695 Graphics/MaterialInstance: Add Build method 2024-01-04 17:47:54 +01:00
SirLynix 7ae76b32b0 Utility: Rework MaterialData 2024-01-04 17:47:41 +01:00
SirLynix 1eb72af57e CI: Save dependencies cache even if compilation/tests fail 2024-01-04 14:53:40 +01:00
SirLynix 2125b80b8d Use std::string_view for strings 2024-01-04 14:40:50 +01:00
SirLynix 0cd8cff53e OpenGLRenderer: Minor improvements 2024-01-04 10:19:38 +01:00
SirLynix f46f0da12a Graphics/Shaders: Fix point and spot lights in PhysicallyBasedMaterial 2024-01-04 00:03:32 +01:00
SirLynix 5a96ab3bf7 Graphics/PipelinePassList: Add AddPass overload taking a pass name 2024-01-03 18:18:09 +01:00
SirLynix 14f51b31ca Fix a bunch of warnings 2024-01-03 18:17:52 +01:00
SirLynix cd8c1cb160 Replace reinterpret_cast from/to pointers to BitCast 2024-01-03 17:19:42 +01:00
SirLynix 6d1e7d7852 Fix compilation on Windows 2024-01-02 13:07:38 +01:00
SirLynix 7dc7104cc4 Update to latest nazarautils 2024-01-02 12:02:45 +01:00
SirLynix d2e2c075b4 Update copyright year 2024-01-02 12:02:14 +01:00
SirLynix 448cf66846 Minor fixes 2024-01-02 11:50:04 +01:00
SirLynix 7b30c0ac5c XMake: Update nzsl config 2023-12-31 13:59:20 +01:00
Jérôme Leclercq 79ec135af7
Optimize out a lot of std::string construction and allocations (#415)
Update CommandLineParameters.hpp

Update CommandLineParametersTests.cpp

Update WebContext.hpp

xmake check-files -f

Fix MaterialPassRegistry
2023-12-30 14:50:57 +01:00
SirLynix f7c9060364 UnitTests: Replace Google DNS with Cloudflare DNS 2023-12-30 11:40:20 +01:00
SirLynix 0d37e36b0c Fix UnitTests 2023-12-30 11:14:38 +01:00
SirLynix 69efb93671 Network/IpAddress: Add a parameter to exclude port from string 2023-12-30 11:14:29 +01:00
Jérôme Leclercq 8e6ca9cb27
Fix compilation 2023-12-30 09:09:05 +01:00
Jérôme Leclercq 7d0d1feea4
Update IpAddress tests
It looks like Google changed their dns
2023-12-30 09:02:01 +01:00
Jérôme Leclercq 3fa3ccc0e0
Improve IP Address tests 2023-12-29 16:08:24 +01:00
Lynix 8a32c748bb Physics2D/ChipmunkRigidBody2D: Fix SetGeom 2023-12-28 17:47:15 +01:00
SirLynix 08eaf396ed Update to NazaraUtils 2023.12.28 2023-12-28 13:26:04 +01:00
SirLynix 3d21401569 Fix compilation on Windows < Vista 2023-12-28 13:25:33 +01:00
SirLynix 4039d16df0 Graphics/Camera: Fix camera copy / movement by assignation 2023-12-27 17:13:50 +01:00
SirLynix b37aaf6173 Fix some comments 2023-12-26 12:42:15 +01:00
SirLynix 9da6e2ef8c ChipmunkPhysics2D: Fix kinematic body handling 2023-12-26 12:42:08 +01:00
SirLynix 0d3a9547fc Graphics/PipelinePassList: Fix error introduced by 9fb308a531 2023-12-26 12:41:48 +01:00
Lynix e1b3832643 Minor cleanup 2023-12-25 21:02:24 +01:00
Lynix 9fb308a531 Graphics/FramePipelinePass: Replace pointer + size by span 2023-12-25 20:05:45 +01:00
Lynix 7cd1b32e95 Core/File: Add DecodeOpenMode 2023-12-25 19:51:19 +01:00
Lynix 4065fbfb1a Core/OpenMode: Rename ReadOnly/WriteOnly to Read/Write 2023-12-25 19:49:03 +01:00
SirLynix 754a3d3614 Update unit tests for angle normalization change introduced in 6dc27e7948 2023-12-23 14:36:04 +01:00
SirLynix 91221a9b4a Minor changes 2023-12-23 14:01:04 +01:00
SirLynix 6dc27e7948 Math/Angle: Fix Normalization range ([0;360] => [-180;180]) 2023-12-23 13:37:22 +01:00
SirLynix 496800fc5c Graphics/UberShader: throw an exception if shader module couldn't be resolved 2023-12-21 00:08:30 +01:00
SirLynix 92e9a75ffa Platform: Add MessageBox 2023-12-21 00:08:14 +01:00
SirLynix baaea2a33f Math: Improve code 2023-12-20 16:13:36 +01:00
SirLynix f2201404f3 Core/Clock: Add Tick method 2023-12-18 12:15:08 +01:00
SirLynix 8efebef26c Graphics/UberShader: Replace missing UInt32 by the new OptionHash using 2023-12-17 21:07:58 +01:00
SirLynix 83366e93d4 Make changes for breaking NZSL update
Fix build

Fix compilation (again)

Fix global included

TextureAsset belongs to another branch

Add missing include

Fix include (should be good, finally)
2023-12-17 20:40:45 +01:00
SirLynix 87bf4563f2 Update auto-gen files 2023-12-17 16:00:44 +01:00
SirLynix b7bdc74f3f Graphics/SpotLight: Add UpdateAngles method 2023-12-17 15:59:53 +01:00
1632 changed files with 16155 additions and 91833 deletions

View File

@ -21,12 +21,12 @@ jobs:
strategy:
matrix:
config:
- { name: "Windows x64", os: windows-latest, arch: x64 }
- { name: "Ubuntu x86_64", os: ubuntu-latest, arch: x86_64 }
- { name: "Windows", os: windows-latest, arch: x64 }
- { name: "Ubuntu", os: ubuntu-latest, arch: x86_64 }
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
if: "!contains(github.event.head_commit.message, 'coverage skip')"
if: ${{ !contains(github.event.head_commit.message, 'coverage skip') }}
steps:
- name: Get current date as package key
@ -71,38 +71,49 @@ jobs:
# Fetch xmake dephash
- name: Retrieve dependencies hash
if: runner.os == 'Linux'
id: dep_hash_linux
id: dephash
run: echo "hash=$(xmake l utils.ci.packageskey)" >> $GITHUB_OUTPUT
- name: Retrieve dependencies hash
if: runner.os == 'Windows'
id: dep_hash_windows
run: echo "hash=$(xmake l utils.ci.packageskey)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
shell: bash
# Cache xmake dependencies
- name: Retrieve cached xmake dependencies (Linux)
if: runner.os == 'Linux'
uses: actions/cache@v3
- name: Restore cached xmake dependencies
id: restore-depcache
uses: actions/cache/restore@v4
with:
path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
key: Linux-${{ matrix.config.arch }}-coverage-${{ steps.dep_hash_linux.outputs.hash }}-W${{ steps.cache_key.outputs.key }}
- name: Retrieve cached xmake dependencies (Windows)
if: runner.os == 'Windows'
uses: actions/cache@v3
with:
path: ${{ env.XMAKE_GLOBALDIR }}\.xmake\packages
key: MSVC-${{ matrix.config.arch }}-coverage-${{ steps.dep_hash_windows.outputs.hash }}-W${{ steps.cache_key.outputs.key }}
key: ${{ matrix.config.name}}-${{ matrix.config.arch }}-coverage-${{ steps.dephash.outputs.hash }}-W${{ steps.cache_key.outputs.key }}
# Setup compilation mode and install project dependencies
- name: Configure xmake and install dependencies
run: xmake config --arch=${{ matrix.config.arch }} --mode=coverage --ccache=n --ffmpeg=y --shadernodes=y --tests=y --unitybuild=y --yes
# Save dependencies
- name: Save cached xmake dependencies
if: ${{ !steps.restore-depcache.outputs.cache-hit }}
uses: actions/cache/save@v4
with:
path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
key: ${{ steps.restore-depcache.outputs.cache-primary-key }}
# Cache assets downloading
- name: Restore cached assets
id: restore-assets
uses: actions/cache/restore@v4
with:
path: assets
key: assets-${{ hashFiles('assets/examples_version.txt', 'assets/unittests_version.txt') }}
# Build the engine
- name: Build Nazara
run: xmake --yes
- name: Save downloaded assets
if: ${{ !steps.restore-assets.outputs.cache-hit }}
uses: actions/cache/save@v4
with:
path: assets
key: ${{ steps.restore-assets.outputs.cache-primary-key }}
# Run unit tests to generate coverage reports
- name: Run unit tests and generate coverage output (Linux)
if: runner.os == 'Linux'
@ -117,7 +128,8 @@ jobs:
"C:\Program Files\OpenCppCoverage\OpenCppCoverage.exe" --export_type cobertura:coverage.out --sources "NazaraEngine\include\Nazara\*" --sources "NazaraEngine\src\Nazara\*" --modules "NazaraEngine\bin\*" --cover_children -- xmake run UnitTests
- name: Upload Coverage Report to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
files: ./coverage.out
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

View File

@ -23,15 +23,16 @@ jobs:
matrix:
os: [ubuntu-latest]
arch: [x86_64]
kind: [shared, static]
confs:
- { mode: debug }
- { mode: debug, config: --asan=y }
- { mode: debug, config: --lsan=y }
- { mode: debug, config: --tsan=y }
- { mode: releasedbg }
- { mode: debug, archive: yes }
- { mode: debug, config: --asan=y, archive: false, cache_key: -asan }
- { mode: debug, config: --lsan=y, archive: false }
- { mode: debug, config: --tsan=y, archive: false }
- { mode: releasedbg, archive: yes }
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'ci skip')"
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
steps:
- name: Get current date as package key
@ -68,35 +69,74 @@ jobs:
run: echo "hash=$(xmake l utils.ci.packageskey)" >> $GITHUB_OUTPUT
# Cache xmake dependencies
- name: Retrieve cached xmake dependencies
uses: actions/cache@v3
- name: Restore cached xmake dependencies
id: restore-depcache
uses: actions/cache/restore@v4
with:
path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
key: Linux-${{ matrix.arch }}-${{ matrix.confs.mode }}-${{ steps.dep_hash.outputs.hash }}-W${{ steps.cache_key.outputs.key }}
key: Linux-${{ matrix.arch }}-${{ matrix.confs.mode }}${{ matrix.confs.cache_key }}-${{ steps.dep_hash.outputs.hash }}-W${{ steps.cache_key.outputs.key }}
# Setup compilation mode and install project dependencies
- name: Configure xmake and install dependencies
run: xmake config --arch=${{ matrix.arch }} --mode=${{ matrix.confs.mode }} ${{ matrix.confs.config }} --ccache=n --ffmpeg=y --shadernodes=y --tests=y --unitybuild=y --yes
run: xmake config --arch=${{ matrix.arch }} --mode=${{ matrix.confs.mode }} --static=${{ matrix.kind == 'static' && 'yes' || 'no' }} ${{ matrix.confs.config }} --ccache=n --ffmpeg=y --shadernodes=y --tests=y --unitybuild=y --yes
# Save dependencies
- name: Save cached xmake dependencies
if: ${{ !steps.restore-depcache.outputs.cache-hit }}
uses: actions/cache/save@v4
with:
path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
key: ${{ steps.restore-depcache.outputs.cache-primary-key }}
# Cache assets downloading
- name: Restore cached assets
id: restore-assets
uses: actions/cache/restore@v4
with:
path: assets
key: assets-${{ hashFiles('assets/examples_version.txt', 'assets/unittests_version.txt') }}
# Build the engine
- name: Build Nazara
run: xmake --yes
- name: Save downloaded assets
if: ${{ !steps.restore-assets.outputs.cache-hit }}
uses: actions/cache/save@v4
with:
path: assets
key: ${{ steps.restore-assets.outputs.cache-primary-key }}
# Run unit tests
- name: Run unit tests
if: matrix.confs.mode != 'releasedbg'
run: xmake run UnitTests
# Setup installation configuration
- name: Configure xmake for installation
run: xmake config --arch=${{ matrix.arch }} --mode=${{ matrix.confs.mode }} ${{ matrix.confs.config }} --ccache=n --ffmpeg=n --shadernodes=y --tests=y --yes
# Install the result files
- name: Install Nazara
if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' && matrix.confs.archive }}
run: xmake install -vo package
# Upload artifacts
- uses: actions/upload-artifact@v3
- name: "Set PACKAGE_NAME variable"
if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' && matrix.confs.archive }}
run: echo "PACKAGE_NAME=linux_${{ matrix.arch }}_${{ matrix.confs.mode }}_${{ matrix.kind }}.tar.gz" >> $GITHUB_ENV
shell: bash
- name: Archive result
uses: ihiroky/archive-action@v1
if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' && matrix.confs.archive }}
with:
name: nazaraengine-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.confs.mode }}
path: package
root_dir: package
file_path: ${{ env.PACKAGE_NAME }}
verbose: true
# Nightly tags (for commits to main branch)
- name: Upload binaries to release (main)
uses: svenstaro/upload-release-action@v2
if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' && matrix.confs.archive }}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.PACKAGE_NAME }}
asset_name: ${{ env.PACKAGE_NAME }}
tag: "0.0.0-nightly"
overwrite: true

View File

@ -23,15 +23,16 @@ jobs:
matrix:
os: [macOS-latest]
arch: [x86_64]
kind: [shared, static]
confs:
- { mode: debug }
- { mode: debug, config: --asan=y }
- { mode: debug, config: --lsan=y }
- { mode: debug, config: --tsan=y }
- { mode: releasedbg }
- { mode: debug, archive: yes }
- { mode: debug, config: --asan=y, archive: false, cache_key: -asan }
- { mode: debug, config: --lsan=y, archive: false }
- { mode: debug, config: --tsan=y, archive: false }
- { mode: releasedbg, archive: yes }
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'ci skip')"
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
steps:
- name: Get current date as package key
@ -62,35 +63,74 @@ jobs:
run: echo "hash=$(xmake l utils.ci.packageskey)" >> $GITHUB_OUTPUT
# Cache xmake dependencies
- name: Retrieve cached xmake dependencies
uses: actions/cache@v3
- name: Restore cached xmake dependencies
id: restore-depcache
uses: actions/cache/restore@v4
with:
path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
key: macOS-${{ matrix.arch }}-${{ matrix.confs.mode }}-${{ steps.dep_hash.outputs.hash }}-W${{ steps.cache_key.outputs.key }}
key: macOS-${{ matrix.arch }}-${{ matrix.confs.mode }}${{ matrix.confs.cache_key }}-${{ steps.dep_hash.outputs.hash }}-W${{ steps.cache_key.outputs.key }}
# Setup compilation mode and install project dependencies
- name: Configure xmake and install dependencies
run: xmake config --arch=${{ matrix.arch }} --mode=${{ matrix.confs.mode }} ${{ matrix.confs.config }} --ccache=n --ffmpeg=y --shadernodes=y --tests=y --unitybuild=y --yes
run: xmake config --arch=${{ matrix.arch }} --mode=${{ matrix.confs.mode }} --static=${{ matrix.kind == 'static' && 'yes' || 'no' }} ${{ matrix.confs.config }} --ccache=n --ffmpeg=y --shadernodes=y --tests=y --unitybuild=y --yes
# Save dependencies
- name: Save cached xmake dependencies
if: ${{ !steps.restore-depcache.outputs.cache-hit }}
uses: actions/cache/save@v4
with:
path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
key: ${{ steps.restore-depcache.outputs.cache-primary-key }}
# Cache assets downloading
- name: Restore cached assets
id: restore-assets
uses: actions/cache/restore@v4
with:
path: assets
key: assets-${{ hashFiles('assets/examples_version.txt', 'assets/unittests_version.txt') }}
# Build the engine
- name: Build Nazara
run: xmake --yes
- name: Save downloaded assets
if: ${{ !steps.restore-assets.outputs.cache-hit }}
uses: actions/cache/save@v4
with:
path: assets
key: ${{ steps.restore-assets.outputs.cache-primary-key }}
# Run unit tests
- name: Run unit tests
if: matrix.confs.mode != 'releasedbg'
run: xmake run UnitTests
# Setup installation configuration
- name: Configure xmake for installation
run: xmake config --arch=${{ matrix.arch }} --mode=${{ matrix.confs.mode }} ${{ matrix.confs.config }} --ccache=n --ffmpeg=n --shadernodes=y --tests=y --yes
# Install the result files
- name: Install Nazara
if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' && matrix.confs.archive }}
run: xmake install -vo package
# Upload artifacts
- uses: actions/upload-artifact@v3
- name: "Set PACKAGE_NAME variable"
if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' && matrix.confs.archive }}
run: echo "PACKAGE_NAME=macOS_${{ matrix.arch }}_${{ matrix.confs.mode }}_${{ matrix.kind }}.tar.gz" >> $GITHUB_ENV
shell: bash
- name: Archive result
uses: ihiroky/archive-action@v1
if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' && matrix.confs.archive }}
with:
name: nazaraengine-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.confs.mode }}
path: package
root_dir: package
file_path: ${{ env.PACKAGE_NAME }}
verbose: true
# Nightly tags (for commits to main branch)
- name: Upload binaries to release (main)
uses: svenstaro/upload-release-action@v2
if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' && matrix.confs.archive }}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.PACKAGE_NAME }}
asset_name: ${{ env.PACKAGE_NAME }}
tag: "0.0.0-nightly"
overwrite: true

View File

@ -24,9 +24,10 @@ jobs:
os: [windows-latest]
arch: [x86_64]
mode: [debug, releasedbg]
kind: [shared, static]
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'ci skip')"
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
defaults:
run:
@ -60,37 +61,76 @@ jobs:
- name: Retrieve dependencies hash
id: dep_hash
run: echo "hash=$(xmake l utils.ci.packageskey)" >> $GITHUB_OUTPUT
# Cache xmake dependencies
- name: Retrieve cached xmake dependencies
uses: actions/cache@v3
- name: Restore cached xmake dependencies
id: restore-depcache
uses: actions/cache/restore@v4
with:
path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
key: MinGW-${{ matrix.arch }}-${{ matrix.mode }}-${{ steps.dep_hash.outputs.hash }}-W${{ steps.cache_key.outputs.key }}
# Setup compilation mode and install project dependencies
- name: Configure xmake and install dependencies
run: xmake config --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --ccache=n --ffmpeg=y --shadernodes=y --tests=y --unitybuild=y --yes
run: xmake config --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --static=${{ matrix.kind == 'static' && 'yes' || 'no' }} --ccache=n --ffmpeg=y --shadernodes=y --tests=y --unitybuild=y --yes
# Save dependencies
- name: Save cached xmake dependencies
if: ${{ !steps.restore-depcache.outputs.cache-hit }}
uses: actions/cache/save@v4
with:
path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
key: ${{ steps.restore-depcache.outputs.cache-primary-key }}
# Cache assets downloading
- name: Restore cached assets
id: restore-assets
uses: actions/cache/restore@v4
with:
path: assets
key: assets-${{ hashFiles('assets/examples_version.txt', 'assets/unittests_version.txt') }}
# Build the engine
- name: Build Nazara
run: xmake --yes
- name: Save downloaded assets
if: ${{ !steps.restore-assets.outputs.cache-hit }}
uses: actions/cache/save@v4
with:
path: assets
key: ${{ steps.restore-assets.outputs.cache-primary-key }}
# Run unit tests
- name: Run unit tests
if: matrix.mode != 'releasedbg'
run: xmake run UnitTests
# Setup installation configuration
- name: Configure xmake for installation
run: xmake config --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --ccache=n --ffmpeg=n --shadernodes=y --tests=y --yes
# Install the result files
- name: Install Nazara
if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' }}
run: xmake install -vo package
# Upload artifacts
- uses: actions/upload-artifact@v3
- name: "Set PACKAGE_NAME variable"
if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' }}
run: echo "PACKAGE_NAME=${{ matrix.msystem }}_${{ matrix.arch }}_${{ matrix.mode }}_${{ matrix.kind }}.zip" >> $GITHUB_ENV
shell: bash
- name: Archive result
uses: ihiroky/archive-action@v1
if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' }}
with:
name: nazaraengine-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.mode }}
path: package
root_dir: package
file_path: ${{ env.PACKAGE_NAME }}
verbose: true
# Nightly tags (for commits to main branch)
- name: Upload binaries to release (main)
uses: svenstaro/upload-release-action@v2
if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' }}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.PACKAGE_NAME }}
asset_name: ${{ env.PACKAGE_NAME }}
tag: "0.0.0-nightly"
overwrite: true

View File

@ -22,11 +22,11 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
arch: [x86_64]
arch: [wasm32, wasm64]
mode: [debug, release]
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'ci skip')"
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
steps:
- name: Get current date as package key
@ -57,14 +57,15 @@ jobs:
# Setup emsdk
- name: Setup emscripten
uses: mymindstorm/setup-emsdk@v13
uses: mymindstorm/setup-emsdk@v14
with:
version: 3.1.35
actions-cache-folder: emsdk-cache-${{ matrix.mode }}-${{ matrix.kind }}
# Cache xmake dependencies
- name: Retrieve cached xmake dependencies
uses: actions/cache@v3
- name: Restore cached xmake dependencies
id: restore-depcache
uses: actions/cache/restore@v4
with:
path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
key: Wasm-${{ matrix.arch }}-${{ matrix.mode }}-${{ steps.dep_hash.outputs.hash }}-W${{ steps.cache_key.outputs.key }}
@ -73,16 +74,58 @@ jobs:
- name: Configure xmake and install dependencies
run: xmake config --plat=wasm --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --ccache=n --assimp=n --embed_rendererbackends=y --embed_plugins=y --link_openal=y --ffmpeg=n --shadernodes=n --tests=y --yes
# Save dependencies
- name: Save cached xmake dependencies
if: ${{ !steps.restore-depcache.outputs.cache-hit }}
uses: actions/cache/save@v4
with:
path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
key: ${{ steps.restore-depcache.outputs.cache-primary-key }}
# Cache assets downloading
- name: Restore cached assets
id: restore-assets
uses: actions/cache/restore@v4
with:
path: assets
key: assets-${{ hashFiles('assets/examples_version.txt', 'assets/unittests_version.txt') }}
# Build the engine
- name: Build Nazara
run: xmake --yes
- name: Save downloaded assets
if: ${{ !steps.restore-assets.outputs.cache-hit }}
uses: actions/cache/save@v4
with:
path: assets
key: ${{ steps.restore-assets.outputs.cache-primary-key }}
# Install the result files
- name: Install Nazara
if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' }}
run: xmake install -vo package
# Upload artifacts
- uses: actions/upload-artifact@v3
- name: "Set PACKAGE_NAME variable"
if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' }}
run: echo "PACKAGE_NAME=emscripten_${{ matrix.arch }}_${{ matrix.mode }}_static.tar.gz" >> $GITHUB_ENV
shell: bash
- name: Archive result
uses: ihiroky/archive-action@v1
if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' }}
with:
name: nazaraengine-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.mode }}
path: package
root_dir: package
file_path: ${{ env.PACKAGE_NAME }}
verbose: true
# Nightly tags (for commits to main branch)
- name: Upload binaries to release (main)
uses: svenstaro/upload-release-action@v2
if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' }}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.PACKAGE_NAME }}
asset_name: ${{ env.PACKAGE_NAME }}
tag: "0.0.0-nightly"
overwrite: true

View File

@ -23,9 +23,10 @@ jobs:
os: [windows-latest]
arch: [x64]
mode: [debug, releasedbg]
kind: [shared, static]
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'ci skip')"
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
steps:
- name: Get current date as package key
@ -57,35 +58,74 @@ jobs:
run: echo "hash=$(xmake l utils.ci.packageskey)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
# Cache xmake dependencies
- name: Retrieve cached xmake dependencies
uses: actions/cache@v3
- name: Restore cached xmake dependencies
id: restore-depcache
uses: actions/cache/restore@v4
with:
path: ${{ env.XMAKE_GLOBALDIR }}\.xmake\packages
key: MSVC-${{ matrix.arch }}-${{ matrix.mode }}-${{ steps.dep_hash.outputs.hash }}-W${{ steps.cache_key.outputs.key }}
# Setup compilation mode and install project dependencies
- name: Configure xmake and install dependencies
run: xmake config --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --ccache=n --ffmpeg=y --shadernodes=y --tests=y --unitybuild=y --yes
run: xmake config --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --static=${{ matrix.kind == 'static' && 'yes' || 'no' }} --ccache=n --ffmpeg=y --shadernodes=y --tests=y --unitybuild=y --yes
# Save dependencies
- name: Save cached xmake dependencies
if: ${{ !steps.restore-depcache.outputs.cache-hit }}
uses: actions/cache/save@v4
with:
path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
key: ${{ steps.restore-depcache.outputs.cache-primary-key }}
# Cache assets downloading
- name: Restore cached assets
id: restore-assets
uses: actions/cache/restore@v4
with:
path: assets
key: assets-${{ hashFiles('assets/examples_version.txt', 'assets/unittests_version.txt') }}
# Build the engine
- name: Build Nazara
run: xmake --yes
- name: Save downloaded assets
if: ${{ !steps.restore-assets.outputs.cache-hit }}
uses: actions/cache/save@v4
with:
path: assets
key: ${{ steps.restore-assets.outputs.cache-primary-key }}
# Run unit tests
- name: Run unit tests
if: matrix.mode != 'releasedbg'
run: xmake run UnitTests
# Setup installation configuration
- name: Configure xmake for installation
run: xmake config --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --ccache=n --ffmpeg=n --shadernodes=y --tests=y --yes
# Install the result files
- name: Install Nazara
if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' }}
run: xmake install -vo package
# Upload artifacts
- uses: actions/upload-artifact@v3
- name: "Set PACKAGE_NAME variable"
if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' }}
run: echo "PACKAGE_NAME=windows_${{ matrix.arch }}_${{ matrix.mode }}_${{ matrix.kind }}.zip" >> $GITHUB_ENV
shell: bash
- name: Archive result
uses: ihiroky/archive-action@v1
if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' }}
with:
name: nazaraengine-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.mode }}
path: package
root_dir: package
file_path: ${{ env.PACKAGE_NAME }}
verbose: true
# Nightly tags (for commits to main branch)
- name: Upload binaries to release (main)
uses: svenstaro/upload-release-action@v2
if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' }}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.PACKAGE_NAME }}
asset_name: ${{ env.PACKAGE_NAME }}
tag: "0.0.0-nightly"
overwrite: true

View File

@ -370,7 +370,7 @@ Nazara Engine:
- Added support for debug draw
- Added support for damping
- ⚠️ RigidBody2D created without mass are now kinematic by default instead of statics
- https://github.com/NazaraEngine/NazaraEngine/pull/128 ⚠️ **Platform-specific classes were moved to a new module: Platform** (this means Utility module no longer needs to be linked to X11/xcb or gdi32).
- https://github.com/NazaraEngine/NazaraEngine/pull/128 ⚠️ **Platform-specific classes were moved to a new module: Platform** (this means Core module no longer needs to be linked to X11/xcb or gdi32).
- https://github.com/NazaraEngine/NazaraEngine/pull/135 ⚠️ Improved vertex declarations (they now checks template type with real type)
- Mesh index buffer optimization is now disabled by default in debug mode
- It is now possible to set the vertex declaration wanted when building/loading a mesh

126
Doxyfile
View File

@ -162,7 +162,7 @@ FULL_PATH_NAMES = YES
# will be relative from the directory where doxygen is started.
# This tag requires that the tag FULL_PATH_NAMES is set to YES.
STRIP_FROM_PATH =
STRIP_FROM_PATH =
# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
# path mentioned in the documentation of a class, which tells the reader which
@ -171,7 +171,7 @@ STRIP_FROM_PATH =
# specify the list of include paths that are normally passed to the compiler
# using the -I flag.
STRIP_FROM_INC_PATH =
STRIP_FROM_INC_PATH =
# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
# less readable) file names. This can be useful is your file systems doesn't
@ -238,13 +238,13 @@ TAB_SIZE = 4
# "Side Effects:". You can put \n's in the value part of an alias to insert
# newlines.
ALIASES =
ALIASES =
# This tag can be used to specify a number of word-keyword mappings (TCL only).
# A mapping has the form "name=value". For example adding "class=itcl::class"
# will allow you to use the command class in the itcl::class meaning.
TCL_SUBST =
TCL_SUBST =
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
# only. Doxygen will then generate output that is more tailored for C. For
@ -291,7 +291,7 @@ OPTIMIZE_OUTPUT_VHDL = NO
# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
# the files are not read by doxygen.
EXTENSION_MAPPING =
EXTENSION_MAPPING =
# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
# according to the Markdown format, which allows for more readable
@ -639,7 +639,7 @@ GENERATE_DEPRECATEDLIST= YES
# sections, marked by \if <section_label> ... \endif and \cond <section_label>
# ... \endcond blocks.
ENABLED_SECTIONS =
ENABLED_SECTIONS =
# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
# initial value of a variable or macro / define can have for it to appear in the
@ -681,7 +681,7 @@ SHOW_NAMESPACES = YES
# by doxygen. Whatever the program writes to standard output is used as the file
# version. For an example see the documentation.
FILE_VERSION_FILTER =
FILE_VERSION_FILTER =
# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
# by doxygen. The layout file controls the global structure of the generated
@ -694,7 +694,7 @@ FILE_VERSION_FILTER =
# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
# tag is left empty.
LAYOUT_FILE =
LAYOUT_FILE =
# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
# the reference definitions. This must be a list of .bib files. The .bib
@ -704,7 +704,7 @@ LAYOUT_FILE =
# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
# search path. See also \cite for info how to create references.
CITE_BIB_FILES =
CITE_BIB_FILES =
#---------------------------------------------------------------------------
# Configuration options related to warning and progress messages
@ -763,7 +763,7 @@ WARN_FORMAT = "$file:$line: $text"
# messages should be written. If left blank the output is written to standard
# error (stderr).
WARN_LOGFILE =
WARN_LOGFILE =
#---------------------------------------------------------------------------
# Configuration options related to the input files
@ -862,7 +862,7 @@ RECURSIVE = YES
# Note that relative paths are relative to the directory from which doxygen is
# run.
EXCLUDE =
EXCLUDE =
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
@ -878,7 +878,7 @@ EXCLUDE_SYMLINKS = NO
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories for example use the pattern */test/*
EXCLUDE_PATTERNS =
EXCLUDE_PATTERNS =
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
@ -889,13 +889,13 @@ EXCLUDE_PATTERNS =
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories use the pattern */test/*
EXCLUDE_SYMBOLS =
EXCLUDE_SYMBOLS =
# The EXAMPLE_PATH tag can be used to specify one or more files or directories
# that contain example code fragments that are included (see the \include
# command).
EXAMPLE_PATH =
EXAMPLE_PATH =
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
@ -915,7 +915,7 @@ EXAMPLE_RECURSIVE = NO
# that contain images that are to be included in the documentation (see the
# \image command).
IMAGE_PATH =
IMAGE_PATH =
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
@ -932,7 +932,7 @@ IMAGE_PATH =
# code is scanned, but not when the output code is generated. If lines are added
# or removed, the anchors will not be placed correctly.
INPUT_FILTER =
INPUT_FILTER =
# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
# basis. Doxygen will compare the file name with each pattern and apply the
@ -941,7 +941,7 @@ INPUT_FILTER =
# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
# patterns match the file name, INPUT_FILTER is applied.
FILTER_PATTERNS =
FILTER_PATTERNS =
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
# INPUT_FILTER) will also be used to filter the input files that are used for
@ -956,14 +956,14 @@ FILTER_SOURCE_FILES = NO
# *.ext= (so without naming a filter).
# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
FILTER_SOURCE_PATTERNS =
FILTER_SOURCE_PATTERNS =
# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
# is part of the input, its contents will be placed on the main page
# (index.html). This can be useful if you have a project on for instance GitHub
# and want to reuse the introduction page also for the doxygen output.
USE_MDFILE_AS_MAINPAGE =
USE_MDFILE_AS_MAINPAGE =
#---------------------------------------------------------------------------
# Configuration options related to source browsing
@ -1068,7 +1068,7 @@ CLANG_ASSISTED_PARSING = NO
# specified with INPUT and INCLUDE_PATH.
# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES.
CLANG_OPTIONS =
CLANG_OPTIONS =
#---------------------------------------------------------------------------
# Configuration options related to the alphabetical class index
@ -1094,7 +1094,7 @@ COLS_IN_ALPHA_INDEX = 5
# while generating the index headers.
# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
IGNORE_PREFIX =
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the HTML output
@ -1138,7 +1138,7 @@ HTML_FILE_EXTENSION = .html
# of the possible markers and block names see the documentation.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_HEADER =
HTML_HEADER =
# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
# generated HTML page. If the tag is left blank doxygen will generate a standard
@ -1148,7 +1148,7 @@ HTML_HEADER =
# that doxygen normally uses.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_FOOTER =
HTML_FOOTER =
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
# sheet that is used by each HTML page. It can be used to fine-tune the look of
@ -1160,7 +1160,7 @@ HTML_FOOTER =
# obsolete.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_STYLESHEET =
HTML_STYLESHEET =
# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
# cascading style sheets that are included after the standard style sheets
@ -1173,7 +1173,7 @@ HTML_STYLESHEET =
# list). For an example see the documentation.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_EXTRA_STYLESHEET =
HTML_EXTRA_STYLESHEET =
# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
# other source files which should be copied to the HTML output directory. Note
@ -1183,7 +1183,7 @@ HTML_EXTRA_STYLESHEET =
# files will be copied as-is; there are no commands or markers available.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_EXTRA_FILES =
HTML_EXTRA_FILES =
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
# will adjust the colors in the style sheet and background images according to
@ -1312,7 +1312,7 @@ GENERATE_HTMLHELP = NO
# written to the html output directory.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
CHM_FILE =
CHM_FILE =
# The HHC_LOCATION tag can be used to specify the location (absolute path
# including file name) of the HTML help compiler (hhc.exe). If non-empty,
@ -1320,7 +1320,7 @@ CHM_FILE =
# The file has to be specified with full path.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
HHC_LOCATION =
HHC_LOCATION =
# The GENERATE_CHI flag controls if a separate .chi index file is generated
# (YES) or that it should be included in the master .chm file (NO).
@ -1333,7 +1333,7 @@ GENERATE_CHI = NO
# and project file content.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
CHM_INDEX_ENCODING =
CHM_INDEX_ENCODING =
# The BINARY_TOC flag controls whether a binary table of contents is generated
# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it
@ -1364,7 +1364,7 @@ GENERATE_QHP = NO
# the HTML output folder.
# This tag requires that the tag GENERATE_QHP is set to YES.
QCH_FILE =
QCH_FILE =
# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
# Project output. For more information please see Qt Help Project / Namespace
@ -1389,7 +1389,7 @@ QHP_VIRTUAL_FOLDER = doc
# filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_CUST_FILTER_NAME =
QHP_CUST_FILTER_NAME =
# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
# custom filter to add. For more information please see Qt Help Project / Custom
@ -1397,21 +1397,21 @@ QHP_CUST_FILTER_NAME =
# filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_CUST_FILTER_ATTRS =
QHP_CUST_FILTER_ATTRS =
# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
# project's filter section matches. Qt Help Project / Filter Attributes (see:
# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_SECT_FILTER_ATTRS =
QHP_SECT_FILTER_ATTRS =
# The QHG_LOCATION tag can be used to specify the location of Qt's
# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
# generated .qhp file.
# This tag requires that the tag GENERATE_QHP is set to YES.
QHG_LOCATION =
QHG_LOCATION =
# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
# generated, together with the HTML files, they form an Eclipse help plugin. To
@ -1544,7 +1544,7 @@ MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_EXTENSIONS =
MATHJAX_EXTENSIONS =
# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
# of code that will be used on startup of the MathJax code. See the MathJax site
@ -1552,7 +1552,7 @@ MATHJAX_EXTENSIONS =
# example see the documentation.
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_CODEFILE =
MATHJAX_CODEFILE =
# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
# the HTML output. The underlying search engine uses javascript and DHTML and
@ -1612,7 +1612,7 @@ EXTERNAL_SEARCH = NO
# Searching" for details.
# This tag requires that the tag SEARCHENGINE is set to YES.
SEARCHENGINE_URL =
SEARCHENGINE_URL =
# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
# search data is written to a file for indexing by an external tool. With the
@ -1628,7 +1628,7 @@ SEARCHDATA_FILE = searchdata.xml
# projects and redirect the results back to the right project.
# This tag requires that the tag SEARCHENGINE is set to YES.
EXTERNAL_SEARCH_ID =
EXTERNAL_SEARCH_ID =
# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
# projects other than the one defined by this configuration file, but that are
@ -1638,7 +1638,7 @@ EXTERNAL_SEARCH_ID =
# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
# This tag requires that the tag SEARCHENGINE is set to YES.
EXTRA_SEARCH_MAPPINGS =
EXTRA_SEARCH_MAPPINGS =
#---------------------------------------------------------------------------
# Configuration options related to the LaTeX output
@ -1702,7 +1702,7 @@ PAPER_TYPE = a4
# If left blank no extra packages will be included.
# This tag requires that the tag GENERATE_LATEX is set to YES.
EXTRA_PACKAGES =
EXTRA_PACKAGES =
# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
# generated LaTeX document. The header should contain everything until the first
@ -1718,7 +1718,7 @@ EXTRA_PACKAGES =
# to HTML_HEADER.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_HEADER =
LATEX_HEADER =
# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
# generated LaTeX document. The footer should contain everything after the last
@ -1729,7 +1729,7 @@ LATEX_HEADER =
# Note: Only use a user-defined footer if you know what you are doing!
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_FOOTER =
LATEX_FOOTER =
# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined
# LaTeX style sheets that are included after the standard style sheets created
@ -1740,7 +1740,7 @@ LATEX_FOOTER =
# list).
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_EXTRA_STYLESHEET =
LATEX_EXTRA_STYLESHEET =
# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
# other source files which should be copied to the LATEX_OUTPUT output
@ -1748,7 +1748,7 @@ LATEX_EXTRA_STYLESHEET =
# markers available.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_EXTRA_FILES =
LATEX_EXTRA_FILES =
# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
@ -1848,14 +1848,14 @@ RTF_HYPERLINKS = NO
# default style sheet that doxygen normally uses.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_STYLESHEET_FILE =
RTF_STYLESHEET_FILE =
# Set optional variables used in the generation of an RTF document. Syntax is
# similar to doxygen's config file. A template extensions file can be generated
# using doxygen -e rtf extensionFile.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_EXTENSIONS_FILE =
RTF_EXTENSIONS_FILE =
# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code
# with syntax highlighting in the RTF output.
@ -1900,7 +1900,7 @@ MAN_EXTENSION = .3
# MAN_EXTENSION with the initial . removed.
# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_SUBDIR =
MAN_SUBDIR =
# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
# will generate one additional man file for each entity documented in the real
@ -2013,7 +2013,7 @@ PERLMOD_PRETTY = YES
# overwrite each other's variables.
# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_MAKEVAR_PREFIX =
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
@ -2054,7 +2054,7 @@ SEARCH_INCLUDES = YES
# preprocessor.
# This tag requires that the tag SEARCH_INCLUDES is set to YES.
INCLUDE_PATH =
INCLUDE_PATH =
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
@ -2062,7 +2062,7 @@ INCLUDE_PATH =
# used.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
INCLUDE_FILE_PATTERNS =
INCLUDE_FILE_PATTERNS =
# The PREDEFINED tag can be used to specify one or more macro names that are
# defined before the preprocessor is started (similar to the -D option of e.g.
@ -2072,7 +2072,7 @@ INCLUDE_FILE_PATTERNS =
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
PREDEFINED =
PREDEFINED =
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
@ -2081,7 +2081,7 @@ PREDEFINED =
# definition found in the source code.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
EXPAND_AS_DEFINED =
EXPAND_AS_DEFINED =
# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
# remove all references to function-like macros that are alone on a line, have
@ -2110,13 +2110,13 @@ SKIP_FUNCTION_MACROS = YES
# the path). If a tag file is not located in the directory in which doxygen is
# run, you must also specify the path to the tagfile here.
TAGFILES =
TAGFILES =
# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
# tag file that is based on the input files it reads. See section "Linking to
# external documentation" for more information about the usage of tag files.
GENERATE_TAGFILE =
GENERATE_TAGFILE =
# If the ALLEXTERNALS tag is set to YES, all external class will be listed in
# the class index. If set to NO, only the inherited external classes will be
@ -2165,14 +2165,14 @@ CLASS_DIAGRAMS = YES
# the mscgen tool resides. If left empty the tool is assumed to be found in the
# default search path.
MSCGEN_PATH =
MSCGEN_PATH =
# You can include diagrams made with dia in doxygen documentation. Doxygen will
# then run dia to produce the diagram and insert it in the documentation. The
# DIA_PATH tag allows you to specify the directory where the dia binary resides.
# If left empty dia is assumed to be found in the default search path.
DIA_PATH =
DIA_PATH =
# If set to YES the inheritance and collaboration graphs will hide inheritance
# and usage relations if the target is undocumented or is not a class.
@ -2221,7 +2221,7 @@ DOT_FONTSIZE = 10
# the path where dot can find it using this tag.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTPATH =
DOT_FONTPATH =
# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
# each documented class showing the direct and indirect inheritance relations.
@ -2365,26 +2365,26 @@ INTERACTIVE_SVG = NO
# found. If left blank, it is assumed the dot tool can be found in the path.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_PATH =
DOT_PATH =
# The DOTFILE_DIRS tag can be used to specify one or more directories that
# contain dot files that are included in the documentation (see the \dotfile
# command).
# This tag requires that the tag HAVE_DOT is set to YES.
DOTFILE_DIRS =
DOTFILE_DIRS =
# The MSCFILE_DIRS tag can be used to specify one or more directories that
# contain msc files that are included in the documentation (see the \mscfile
# command).
MSCFILE_DIRS =
MSCFILE_DIRS =
# The DIAFILE_DIRS tag can be used to specify one or more directories that
# contain dia files that are included in the documentation (see the \diafile
# command).
DIAFILE_DIRS =
DIAFILE_DIRS =
# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
# path where java can find the plantuml.jar file. If left blank, it is assumed
@ -2392,12 +2392,12 @@ DIAFILE_DIRS =
# generate a warning when it encounters a \startuml command in this case and
# will not generate output for the diagram.
PLANTUML_JAR_PATH =
PLANTUML_JAR_PATH =
# When using plantuml, the specified paths are searched for files specified by
# the !include statement in a plantuml block.
PLANTUML_INCLUDE_PATH =
PLANTUML_INCLUDE_PATH =
# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
# that will be shown in the graph. If the number of nodes in a graph becomes

165
LICENSE-FFmpeg.txt Normal file
View File

@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

View File

@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@ -29,9 +29,6 @@ Nazara also uses the following libraries at its core and for external tools, we
- [minimp3](https://github.com/lieff/minimp3): Minimalistic MP3 decoder single header library
- [OpenAL Soft](https://openal-soft.org): OpenAL Soft is a software implementation of the OpenAL 3D audio API
**Nazara Bullet physics module**:
- [Bullet Physics](http://bulletphysics.org): Bullet Physics SDK
**Nazara Chipmunk physics module**:
- [Chipmunk Physics](https://chipmunk-physics.net/): A fast and lightweight 2D game physics library

View File

@ -1 +1 @@
5
5

View File

@ -285,7 +285,7 @@ nlohmann::ordered_json buildClass(const std::string& scope, const cppast::cpp_cl
if (!isPublic)
break;
const auto& memberFunc = static_cast<const cppast::cpp_member_function&>(e);
const auto& memberFunc = static_cast<const cppast::cpp_member_function&>(e);
auto& constructorDoc = classDoc["constructors"].emplace_back();
constructorDoc["name"] = memberFunc.name();

View File

@ -3,7 +3,6 @@
#include <Nazara/Math/Angle.hpp>
#include <Nazara/Graphics.hpp>
#include <Nazara/Renderer.hpp>
#include <Nazara/Utility.hpp>
#include <NZSL/Math/FieldOffsets.hpp>
#include <NZSL/Parser.hpp>
#include <array>
@ -89,7 +88,7 @@ int main(int argc, char* argv[])
std::shared_ptr<Nz::RenderDevice> device = Nz::Graphics::Instance()->GetRenderDevice();
const Nz::RenderDeviceInfo& deviceInfo = device->GetDeviceInfo();
auto& windowing = app.AddComponent<Nz::AppWindowingComponent>();
auto& windowing = app.AddComponent<Nz::WindowingAppComponent>();
std::string windowTitle = "Graphics Test";
Nz::Window& window = windowing.CreateWindow(Nz::VideoMode(1920, 1080), windowTitle);

View File

@ -16,7 +16,7 @@
#include <Nazara/Graphics.hpp> // Module graphique
#include <Nazara/Renderer.hpp> // Module de rendu
#include <Nazara/Network.hpp> // Module utilitaire
#include <Nazara/Utility.hpp> // Module utilitaire
#include <Nazara/Core.hpp> // Module utilitaire
#include <NazaraSDK/Application.hpp>
#include <NazaraSDK/Components.hpp>
#include <NazaraSDK/Console.hpp>
@ -263,7 +263,7 @@ int main()
application.EnableFPSCounter(true);
//Gestion des Evenements
//Gestion des Evenements
Nz::EventHandler& eventHandler = window.GetEventHandler();
Nz::Mouse::SetRelativeMouseMode(true);

View File

@ -13,6 +13,5 @@ EXAMPLE.Files = {
EXAMPLE.Libraries = {
"NazaraCore",
"NazaraPlatform",
"NazaraRenderer",
"NazaraUtility"
"NazaraRenderer"
}

View File

@ -8,8 +8,7 @@ EXAMPLE.Files = {
EXAMPLE.Libraries = {
"NazaraCore",
"NazaraPlatform",
"NazaraUtility"
"NazaraPlatform"
}
if Config.PlatformSDL2 then

View File

@ -1,13 +1,13 @@
#include <Nazara/Core/File.hpp>
#include <Nazara/Core/Modules.hpp>
#include <Nazara/Math/Box.hpp>
#include <Nazara/Utility/Animation.hpp>
#include <Nazara/Utility/Joint.hpp>
#include <Nazara/Utility/MaterialData.hpp>
#include <Nazara/Utility/Mesh.hpp>
#include <Nazara/Utility/Sequence.hpp>
#include <Nazara/Utility/Skeleton.hpp>
#include <Nazara/Utility/Utility.hpp>
#include <Nazara/Core/Animation.hpp>
#include <Nazara/Core/Joint.hpp>
#include <Nazara/Core/MaterialData.hpp>
#include <Nazara/Core/Mesh.hpp>
#include <Nazara/Core/Sequence.hpp>
#include <Nazara/Core/Skeleton.hpp>
#include <Nazara/Core/Core.hpp>
#include <cctype>
#include <iostream>
#include <limits>
@ -15,14 +15,7 @@
int main()
{
// Pour charger des ressources, il est impératif d'initialiser le module utilitaire
Nz::Modules<Nz::Utility> nazara;
/*if (!utility)
{
// Ça n'a pas fonctionné, le pourquoi se trouve dans le fichier NazaraLog.log
std::cout << "Failed to initialize Nazara, see NazaraLog.log for further informations" << std::endl;
std::getchar(); // On laise le temps de voir l'erreur
return EXIT_FAILURE;
}*/
Nz::Modules<Nz::Core> nazara;
for (;;)
{

View File

@ -1,6 +1,6 @@
#include "Common.hpp"
#include <Nazara/Core/Error.hpp>
#include <Nazara/Utility/SimpleTextDrawer.hpp>
#include <Nazara/TextRenderer/SimpleTextDrawer.hpp>
#include <NazaraSDK/Components/ParticleGroupComponent.hpp>
#include <NazaraSDK/Systems/RenderSystem.hpp>

View File

@ -1,7 +1,7 @@
#include "LogoDemo.hpp"
#include <Nazara/Core/OffsetOf.hpp>
#include <Nazara/Graphics.hpp>
#include <Nazara/Utility.hpp>
#include <Nazara/Core.hpp>
#include <NazaraSDK/Components.hpp>
#include <NazaraSDK/Systems.hpp>
#include <iostream>

View File

@ -3,7 +3,7 @@
#include <Nazara/Core/OffsetOf.hpp>
#include <Nazara/Graphics.hpp>
#include <Nazara/Platform.hpp>
#include <Nazara/Utility.hpp>
#include <Nazara/Core.hpp>
#include <NazaraSDK/Components.hpp>
#include <NazaraSDK/Systems.hpp>

View File

@ -2,9 +2,7 @@
#include <Nazara/Core.hpp>
#include <Nazara/Graphics.hpp>
#include <Nazara/Network.hpp>
#include <Nazara/BulletPhysics3D.hpp>
#include <Nazara/Renderer.hpp>
#include <Nazara/Utility.hpp>
#include <NazaraSDK/Application.hpp>
#include <NazaraSDK/Components.hpp>
#include <NazaraSDK/Systems.hpp>

View File

@ -2,7 +2,6 @@
#include <Nazara/Platform.hpp>
#include <Nazara/Graphics.hpp>
#include <Nazara/Renderer.hpp>
#include <Nazara/Utility.hpp>
#include <chrono>
#include <iostream>
#include <thread>
@ -17,7 +16,7 @@ int main(int argc, char* argv[])
std::shared_ptr<Nz::RenderDevice> device = Nz::Graphics::Instance()->GetRenderDevice();
auto& windowing = app.AddComponent<Nz::AppWindowingComponent>();
auto& windowing = app.AddComponent<Nz::WindowingAppComponent>();
std::string windowTitle = "Physically Based Rendering Test";
Nz::Window& window = windowing.CreateWindow(Nz::VideoMode(1920, 1080), windowTitle);

View File

@ -2,9 +2,8 @@
#include <Nazara/Platform.hpp>
#include <Nazara/Graphics.hpp>
#include <Nazara/Math/PidController.hpp>
#include <Nazara/ChipmunkPhysics2D.hpp>
#include <Nazara/Physics2D.hpp>
#include <Nazara/Renderer.hpp>
#include <Nazara/Utility.hpp>
#include <Nazara/Widgets.hpp>
#include <entt/entt.hpp>
#include <array>
@ -21,14 +20,14 @@ int main(int argc, char* argv[])
if (!std::filesystem::is_directory(resourceDir) && std::filesystem::is_directory("../.." / resourceDir))
resourceDir = "../.." / resourceDir;
Nz::Application<Nz::Graphics, Nz::ChipmunkPhysics2D> app(argc, argv);
Nz::Application<Nz::Graphics, Nz::Physics2D> app(argc, argv);
auto& windowing = app.AddComponent<Nz::AppWindowingComponent>();
auto& windowing = app.AddComponent<Nz::WindowingAppComponent>();
auto& ecs = app.AddComponent<Nz::AppEntitySystemComponent>();
auto& ecs = app.AddComponent<Nz::EntitySystemAppComponent>();
auto& world = ecs.AddWorld<Nz::EnttWorld>();
Nz::ChipmunkPhysics2DSystem& physSytem = world.AddSystem<Nz::ChipmunkPhysics2DSystem>();
Nz::Physics2DSystem& physSytem = world.AddSystem<Nz::Physics2DSystem>();
Nz::RenderSystem& renderSystem = world.AddSystem<Nz::RenderSystem>();
std::string windowTitle = "Physics 2D";
@ -59,9 +58,9 @@ int main(int argc, char* argv[])
std::shared_ptr<Nz::MaterialInstance> spriteMaterial = Nz::MaterialInstance::Instantiate(Nz::MaterialType::Phong);
spriteMaterial->SetTextureProperty("BaseColorMap", Nz::Texture::LoadFromFile(resourceDir / "box.png", texParams));
Nz::ChipmunkRigidBody2DComponent::DynamicSettings boxSettings;
Nz::RigidBody2DComponent::DynamicSettings boxSettings;
boxSettings.mass = 50.f;
boxSettings.geom = std::make_shared<Nz::ChipmunkBoxCollider2D>(Nz::Vector2f(32.f, 32.f));
boxSettings.geom = std::make_shared<Nz::BoxCollider2D>(Nz::Vector2f(32.f, 32.f));
std::shared_ptr<Nz::Sprite> boxSprite = std::make_shared<Nz::Sprite>(spriteMaterial);
boxSprite->SetSize({ 32.f, 32.f });
@ -76,7 +75,7 @@ int main(int argc, char* argv[])
spriteEntity.emplace<Nz::NodeComponent>(Nz::Vector2f(windowSize.x * 0.5f + x * 32.f - 15.f * 32.f, windowSize.y / 2 + y * 48.f));
spriteEntity.emplace<Nz::GraphicsComponent>(boxSprite, 1);
auto& rigidBody = spriteEntity.emplace<Nz::ChipmunkRigidBody2DComponent>(boxSettings);
auto& rigidBody = spriteEntity.emplace<Nz::RigidBody2DComponent>(boxSettings);
rigidBody.SetFriction(0.9f);
//rigidBody.SetElasticity(0.99f);
}
@ -102,12 +101,12 @@ int main(int argc, char* argv[])
}
}
Nz::ChipmunkRigidBody2DComponent::StaticSettings groundSettings;
groundSettings.geom = std::make_shared<Nz::ChipmunkBoxCollider2D>(tilemap->GetSize());
Nz::RigidBody2DComponent::StaticSettings groundSettings;
groundSettings.geom = std::make_shared<Nz::BoxCollider2D>(tilemap->GetSize());
groundEntity.emplace<Nz::NodeComponent>().SetPosition(windowSize.x * 0.5f, -windowSize.y * 0.2f);
groundEntity.emplace<Nz::NodeComponent>().SetPosition({ windowSize.x * 0.5f, -windowSize.y * 0.2f });
groundEntity.emplace<Nz::GraphicsComponent>().AttachRenderable(tilemap, 1);
auto& rigidBody = groundEntity.emplace<Nz::ChipmunkRigidBody2DComponent>(groundSettings);
auto& rigidBody = groundEntity.emplace<Nz::RigidBody2DComponent>(groundSettings);
rigidBody.SetFriction(0.9f);
}
@ -122,7 +121,7 @@ int main(int argc, char* argv[])
Nz::PidController<Nz::Vector3f> headingController(0.5f, 0.f, 0.05f);
Nz::PidController<Nz::Vector3f> upController(1.f, 0.f, 0.1f);
std::optional<Nz::ChipmunkPivotConstraint2D> grabConstraint;
std::optional<Nz::PhysPivotConstraint2D> grabConstraint;
NazaraSlot(Nz::WindowEventHandler, OnMouseMoved, grabbedObjectMove);
Nz::WindowEventHandler& eventHandler = window.GetEventHandler();
@ -139,14 +138,14 @@ int main(int argc, char* argv[])
{
if (nearestEntity && nearestEntity != groundEntity)
{
grabConstraint.emplace(nearestEntity.get<Nz::ChipmunkRigidBody2DComponent>(), worldPos);
grabConstraint.emplace(nearestEntity.get<Nz::RigidBody2DComponent>(), worldPos);
grabbedObjectMove.Connect(eventHandler.OnMouseMoved, [&, nearestEntity, viewer](const Nz::WindowEventHandler*, const Nz::WindowEvent::MouseMoveEvent& event)
{
auto& viewerComponent = viewer.get<Nz::CameraComponent>();
Nz::Vector2f worldPos = Nz::Vector2f(viewerComponent.Unproject(Nz::Vector3f(event.x, event.y, 0.f)));
auto& rigidBody = nearestEntity.get<Nz::ChipmunkRigidBody2DComponent>();
auto& rigidBody = nearestEntity.get<Nz::RigidBody2DComponent>();
grabConstraint->SetFirstAnchor(worldPos);
});

View File

@ -1,5 +1,5 @@
target("Physics2DDemo")
add_deps("NazaraGraphics", "NazaraChipmunkPhysics2D")
add_deps("NazaraGraphics", "NazaraPhysics2D")
add_packages("entt")
add_files("main.cpp")
add_defines("NAZARA_ENTT")

View File

@ -2,9 +2,9 @@
#include <Nazara/Platform.hpp>
#include <Nazara/Graphics.hpp>
#include <Nazara/Math/PidController.hpp>
#include <Nazara/BulletPhysics3D.hpp>
#include <Nazara/Physics3D.hpp>
#include <Nazara/Renderer.hpp>
#include <Nazara/Utility.hpp>
#include <Nazara/TextRenderer/SimpleTextDrawer.hpp>
#include <entt/entt.hpp>
#include <array>
#include <chrono>
@ -20,14 +20,14 @@ int main(int argc, char* argv[])
if (!std::filesystem::is_directory(resourceDir) && std::filesystem::is_directory("../.." / resourceDir))
resourceDir = "../.." / resourceDir;
Nz::Application<Nz::Graphics, Nz::BulletPhysics3D> app(argc, argv);
Nz::Application<Nz::Graphics, Nz::Physics3D> app(argc, argv);
auto& windowing = app.AddComponent<Nz::AppWindowingComponent>();
auto& windowing = app.AddComponent<Nz::WindowingAppComponent>();
auto& ecs = app.AddComponent<Nz::AppEntitySystemComponent>();
auto& ecs = app.AddComponent<Nz::EntitySystemAppComponent>();
auto& world = ecs.AddWorld<Nz::EnttWorld>();
Nz::BulletPhysics3DSystem& physSytem = world.AddSystem<Nz::BulletPhysics3DSystem>();
Nz::Physics3DSystem& physSytem = world.AddSystem<Nz::Physics3DSystem>();
physSytem.GetPhysWorld().SetGravity(Nz::Vector3f::Zero());
Nz::RenderSystem& renderSystem = world.AddSystem<Nz::RenderSystem>();
@ -101,7 +101,7 @@ int main(int argc, char* argv[])
cameraComponent.UpdateClearColor(Nz::Color(0.5f, 0.5f, 0.5f));
}
auto shipCollider = std::make_shared<Nz::BulletConvexCollider3D>(vertices, vertexMapper.GetVertexCount());
auto shipCollider = std::make_shared<Nz::ConvexHullCollider3D>(vertices, vertexMapper.GetVertexCount());
std::shared_ptr<Nz::MaterialInstance> colliderMat = Nz::MaterialInstance::Instantiate(Nz::MaterialType::Basic);
colliderMat->SetValueProperty("BaseColor", Nz::Color::Green());
@ -127,7 +127,7 @@ int main(int argc, char* argv[])
entityGfx.AttachRenderable(sprite, 1);
auto& entityNode = textEntity.emplace<Nz::NodeComponent>();
entityNode.SetPosition(0.f, 5.f, 0.f);
entityNode.SetPosition({ 0.f, 5.f, 0.f });
}
entt::handle playerEntity = world.CreateEntity();
@ -139,7 +139,11 @@ int main(int argc, char* argv[])
auto& entityNode = playerEntity.emplace<Nz::NodeComponent>();
entityNode.SetPosition(Nz::Vector3f(12.5f, 0.f, 25.f));
auto& entityPhys = playerEntity.emplace<Nz::BulletRigidBody3DComponent>(physSytem.CreateRigidBody(shipCollider));
Nz::RigidBody3D::DynamicSettings settings;
settings.geom = shipCollider;
settings.mass = 100.f;
auto& entityPhys = playerEntity.emplace<Nz::RigidBody3DComponent>(settings);
entityPhys.SetMass(50.f);
entityPhys.SetAngularDamping(0.1f);
entityPhys.SetLinearDamping(0.5f);
@ -178,7 +182,11 @@ int main(int argc, char* argv[])
entityNode.SetPosition(Nz::Vector3f(x * 2.f, y * 1.5f, z * 2.f));
entityNode.SetRotation(Nz::EulerAnglesf(0.f, Nz::TurnAnglef(0.5f), 0.f));
auto& entityPhys = entity.emplace<Nz::BulletRigidBody3DComponent>(physSytem.CreateRigidBody(shipCollider));
Nz::RigidBody3D::DynamicSettings settings;
settings.geom = shipCollider;
settings.mass = 100.f;
auto& entityPhys = entity.emplace<Nz::RigidBody3DComponent>(settings);
entityPhys.SetMass(1.f);
entityPhys.SetAngularDamping(0.f);
entityPhys.SetLinearDamping(0.f);
@ -213,13 +221,13 @@ int main(int argc, char* argv[])
showColliders = !showColliders;
if (showColliders)
{
auto view = world.GetRegistry().view<Nz::GraphicsComponent, Nz::BulletRigidBody3DComponent>();
auto view = world.GetRegistry().view<Nz::GraphicsComponent, Nz::RigidBody3DComponent>();
for (auto [entity, gfxComponent, _] : view.each())
gfxComponent.AttachRenderable(colliderModel, 1);
}
else
{
auto view = world.GetRegistry().view<Nz::GraphicsComponent, Nz::BulletRigidBody3DComponent>();
auto view = world.GetRegistry().view<Nz::GraphicsComponent, Nz::RigidBody3DComponent>();
for (auto [entity, gfxComponent, _] : view.each())
gfxComponent.DetachRenderable(colliderModel);
}
@ -234,7 +242,11 @@ int main(int argc, char* argv[])
entity.emplace<Nz::NodeComponent>();
auto& entityPhys = entity.emplace<Nz::BulletRigidBody3DComponent>(physSytem.CreateRigidBody(shipCollider));
Nz::RigidBody3D::DynamicSettings settings;
settings.geom = shipCollider;
settings.mass = 100.f;
auto& entityPhys = entity.emplace<Nz::RigidBody3DComponent>(settings);
entityPhys.SetMass(1.f);
entityPhys.SetAngularDamping(0.f);
entityPhys.SetLinearDamping(0.f);
@ -261,18 +273,18 @@ int main(int argc, char* argv[])
{
float elapsedTime = deltaTime->AsSeconds();
auto spaceshipView = world.GetRegistry().view<Nz::NodeComponent, Nz::BulletRigidBody3DComponent>();
auto spaceshipView = world.GetRegistry().view<Nz::NodeComponent, Nz::RigidBody3DComponent>();
for (auto&& [entity, node, _] : spaceshipView.each())
{
if (entity == playerEntity)
continue;
Nz::Vector3f spaceshipPos = node.GetPosition(Nz::CoordSys::Global);
Nz::Vector3f spaceshipPos = node.GetGlobalPosition();
if (spaceshipPos.GetSquaredLength() > Nz::IntegralPow(20.f, 2))
world.GetRegistry().destroy(entity);
}
Nz::BulletRigidBody3DComponent& playerShipBody = playerEntity.get<Nz::BulletRigidBody3DComponent>();
Nz::RigidBody3DComponent& playerShipBody = playerEntity.get<Nz::RigidBody3DComponent>();
Nz::Quaternionf currentRotation = playerShipBody.GetRotation();
Nz::Vector3f desiredHeading = headingEntity.get<Nz::NodeComponent>().GetForward();

View File

@ -1,5 +1,5 @@
target("PhysicsDemo")
add_deps("NazaraGraphics", "NazaraBulletPhysics3D")
add_deps("NazaraGraphics", "NazaraPhysics3D")
add_packages("entt")
add_files("main.cpp")
add_defines("NAZARA_ENTT")

View File

@ -1,17 +1,8 @@
// Sources pour https://github.com/NazaraEngine/NazaraEngine/wiki/(FR)-Tutoriel:-%5B01%5D-Hello-World
#define USE_JOLT 1
#include <Nazara/Core.hpp>
#include <Nazara/Graphics.hpp>
#include <Nazara/Platform/AppWindowingComponent.hpp>
#if USE_JOLT
#include <Nazara/JoltPhysics3D.hpp>
#else
#include <Nazara/BulletPhysics3D.hpp>
#endif
#include <Nazara/Platform/WindowingAppComponent.hpp>
#include <Nazara/Physics3D.hpp>
#include <Nazara/Renderer.hpp>
#include <Nazara/Utility.hpp>
#include <iostream>
#include <random>
@ -24,16 +15,12 @@ int main(int argc, char* argv[])
Nz::Renderer::Config renderConfig;
renderConfig.validationLevel = Nz::RenderAPIValidationLevel::None;
#if USE_JOLT
Nz::Application<Nz::Graphics, Nz::JoltPhysics3D> app(argc, argv, renderConfig);
#else
Nz::Application<Nz::Graphics, Nz::BulletPhysics3D> app(argc, argv, renderConfig);
#endif
Nz::Application<Nz::Graphics, Nz::Physics3D> app(argc, argv, renderConfig);
auto& windowing = app.AddComponent<Nz::AppWindowingComponent>();
auto& windowing = app.AddComponent<Nz::WindowingAppComponent>();
Nz::Window& mainWindow = windowing.CreateWindow(Nz::VideoMode(1280, 720), "Physics playground");
auto& fs = app.AddComponent<Nz::AppFilesystemComponent>();
auto& fs = app.AddComponent<Nz::FilesystemAppComponent>();
{
std::filesystem::path resourceDir = "assets/examples";
if (!std::filesystem::is_directory(resourceDir) && std::filesystem::is_directory("../.." / resourceDir))
@ -42,14 +29,10 @@ int main(int argc, char* argv[])
fs.Mount("assets", resourceDir);
}
auto& ecs = app.AddComponent<Nz::AppEntitySystemComponent>();
auto& ecs = app.AddComponent<Nz::EntitySystemAppComponent>();
auto& world = ecs.AddWorld<Nz::EnttWorld>();
#if USE_JOLT
auto& physSystem = world.AddSystem<Nz::JoltPhysics3DSystem>();
#else
auto& physSystem = world.AddSystem<Nz::BulletPhysics3DSystem>();
#endif
auto& physSystem = world.AddSystem<Nz::Physics3DSystem>();
physSystem.GetPhysWorld().SetMaxStepCount(1);
physSystem.GetPhysWorld().SetStepSize(Nz::Time::TickDuration(30));
physSystem.GetPhysWorld().SetGravity(Nz::Vector3f::Down() * 9.81f);
@ -96,46 +79,24 @@ int main(int argc, char* argv[])
boxColliderEntity.emplace<Nz::NodeComponent>();
#if USE_JOLT
float thickness = 1.f;
std::shared_ptr<Nz::JoltBoxCollider3D> wallCollider = std::make_shared<Nz::JoltBoxCollider3D>(Nz::Vector3f(BoxDims + thickness * 2.f, BoxDims + thickness * 2.f, thickness));
#else
std::shared_ptr<Nz::BulletBoxCollider3D> wallCollider = std::make_shared<Nz::BulletBoxCollider3D>(Nz::Vector3f(BoxDims, BoxDims, 1.f));
#endif
#if USE_JOLT
std::vector<Nz::JoltCompoundCollider3D::ChildCollider> colliders;
#else
std::vector<Nz::BulletCompoundCollider3D::ChildCollider> colliders;
#endif
std::shared_ptr<Nz::BoxCollider3D> wallCollider = std::make_shared<Nz::BoxCollider3D>(Nz::Vector3f(BoxDims + thickness * 2.f, BoxDims + thickness * 2.f, thickness));
std::vector<Nz::CompoundCollider3D::ChildCollider> colliders;
for (Nz::Vector3f normal : { Nz::Vector3f::Forward(), Nz::Vector3f::Backward(), Nz::Vector3f::Left(), Nz::Vector3f::Right(), Nz::Vector3f::Up(), Nz::Vector3f::Down() })
{
auto& colliderEntry = colliders.emplace_back();
colliderEntry.collider = wallCollider;
#if USE_JOLT
colliderEntry.rotation = Nz::Quaternionf::RotationBetween(Nz::Vector3f::Forward(), normal);
colliderEntry.offset = normal * BoxDims * 0.5f + normal * 0.5f;
#else
colliderEntry.offsetMatrix = Nz::Matrix4f::Transform(normal * BoxDims * 0.5f + normal * 0.5f, Nz::Quaternionf::RotationBetween(Nz::Vector3f::Forward(), normal));
#endif
}
#if USE_JOLT
std::shared_ptr<Nz::JoltCompoundCollider3D> boxCollider = std::make_shared<Nz::JoltCompoundCollider3D>(std::move(colliders));
#else
std::shared_ptr<Nz::BulletCompoundCollider3D> boxCollider = std::make_shared<Nz::BulletCompoundCollider3D>(std::move(colliders));
#endif
std::shared_ptr<Nz::CompoundCollider3D> boxCollider = std::make_shared<Nz::CompoundCollider3D>(std::move(colliders));
#if USE_JOLT
Nz::JoltRigidBody3D::StaticSettings settings;
Nz::RigidBody3D::StaticSettings settings;
settings.geom = boxCollider;
boxColliderEntity.emplace<Nz::JoltRigidBody3DComponent>(settings);
#else
auto& boxBody = boxColliderEntity.emplace<Nz::BulletRigidBody3DComponent>(physSystem.CreateRigidBody(boxCollider));
boxBody.SetMass(0.f);
#endif
boxColliderEntity.emplace<Nz::RigidBody3DComponent>(settings);
std::shared_ptr<Nz::Model> colliderModel;
{
@ -163,11 +124,7 @@ int main(int argc, char* argv[])
float radius = radiusDis(rd);
std::uniform_real_distribution<float> positionRandom(-BoxDims * 0.5f + radius, BoxDims * 0.5f - radius);
#if USE_JOLT
std::shared_ptr<Nz::JoltSphereCollider3D> sphereCollider = std::make_shared<Nz::JoltSphereCollider3D>(radius);
#else
std::shared_ptr<Nz::BulletSphereCollider3D> sphereCollider = std::make_shared<Nz::BulletSphereCollider3D>(radius);
#endif
std::shared_ptr<Nz::SphereCollider3D> sphereCollider = std::make_shared<Nz::SphereCollider3D>(radius);
entt::handle ballEntity = world.CreateEntity();
@ -181,18 +138,14 @@ int main(int argc, char* argv[])
ballGfx.AttachRenderable(std::move(sphereModel));
auto& ballNode = ballEntity.emplace<Nz::NodeComponent>();
ballNode.SetPosition(positionRandom(rd), positionRandom(rd), positionRandom(rd));
ballNode.SetPosition({ positionRandom(rd), positionRandom(rd), positionRandom(rd) });
ballNode.SetScale(radius);
#if USE_JOLT
Nz::JoltRigidBody3D::DynamicSettings settings;
Nz::RigidBody3D::DynamicSettings settings;
settings.geom = sphereCollider;
settings.mass = 4.f / 3.f * Nz::Pi<float> * Nz::IntegralPow(radius, 3);
ballEntity.emplace<Nz::JoltRigidBody3DComponent>(settings);
#else
ballEntity.emplace<Nz::BulletRigidBody3DComponent>(physSystem.CreateRigidBody(sphereCollider));
#endif
ballEntity.emplace<Nz::RigidBody3DComponent>(settings);
}
std::uniform_real_distribution<float> lengthDis(0.2f, 1.5f);
@ -220,24 +173,16 @@ int main(int argc, char* argv[])
boxEntity.emplace<Nz::GraphicsComponent>(std::move(sphereModel));
auto& ballNode = boxEntity.emplace<Nz::NodeComponent>();
ballNode.SetPosition(xRandom(rd), yRandom(rd), zRandom(rd));
ballNode.SetScale(width, height, depth);
ballNode.SetPosition({ xRandom(rd), yRandom(rd), zRandom(rd) });
ballNode.SetScale({ width, height, depth });
#if USE_JOLT
std::shared_ptr<Nz::JoltBoxCollider3D> boxCollider = std::make_shared<Nz::JoltBoxCollider3D>(Nz::Vector3f(width, height, depth));
#else
std::shared_ptr<Nz::BulletBoxCollider3D> boxCollider = std::make_shared<Nz::BulletBoxCollider3D>(Nz::Vector3f(width, height, depth));
#endif
std::shared_ptr<Nz::BoxCollider3D> boxCollider = std::make_shared<Nz::BoxCollider3D>(Nz::Vector3f(width, height, depth));
#if USE_JOLT
Nz::JoltRigidBody3D::DynamicSettings settings;
Nz::RigidBody3D::DynamicSettings settings;
settings.geom = boxCollider;
settings.mass = width * height * depth;
boxEntity.emplace<Nz::JoltRigidBody3DComponent>(settings);
#else
boxEntity.emplace<Nz::BulletRigidBody3DComponent>(physSystem.CreateRigidBody(boxCollider));
#endif
boxEntity.emplace<Nz::RigidBody3DComponent>(settings);
}
// Spaceships
@ -281,11 +226,7 @@ int main(int argc, char* argv[])
Nz::VertexMapper vertexMapper(*spaceshipMesh->GetSubMesh(0));
Nz::SparsePtr<Nz::Vector3f> vertices = vertexMapper.GetComponentPtr<Nz::Vector3f>(Nz::VertexComponent::Position);
#if USE_JOLT
auto shipCollider = std::make_shared<Nz::JoltConvexHullCollider3D>(vertices, vertexMapper.GetVertexCount(), 0.1f);
#else
auto shipCollider = std::make_shared<Nz::BulletConvexCollider3D>(vertices, vertexMapper.GetVertexCount());
#endif
auto shipCollider = std::make_shared<Nz::ConvexHullCollider3D>(vertices, vertexMapper.GetVertexCount(), 0.1f);
std::shared_ptr<Nz::Model> colliderModel;
{
@ -305,17 +246,13 @@ int main(int argc, char* argv[])
shipEntity.emplace<Nz::GraphicsComponent>(model);
auto& shipNode = shipEntity.emplace<Nz::NodeComponent>();
shipNode.SetPosition(xRandom(rd), yRandom(rd), zRandom(rd));
shipNode.SetPosition({ xRandom(rd), yRandom(rd), zRandom(rd) });
#if USE_JOLT
Nz::JoltRigidBody3D::DynamicSettings settings;
Nz::RigidBody3D::DynamicSettings settings;
settings.geom = shipCollider;
settings.mass = 100.f;
shipEntity.emplace<Nz::JoltRigidBody3DComponent>(settings);
#else
shipEntity.emplace<Nz::BulletRigidBody3DComponent>(physSystem.CreateRigidBody(shipCollider));
#endif
shipEntity.emplace<Nz::RigidBody3DComponent>(settings);
//shipEntity.get<Nz::GraphicsComponent>().AttachRenderable(colliderModel);
}
@ -363,10 +300,10 @@ int main(int argc, char* argv[])
NazaraSlot(Nz::WindowEventHandler, OnMouseMoved, cameraMove);
NazaraSlot(Nz::WindowEventHandler, OnMouseMoved, grabbedObjectMove);
#if USE_JOLT
struct GrabConstraint
{
GrabConstraint(Nz::JoltRigidBody3D& body, const Nz::Vector3f& grabPos) :
GrabConstraint(Nz::RigidBody3D& body, const Nz::Vector3f& grabPos) :
grabBody(body.GetWorld(), BodySettings(grabPos)),
grabConstraint(body, grabBody, grabPos)
{
@ -386,9 +323,9 @@ int main(int argc, char* argv[])
grabBody.SetPosition(pos);
}
static Nz::JoltRigidBody3D::DynamicSettings BodySettings(const Nz::Vector3f& pos)
static Nz::RigidBody3D::DynamicSettings BodySettings(const Nz::Vector3f& pos)
{
Nz::JoltRigidBody3D::DynamicSettings settings;
Nz::RigidBody3D::DynamicSettings settings;
settings.mass = 0.f; //< kinematic
settings.isSimulationEnabled = false;
settings.position = pos;
@ -396,14 +333,11 @@ int main(int argc, char* argv[])
return settings;
}
Nz::JoltRigidBody3D grabBody;
Nz::JoltDistanceConstraint3D grabConstraint;
Nz::RigidBody3D grabBody;
Nz::PhysDistanceConstraint3D grabConstraint;
};
std::optional<GrabConstraint> grabConstraint;
#else
std::optional<Nz::BulletPivotConstraint3D> grabConstraint;
#endif
auto mouseMoveCallback = [&](const Nz::WindowEventHandler*, const Nz::WindowEvent::MouseMoveEvent& event)
{
@ -430,11 +364,7 @@ int main(int argc, char* argv[])
Nz::Vector3f from = cameraComponent.Unproject({ float(event.x), float(event.y), 0.f });
Nz::Vector3f to = cameraComponent.Unproject({ float(event.x), float(event.y), 1.f });
#if USE_JOLT
Nz::JoltPhysics3DSystem::RaycastHit lastHitInfo;
#else
Nz::BulletPhysics3DSystem::RaycastHit lastHitInfo;
#endif
Nz::Physics3DSystem::RaycastHit lastHitInfo;
auto callback = [&](const decltype(lastHitInfo)& hitInfo) -> std::optional<float>
{
if (hitInfo.hitEntity == boxColliderEntity)
@ -455,12 +385,7 @@ int main(int argc, char* argv[])
{
if (lastHitInfo.hitBody && lastHitInfo.hitEntity != boxColliderEntity)
{
#if USE_JOLT
grabConstraint.emplace(static_cast<Nz::JoltRigidBody3D&>(*lastHitInfo.hitBody), lastHitInfo.hitPosition);
#else
grabConstraint.emplace(*lastHitInfo.hitBody, lastHitInfo.hitPosition);
grabConstraint->SetImpulseClamp(30.f);
#endif
grabConstraint.emplace(static_cast<Nz::RigidBody3D&>(*lastHitInfo.hitBody), lastHitInfo.hitPosition);
grabbedObjectMove.Connect(eventHandler.OnMouseMoved, [&, distance = Nz::Vector3f::Distance(from, lastHitInfo.hitPosition)](const Nz::WindowEventHandler*, const Nz::WindowEvent::MouseMoveEvent& event)
{
@ -468,11 +393,7 @@ int main(int argc, char* argv[])
Nz::Vector3f to = cameraComponent.Unproject({ float(event.x), float(event.y), 1.f });
Nz::Vector3f newPosition = from + (to - from).Normalize() * distance;
#if USE_JOLT
grabConstraint->SetPosition(newPosition);
#else
grabConstraint->SetSecondAnchor(newPosition);
#endif
});
}
else

View File

@ -1,5 +1,5 @@
target("PhysicsPlayground")
add_deps("NazaraGraphics", "NazaraBulletPhysics3D", "NazaraJoltPhysics3D")
add_deps("NazaraGraphics", "NazaraPhysics3D")
add_packages("entt")
add_files("main.cpp")
add_defines("NAZARA_ENTT")

View File

@ -1,12 +1,11 @@
#include <Nazara/Core.hpp>
#include <Nazara/Core/Plugins/AssimpPlugin.hpp>
#include <Nazara/Platform.hpp>
#include <Nazara/Graphics.hpp>
#include <Nazara/Math/PidController.hpp>
#include <Nazara/BulletPhysics3D.hpp>
#include <Nazara/JoltPhysics3D.hpp>
#include <Nazara/Physics3D.hpp>
#include <Nazara/Renderer.hpp>
#include <Nazara/Utility.hpp>
#include <Nazara/Utility/Plugins/AssimpPlugin.hpp>
#include <Nazara/TextRenderer/SimpleTextDrawer.hpp>
#include <NazaraUtils/CallOnExit.hpp>
#include <NZSL/Math/FieldOffsets.hpp>
#include <entt/entt.hpp>
@ -19,29 +18,29 @@ NAZARA_REQUEST_DEDICATED_GPU()
int main(int argc, char* argv[])
{
Nz::Application<Nz::Graphics, Nz::JoltPhysics3D> app(argc, argv);
Nz::Application<Nz::Graphics, Nz::Physics3D> app(argc, argv);
Nz::PluginLoader loader;
Nz::Plugin<Nz::AssimpPlugin> assimp = loader.Load<Nz::AssimpPlugin>();
std::shared_ptr<Nz::RenderDevice> device = Nz::Graphics::Instance()->GetRenderDevice();
auto& ecs = app.AddComponent<Nz::AppEntitySystemComponent>();
auto& ecs = app.AddComponent<Nz::EntitySystemAppComponent>();
auto& world = ecs.AddWorld<Nz::EnttWorld>();
world.AddSystem<Nz::SkeletonSystem>();
Nz::JoltPhysics3DSystem& physSytem = world.AddSystem<Nz::JoltPhysics3DSystem>();
Nz::Physics3DSystem& physSytem = world.AddSystem<Nz::Physics3DSystem>();
physSytem.GetPhysWorld().SetGravity(Nz::Vector3f::Zero());
Nz::RenderSystem& renderSystem = world.AddSystem<Nz::RenderSystem>();
auto& windowing = app.AddComponent<Nz::AppWindowingComponent>();
auto& windowing = app.AddComponent<Nz::WindowingAppComponent>();
std::string windowTitle = "Skinning test";
Nz::Window& mainWindow = windowing.CreateWindow(Nz::VideoMode(1280, 720), windowTitle);
auto& windowSwapchain = renderSystem.CreateSwapchain(mainWindow);
auto& fs = app.AddComponent<Nz::AppFilesystemComponent>();
auto& fs = app.AddComponent<Nz::FilesystemAppComponent>();
{
std::filesystem::path resourceDir = "assets/examples";
if (!std::filesystem::is_directory(resourceDir) && std::filesystem::is_directory("../.." / resourceDir))
@ -52,21 +51,21 @@ int main(int argc, char* argv[])
physSytem.GetPhysWorld().SetGravity({ 0.f, -9.81f, 0.f });
std::optional<Nz::JoltCharacter> character;
std::optional<Nz::PhysCharacter3D> character;
entt::handle playerEntity = world.CreateEntity();
entt::handle playerRotation = world.CreateEntity();
entt::handle playerCamera = world.CreateEntity();
{
auto& playerNode = playerEntity.emplace<Nz::NodeComponent>();
playerNode.SetPosition(0.f, 1.8f, 1.f);
playerNode.SetPosition({ 0.f, 1.8f, 1.f });
auto playerCollider = std::make_shared<Nz::JoltBoxCollider3D>(Nz::Vector3f(0.2f, 1.8f, 0.2f));
auto playerCollider = std::make_shared<Nz::BoxCollider3D>(Nz::Vector3f(0.2f, 1.8f, 0.2f));
//auto& playerBody = playerEntity.emplace<Nz::JoltRigidBody3DComponent>(physSytem.CreateRigidBody(playerCollider));
//auto& playerBody = playerEntity.emplace<Nz::RigidBody3DComponent>(physSytem.CreateRigidBody(playerCollider));
//playerBody.SetMass(42.f);
Nz::JoltCharacter::Settings characterSettings;
Nz::PhysCharacter3D::Settings characterSettings;
characterSettings.collider = playerCollider;
characterSettings.position = Nz::Vector3f::Up() * 5.f;
@ -287,7 +286,7 @@ int main(int argc, char* argv[])
auto [sin, cos] = rotation.GetSinCos();
auto& lightNode = lightEntity3.get<Nz::NodeComponent>();
lightNode.SetPosition(sin * radius, 1.5f, cos * radius);
lightNode.SetPosition({ sin * radius, 1.5f, cos * radius });
});
auto& cameraLight = lightEntity3.emplace<Nz::LightComponent>();
@ -364,13 +363,13 @@ int main(int argc, char* argv[])
floorEntity.emplace<Nz::NodeComponent>();
auto floorCollider = std::make_shared<Nz::JoltBoxCollider3D>(Nz::Vector3f(planeSize.x, 1.f, planeSize.y));
auto translatedFloorCollider = std::make_shared<Nz::JoltTranslatedRotatedCollider3D>(std::move(floorCollider), Nz::Vector3f::Down() * 0.5f);
auto floorCollider = std::make_shared<Nz::BoxCollider3D>(Nz::Vector3f(planeSize.x, 1.f, planeSize.y));
auto translatedFloorCollider = std::make_shared<Nz::TranslatedRotatedCollider3D>(std::move(floorCollider), Nz::Vector3f::Down() * 0.5f);
Nz::JoltRigidBody3D::StaticSettings floorSettings;
Nz::RigidBody3D::StaticSettings floorSettings;
floorSettings.geom = translatedFloorCollider;
floorEntity.emplace<Nz::JoltRigidBody3DComponent>(floorSettings);
floorEntity.emplace<Nz::RigidBody3DComponent>(floorSettings);
std::shared_ptr<Nz::GraphicalMesh> boxMeshGfx = Nz::GraphicalMesh::Build(Nz::Primitive::Box(Nz::Vector3f(0.5f, 0.5f, 0.5f)), meshPrimitiveParams);
@ -530,7 +529,7 @@ int main(int argc, char* argv[])
{
float updateTime = deltaTime->AsSeconds();
//auto& playerBody = playerEntity.get<Nz::JoltRigidBody3DComponent>();
//auto& playerBody = playerEntity.get<Nz::RigidBody3DComponent>();
//playerBody.SetAngularDamping(std::numeric_limits<float>::max());
Nz::Vector3f velocity = character->GetLinearVelocity();
@ -561,19 +560,19 @@ int main(int argc, char* argv[])
auto& cameraNode = playerCamera.get<Nz::NodeComponent>();
if (Nz::Keyboard::IsKeyPressed(Nz::Keyboard::VKey::Space))
cameraNode.Move(Nz::Vector3f::Up() * cameraSpeed * updateTime, Nz::CoordSys::Global);
cameraNode.MoveGlobal(Nz::Vector3f::Up() * cameraSpeed * updateTime);
if (Nz::Keyboard::IsKeyPressed(Nz::Keyboard::VKey::Z))
cameraNode.Move(Nz::Vector3f::Forward() * cameraSpeed * updateTime, Nz::CoordSys::Local);
cameraNode.Move(Nz::Vector3f::Forward() * cameraSpeed * updateTime);
if (Nz::Keyboard::IsKeyPressed(Nz::Keyboard::VKey::S))
cameraNode.Move(Nz::Vector3f::Backward() * cameraSpeed * updateTime, Nz::CoordSys::Local);
cameraNode.Move(Nz::Vector3f::Backward() * cameraSpeed * updateTime);
if (Nz::Keyboard::IsKeyPressed(Nz::Keyboard::VKey::Q))
cameraNode.Move(Nz::Vector3f::Left() * cameraSpeed * updateTime, Nz::CoordSys::Local);
cameraNode.Move(Nz::Vector3f::Left() * cameraSpeed * updateTime);
if (Nz::Keyboard::IsKeyPressed(Nz::Keyboard::VKey::D))
cameraNode.Move(Nz::Vector3f::Right() * cameraSpeed * updateTime, Nz::CoordSys::Local);
cameraNode.Move(Nz::Vector3f::Right() * cameraSpeed * updateTime);
if (!paused)
{
@ -603,7 +602,7 @@ int main(int argc, char* argv[])
if (entity == playerEntity)
continue;
Nz::Vector3f spaceshipPos = node.GetPosition(Nz::CoordSys::Global);
Nz::Vector3f spaceshipPos = node.GetGlobalPosition();
if (spaceshipPos.GetSquaredLength() > Nz::IntegralPow(20.f, 2))
registry.destroy(entity);
}
@ -646,8 +645,8 @@ int main(int argc, char* argv[])
Nz::DebugDrawer& debugDrawer = renderSystem.GetFramePipeline().GetDebugDrawer();
auto& lightNode = lightEntity3.get<Nz::NodeComponent>();
//debugDrawer.DrawLine(lightNode.GetPosition(Nz::CoordSys::Global), lightNode.GetForward() * 10.f, Nz::Color::Blue());
Nz::Vector3f pos = lightNode.GetPosition(Nz::CoordSys::Global);
//debugDrawer.DrawLine(lightNode.GetGlobalPosition(), lightNode.GetForward() * 10.f, Nz::Color::Blue());
Nz::Vector3f pos = lightNode.GetGlobalPosition();
debugDrawer.DrawPoint(pos, Nz::Color::Blue());
/*debugDrawer.DrawBox(floorBox, Nz::Color::Red);
Nz::Boxf intersection;

View File

@ -5,7 +5,7 @@ end
target("Showcase")
set_group("Examples")
set_kind("binary")
add_deps("NazaraAudio", "NazaraGraphics", "NazaraChipmunkPhysics2D", "NazaraBulletPhysics3D", "NazaraJoltPhysics3D", "NazaraWidgets")
add_deps("NazaraAudio", "NazaraGraphics", "NazaraPhysics2D", "NazaraPhysics3D", "NazaraWidgets")
if has_config("embed_plugins", "static") then
add_deps("PluginAssimp")
else

View File

@ -2,17 +2,18 @@
#include <Nazara/Core.hpp>
#include <Nazara/Graphics.hpp>
#include <Nazara/Network.hpp>
#include <Nazara/BulletPhysics3D.hpp>
#include <Nazara/ChipmunkPhysics2D.hpp>
#include <Nazara/Physics3D.hpp>
#include <Nazara/Physics2D.hpp>
#include <Nazara/Renderer.hpp>
#include <Nazara/Utility.hpp>
#include <Nazara/TextRenderer.hpp>
#include <Nazara/Widgets.hpp>
#include <iostream>
int main(int argc, char* argv[])
{
// This "example" has only one purpose: Giving an empty project for you to test whatever you want
// If you wish to have multiple test projects, you only have to copy/paste this directory and change the name in the xmake.lua
Nz::Application<Nz::Audio, Nz::Core, Nz::Graphics, Nz::Network, Nz::ChipmunkPhysics2D, Nz::BulletPhysics3D, Nz::Renderer, Nz::Utility> app(argc, argv);
Nz::Application<Nz::Audio, Nz::Core, Nz::Graphics, Nz::Network, Nz::Physics2D, Nz::Physics3D, Nz::Renderer, Nz::TextRenderer, Nz::Widgets> app(argc, argv);
return EXIT_SUCCESS;
}

View File

@ -1,3 +1,5 @@
target("Tut00_EmptyProject")
add_deps("NazaraAudio", "NazaraGraphics", "NazaraNetwork", "NazaraChipmunkPhysics2D", "NazaraBulletPhysics3D", "NazaraRenderer", "NazaraUtility")
add_packages("entt")
add_defines("NAZARA_ENTT")
add_deps("NazaraAudio", "NazaraGraphics", "NazaraNetwork", "NazaraPhysics2D", "NazaraPhysics3D", "NazaraRenderer", "NazaraTextRenderer", "NazaraWidgets")
add_files("main.cpp")

View File

@ -2,9 +2,9 @@
#include <Nazara/Core.hpp>
#include <Nazara/Graphics.hpp>
#include <Nazara/Platform/AppWindowingComponent.hpp>
#include <Nazara/Platform/WindowingAppComponent.hpp>
#include <Nazara/Renderer.hpp>
#include <Nazara/Utility.hpp>
#include <Nazara/TextRenderer/SimpleTextDrawer.hpp>
#include <iostream>
int main(int argc, char* argv[])
@ -12,10 +12,10 @@ int main(int argc, char* argv[])
// Mise en place de l'application, de la fenêtre et du monde
Nz::Application<Nz::Graphics> app(argc, argv);
auto& windowing = app.AddComponent<Nz::AppWindowingComponent>();
auto& windowing = app.AddComponent<Nz::WindowingAppComponent>();
Nz::Window& mainWindow = windowing.CreateWindow(Nz::VideoMode(1280, 720), "Tut01 - Hello world");
auto& ecs = app.AddComponent<Nz::AppEntitySystemComponent>();
auto& ecs = app.AddComponent<Nz::EntitySystemAppComponent>();
auto& world = ecs.AddWorld<Nz::EnttWorld>();
auto& renderSystem = world.AddSystem<Nz::RenderSystem>();
@ -48,7 +48,7 @@ int main(int argc, char* argv[])
Nz::Boxf textBox = textSprite->GetAABB();
Nz::Vector2ui windowSize = mainWindow.GetSize();
nodeComponent.SetPosition(windowSize.x / 2 - textBox.width / 2, windowSize.y / 2 - textBox.height / 2);
nodeComponent.SetPosition({ windowSize.x / 2 - textBox.width / 2, windowSize.y / 2 - textBox.height / 2 });
}
return app.Run();

View File

@ -2,9 +2,9 @@
#include <Nazara/Core.hpp>
#include <Nazara/Graphics.hpp>
#include <Nazara/Platform/AppWindowingComponent.hpp>
#include <Nazara/Platform/WindowingAppComponent.hpp>
#include <Nazara/Renderer.hpp>
#include <Nazara/Utility.hpp>
#include <Nazara/TextRenderer/SimpleTextDrawer.hpp>
#include <iostream>
int main(int argc, char* argv[])
@ -12,11 +12,11 @@ int main(int argc, char* argv[])
Nz::Application<Nz::Graphics> app(argc, argv);
// Création de la fenêtre
auto& windowing = app.AddComponent<Nz::AppWindowingComponent>();
auto& windowing = app.AddComponent<Nz::WindowingAppComponent>();
Nz::Window& mainWindow = windowing.CreateWindow(Nz::VideoMode(1280, 720), "Tut02 - Events");
// Ajout d'un monde
auto& ecs = app.AddComponent<Nz::AppEntitySystemComponent>();
auto& ecs = app.AddComponent<Nz::EntitySystemAppComponent>();
auto& world = ecs.AddWorld<Nz::EnttWorld>();
Nz::RenderSystem& renderSystem = world.AddSystem<Nz::RenderSystem>();
@ -53,7 +53,7 @@ int main(int argc, char* argv[])
Nz::Boxf textBox = textSprite->GetAABB();
Nz::Vector2ui windowSize = mainWindow.GetSize();
nodeComponent.SetPosition(windowSize.x / 2 - textBox.width / 2, windowSize.y / 2 - textBox.height / 2);
nodeComponent.SetPosition({ windowSize.x / 2 - textBox.width / 2, windowSize.y / 2 - textBox.height / 2 });
}
eventHandler.OnKeyPressed.Connect([&](const Nz::WindowEventHandler*, const Nz::WindowEvent::KeyEvent& e)
@ -65,7 +65,7 @@ int main(int argc, char* argv[])
Nz::Vector2ui windowSize = mainWindow.GetSize();
auto& nodeComponent = textEntity.get<Nz::NodeComponent>();
nodeComponent.SetPosition(windowSize.x / 2 - textBox.width / 2, windowSize.y / 2 - textBox.height / 2);
nodeComponent.SetPosition({ windowSize.x / 2 - textBox.width / 2, windowSize.y / 2 - textBox.height / 2 });
// Profitons-en aussi pour nous donner un moyen de quitter le programme
if (e.virtualKey == Nz::Keyboard::VKey::Escape)

View File

@ -3,7 +3,7 @@
#include <Nazara/Graphics.hpp>
#include <Nazara/Math/PidController.hpp>
#include <Nazara/Renderer.hpp>
#include <Nazara/Utility.hpp>
#include <Nazara/TextRenderer.hpp>
#include <Nazara/Widgets.hpp>
#include <entt/entt.hpp>
#include <array>
@ -16,13 +16,13 @@ int main(int argc, char* argv[])
{
Nz::Application<Nz::Graphics, Nz::Widgets> app(argc, argv);
auto& windowing = app.AddComponent<Nz::AppWindowingComponent>();
auto& windowing = app.AddComponent<Nz::WindowingAppComponent>();
Nz::Window& mainWindow = windowing.CreateWindow(Nz::VideoMode(1920, 1080), "Widget demo");
auto& ecs = app.AddComponent<Nz::AppEntitySystemComponent>();
auto& ecs = app.AddComponent<Nz::EntitySystemAppComponent>();
auto& world = ecs.AddWorld<Nz::EnttWorld>();
auto& fs = app.AddComponent<Nz::AppFilesystemComponent>();
auto& fs = app.AddComponent<Nz::FilesystemAppComponent>();
{
std::filesystem::path resourceDir = "assets/examples";
if (!std::filesystem::is_directory(resourceDir) && std::filesystem::is_directory("../.." / resourceDir))
@ -38,19 +38,15 @@ int main(int argc, char* argv[])
canvas2D.Resize(Nz::Vector2f(mainWindow.GetSize()));
Nz::LabelWidget* labelWidget = canvas2D.Add<Nz::LabelWidget>();
labelWidget->SetPosition(0.f, 200.f, 0.f);
labelWidget->SetPosition({ 0.f, 200.f });
labelWidget->UpdateText(Nz::SimpleTextDrawer::Draw("Je suis un LabelWidget !", 72));
unsigned int clickCount = 0;
Nz::ButtonWidget* buttonWidget = canvas2D.Add<Nz::ButtonWidget>();
buttonWidget->SetPosition(200.f, 400.f);
buttonWidget->SetPosition({ 200.f, 400.f });
buttonWidget->UpdateText(Nz::SimpleTextDrawer::Draw("Press me senpai", 72));
buttonWidget->Resize(buttonWidget->GetPreferredSize());
buttonWidget->OnButtonTrigger.Connect([&](const Nz::ButtonWidget*)
{
labelWidget->UpdateText(Nz::SimpleTextDrawer::Draw("You clicked the button " + std::to_string(++clickCount) + " times", 72));
});
Nz::TextureSamplerInfo samplerInfo;
samplerInfo.anisotropyLevel = 8;
@ -59,15 +55,15 @@ int main(int argc, char* argv[])
materialInstance->SetTextureProperty("BaseColorMap", fs.Load<Nz::Texture>("assets/lynix.jpg"));
Nz::ImageWidget* imageWidget = canvas2D.Add<Nz::ImageWidget>(materialInstance);
imageWidget->SetPosition(1200.f, 200.f);
imageWidget->SetPosition({ 1200.f, 200.f });
imageWidget->Resize(imageWidget->GetPreferredSize() / 4.f);
Nz::ImageButtonWidget* imageButtonWidget = canvas2D.Add<Nz::ImageButtonWidget>(materialInstance);
imageButtonWidget->SetPosition(1400, 500.f);
imageButtonWidget->SetPosition({ 1400, 500.f });
imageButtonWidget->Resize(imageButtonWidget->GetPreferredSize() / 4.f);
Nz::TextAreaWidget* textAreaWidget = canvas2D.Add<Nz::TextAreaWidget>();
textAreaWidget->SetPosition(800.f, 500.f);
textAreaWidget->SetPosition({ 800.f, 500.f });
textAreaWidget->SetText("Je suis un TextAreaWidget !");
textAreaWidget->Resize(Nz::Vector2f(400.f, textAreaWidget->GetPreferredHeight() * 5.f));
textAreaWidget->SetBackgroundColor(Nz::Color::White());
@ -76,7 +72,7 @@ int main(int argc, char* argv[])
Nz::CheckboxWidget* checkboxWidget = canvas2D.Add<Nz::CheckboxWidget>();
//checkboxWidget->EnableTristate(true);
checkboxWidget->SetPosition(800.f, 800.f);
checkboxWidget->SetPosition({ 800.f, 800.f });
checkboxWidget->Resize({ 256.f, 256 });
checkboxWidget->SetState(true);
@ -88,12 +84,12 @@ int main(int argc, char* argv[])
longTextArea->SetText("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum");
Nz::ScrollAreaWidget* scrollBarWidget = canvas2D.Add<Nz::ScrollAreaWidget>(longTextArea);
scrollBarWidget->SetPosition(1400.f, 800.f);
scrollBarWidget->SetPosition({ 1400.f, 800.f });
scrollBarWidget->Resize({ 512.f, 256.f });
Nz::RichTextAreaWidget* textAreaWidget2 = canvas2D.Add<Nz::RichTextAreaWidget>();
textAreaWidget2->EnableMultiline(true);
textAreaWidget2->SetPosition(1000.f, 200.f);
textAreaWidget2->SetPosition({ 1000.f, 200.f });
textAreaWidget2->SetBackgroundColor(Nz::Color::White());
textAreaWidget2->SetTextColor(Nz::Color::Black());
@ -101,6 +97,19 @@ int main(int argc, char* argv[])
builder << Nz::Color::Blue() << "Rich " << Nz::TextStyle::Bold << "text" << Nz::TextStyle_Regular << builder.CharacterSize(36) << Nz::Color::Black() << "\nAnd a even " << builder.CharacterSize(48) << Nz::Color::Red() << "bigger" << builder.CharacterSize(24) << Nz::Color::Black() << " text";
textAreaWidget2->Resize(Nz::Vector2f(500.f, textAreaWidget2->GetPreferredHeight()));
Nz::ProgressBarWidget* progressBarWidget = canvas2D.Add<Nz::ProgressBarWidget>();
progressBarWidget->SetPosition({ 200.f, 600.f });
progressBarWidget->Resize({ 512.f, 64.f });
buttonWidget->OnButtonTrigger.Connect([&](const Nz::ButtonWidget*)
{
labelWidget->UpdateText(Nz::SimpleTextDrawer::Draw("You clicked the button " + std::to_string(++clickCount) + " times", 72));
if (progressBarWidget->GetFraction() >= 1.f)
progressBarWidget->SetFraction(0.f);
else
progressBarWidget->SetFraction(progressBarWidget->GetFraction() + 0.1001f); //< ensures ten clicks go over 1
});
entt::handle viewer2D = world.CreateEntity();
{
viewer2D.emplace<Nz::NodeComponent>();

View File

@ -3,7 +3,7 @@
/*
Nazara Engine - Audio module
Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
@ -34,17 +34,18 @@
#include <Nazara/Audio/AudioBuffer.hpp>
#include <Nazara/Audio/AudioDevice.hpp>
#include <Nazara/Audio/AudioSource.hpp>
#include <Nazara/Audio/Config.hpp>
#include <Nazara/Audio/DummyAudioBuffer.hpp>
#include <Nazara/Audio/DummyAudioDevice.hpp>
#include <Nazara/Audio/DummyAudioSource.hpp>
#include <Nazara/Audio/Enums.hpp>
#include <Nazara/Audio/Export.hpp>
#include <Nazara/Audio/Music.hpp>
#include <Nazara/Audio/OpenAL.hpp>
#include <Nazara/Audio/OpenALBuffer.hpp>
#include <Nazara/Audio/OpenALDevice.hpp>
#include <Nazara/Audio/OpenALLibrary.hpp>
#include <Nazara/Audio/OpenALSource.hpp>
#include <Nazara/Audio/OpenALUtils.hpp>
#include <Nazara/Audio/Sound.hpp>
#include <Nazara/Audio/SoundBuffer.hpp>
#include <Nazara/Audio/SoundEmitter.hpp>

View File

@ -1,6 +1,6 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// For conditions of distribution and use, see copyright notice in Export.hpp
#pragma once

View File

@ -1,9 +1,8 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// For conditions of distribution and use, see copyright notice in Export.hpp
#include <Nazara/Core/Error.hpp>
#include <Nazara/Audio/Debug.hpp>
namespace Nz
{
@ -13,7 +12,7 @@ namespace Nz
* \returns The number of channels occupied by an audio format (mono returns 1, stereo returns 2, etc.)
*
* \param format A valid audio format
*
*
* \remark format cannot be AudioFormat::Unknown
*
* \see GuessAudioFormat
@ -114,4 +113,3 @@ namespace Nz
}
}
#include <Nazara/Audio/DebugOff.hpp>

View File

@ -1,6 +1,6 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// For conditions of distribution and use, see copyright notice in Export.hpp
#pragma once
@ -8,8 +8,8 @@
#define NAZARA_AUDIO_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Audio/Config.hpp>
#include <Nazara/Audio/Enums.hpp>
#include <Nazara/Audio/Export.hpp>
#include <Nazara/Audio/SoundBuffer.hpp>
#include <Nazara/Audio/SoundStream.hpp>
#include <Nazara/Core/Core.hpp>

View File

@ -1,6 +1,6 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// For conditions of distribution and use, see copyright notice in Export.hpp
#pragma once
@ -8,8 +8,8 @@
#define NAZARA_AUDIO_AUDIOBUFFER_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Audio/Config.hpp>
#include <Nazara/Audio/Enums.hpp>
#include <Nazara/Audio/Export.hpp>
#include <memory>
namespace Nz

View File

@ -1,8 +1,7 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// For conditions of distribution and use, see copyright notice in Export.hpp
#include <Nazara/Audio/Debug.hpp>
namespace Nz
{
@ -17,4 +16,3 @@ namespace Nz
}
}
#include <Nazara/Audio/DebugOff.hpp>

View File

@ -1,6 +1,6 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// For conditions of distribution and use, see copyright notice in Export.hpp
#pragma once
@ -8,8 +8,8 @@
#define NAZARA_AUDIO_AUDIODEVICE_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Audio/Config.hpp>
#include <Nazara/Audio/Enums.hpp>
#include <Nazara/Audio/Export.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Math/Quaternion.hpp>
#include <Nazara/Math/Vector3.hpp>

View File

@ -1,8 +1,7 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// For conditions of distribution and use, see copyright notice in Export.hpp
#include <Nazara/Audio/Debug.hpp>
namespace Nz
{
@ -12,4 +11,3 @@ namespace Nz
}
}
#include <Nazara/Audio/DebugOff.hpp>

View File

@ -1,6 +1,6 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// For conditions of distribution and use, see copyright notice in Export.hpp
#pragma once
@ -8,8 +8,8 @@
#define NAZARA_AUDIO_AUDIOSOURCE_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Audio/Config.hpp>
#include <Nazara/Audio/Enums.hpp>
#include <Nazara/Audio/Export.hpp>
#include <Nazara/Core/Time.hpp>
#include <Nazara/Math/Vector3.hpp>

View File

@ -1,8 +1,7 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// For conditions of distribution and use, see copyright notice in Export.hpp
#include <Nazara/Audio/Debug.hpp>
namespace Nz
{
@ -17,4 +16,3 @@ namespace Nz
}
}
#include <Nazara/Audio/DebugOff.hpp>

View File

@ -1,19 +0,0 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_AUDIO_CONFIGCHECK_HPP
#define NAZARA_AUDIO_CONFIGCHECK_HPP
/// This file is used to check the constant values defined in Config.hpp
#include <type_traits>
#define NazaraCheckTypeAndVal(name, type, op, val, err) static_assert(std::is_ ##type <decltype(name)>::value && name op val, #type err)
// config checks
#undef NazaraCheckTypeAndVal
#endif // NAZARA_AUDIO_CONFIGCHECK_HPP

View File

@ -1,5 +0,0 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// no header guards

View File

@ -1,5 +0,0 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// no header guards

View File

@ -1,6 +1,6 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// For conditions of distribution and use, see copyright notice in Export.hpp
#pragma once
@ -9,8 +9,8 @@
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Audio/AudioBuffer.hpp>
#include <Nazara/Audio/Config.hpp>
#include <Nazara/Audio/Enums.hpp>
#include <Nazara/Audio/Export.hpp>
#include <Nazara/Core/Time.hpp>
namespace Nz

View File

@ -1,11 +1,9 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// For conditions of distribution and use, see copyright notice in Export.hpp
#include <Nazara/Audio/Debug.hpp>
namespace Nz
{
}
#include <Nazara/Audio/DebugOff.hpp>

View File

@ -1,6 +1,6 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// For conditions of distribution and use, see copyright notice in Export.hpp
#pragma once
@ -9,8 +9,8 @@
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Audio/AudioDevice.hpp>
#include <Nazara/Audio/Config.hpp>
#include <Nazara/Audio/Enums.hpp>
#include <Nazara/Audio/Export.hpp>
#include <array>
#include <string>

View File

@ -1,11 +1,9 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// For conditions of distribution and use, see copyright notice in Export.hpp
#include <Nazara/Audio/Debug.hpp>
namespace Nz
{
}
#include <Nazara/Audio/DebugOff.hpp>

View File

@ -1,6 +1,6 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// For conditions of distribution and use, see copyright notice in Export.hpp
#pragma once
@ -9,7 +9,7 @@
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Audio/AudioSource.hpp>
#include <Nazara/Audio/Config.hpp>
#include <Nazara/Audio/Export.hpp>
#include <Nazara/Core/Clock.hpp>
namespace Nz

View File

@ -1,8 +1,7 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// For conditions of distribution and use, see copyright notice in Export.hpp
#include <Nazara/Audio/Debug.hpp>
namespace Nz
{
@ -22,4 +21,3 @@ namespace Nz
}
}
#include <Nazara/Audio/DebugOff.hpp>

View File

@ -1,6 +1,6 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// For conditions of distribution and use, see copyright notice in Export.hpp
#pragma once

View File

@ -1,7 +1,7 @@
/*
Nazara Engine - Audio module
Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
@ -24,22 +24,14 @@
#pragma once
#ifndef NAZARA_AUDIO_CONFIG_HPP
#define NAZARA_AUDIO_CONFIG_HPP
#ifndef NAZARA_AUDIO_EXPORT_HPP
#define NAZARA_AUDIO_EXPORT_HPP
/*!
* \defgroup audio (NazaraAudio) Audio module
* Audio/System module including classes to handle music, sound, etc...
*/
/// Each modification of a parameter needs a recompilation of the module
// Activate the security tests based on the code (Advised for development)
#define NAZARA_AUDIO_SAFE 1
/// Checking the values and types of certain constants
#include <Nazara/Audio/ConfigCheck.hpp>
#if !defined(NAZARA_STATIC)
#ifdef NAZARA_AUDIO_BUILD
#define NAZARA_AUDIO_API NAZARA_EXPORT
@ -50,4 +42,4 @@
#define NAZARA_AUDIO_API
#endif
#endif // NAZARA_AUDIO_CONFIG_HPP
#endif // NAZARA_AUDIO_EXPORT_HPP

View File

@ -1,6 +1,6 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// For conditions of distribution and use, see copyright notice in Export.hpp
#pragma once

View File

@ -1,6 +1,6 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// For conditions of distribution and use, see copyright notice in Export.hpp
#pragma once

View File

@ -1,6 +1,6 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// For conditions of distribution and use, see copyright notice in Export.hpp
#pragma once
@ -11,7 +11,7 @@
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Audio/AudioBuffer.hpp>
#include <Nazara/Audio/Config.hpp>
#include <Nazara/Audio/Export.hpp>
#include <Nazara/Audio/OpenAL.hpp>
namespace Nz

View File

@ -1,8 +1,7 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// For conditions of distribution and use, see copyright notice in Export.hpp
#include <Nazara/Audio/Debug.hpp>
namespace Nz
{
@ -18,4 +17,3 @@ namespace Nz
}
}
#include <Nazara/Audio/DebugOff.hpp>

View File

@ -1,6 +1,6 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// For conditions of distribution and use, see copyright notice in Export.hpp
#pragma once
@ -11,10 +11,10 @@
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Audio/AudioDevice.hpp>
#include <Nazara/Audio/Config.hpp>
#include <Nazara/Audio/Enums.hpp>
#include <Nazara/Audio/Export.hpp>
#include <Nazara/Audio/OpenAL.hpp>
#include <Nazara/Core/Algorithm.hpp>
#include <NazaraUtils/Algorithm.hpp>
#include <NazaraUtils/EnumArray.hpp>
#include <NazaraUtils/MovablePtr.hpp>
#include <array>

View File

@ -1,9 +1,7 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// For conditions of distribution and use, see copyright notice in Export.hpp
#include <Nazara/Core/Algorithm.hpp>
#include <Nazara/Audio/Debug.hpp>
namespace Nz
{
@ -34,4 +32,3 @@ namespace Nz
}
}
#include <Nazara/Audio/DebugOff.hpp>

View File

@ -1,6 +1,6 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// For conditions of distribution and use, see copyright notice in Export.hpp
// no header guards

View File

@ -1,6 +1,6 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// For conditions of distribution and use, see copyright notice in Export.hpp
#pragma once
@ -10,8 +10,8 @@
#if defined(NAZARA_AUDIO_OPENAL) || defined(NAZARA_AUDIO_BUILD)
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Audio/Config.hpp>
#include <Nazara/Audio/Enums.hpp>
#include <Nazara/Audio/Export.hpp>
#include <Nazara/Audio/OpenAL.hpp>
#include <Nazara/Core/DynLib.hpp>
#include <string>

View File

@ -1,8 +1,7 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// For conditions of distribution and use, see copyright notice in Export.hpp
#include <Nazara/Audio/Debug.hpp>
namespace Nz
{
@ -23,4 +22,3 @@ namespace Nz
}
}
#include <Nazara/Audio/DebugOff.hpp>

View File

@ -1,6 +1,6 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// For conditions of distribution and use, see copyright notice in Export.hpp
#pragma once
@ -11,7 +11,7 @@
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Audio/AudioSource.hpp>
#include <Nazara/Audio/Config.hpp>
#include <Nazara/Audio/Export.hpp>
#include <Nazara/Audio/OpenAL.hpp>
namespace Nz

View File

@ -1,8 +1,7 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// For conditions of distribution and use, see copyright notice in Export.hpp
#include <Nazara/Audio/Debug.hpp>
namespace Nz
{
@ -13,4 +12,3 @@ namespace Nz
}
}
#include <Nazara/Audio/DebugOff.hpp>

View File

@ -1,6 +1,6 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// For conditions of distribution and use, see copyright notice in Export.hpp
#pragma once
@ -10,7 +10,7 @@
#if defined(NAZARA_AUDIO_OPENAL) || defined(NAZARA_AUDIO_BUILD)
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Audio/Config.hpp>
#include <Nazara/Audio/Export.hpp>
#include <Nazara/Audio/OpenAL.hpp>
#include <string>

View File

@ -1,6 +1,6 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// For conditions of distribution and use, see copyright notice in Export.hpp
#pragma once

View File

@ -1,6 +1,6 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// For conditions of distribution and use, see copyright notice in Export.hpp
#pragma once
@ -9,8 +9,8 @@
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Audio/AudioDevice.hpp>
#include <Nazara/Audio/Config.hpp>
#include <Nazara/Audio/Enums.hpp>
#include <Nazara/Audio/Export.hpp>
#include <Nazara/Core/ObjectLibrary.hpp>
#include <Nazara/Core/Resource.hpp>
#include <Nazara/Core/ResourceLoader.hpp>

View File

@ -1,8 +1,7 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// For conditions of distribution and use, see copyright notice in Export.hpp
#include <Nazara/Audio/Debug.hpp>
namespace Nz
{
@ -18,8 +17,6 @@ namespace Nz
/*!
* \brief Gets the format of the sound buffer
* \return Enumeration of type AudioFormat (mono, stereo, ...)
*
* \remark Produces a NazaraError if there is no sound buffer with NAZARA_AUDIO_SAFE defined
*/
inline AudioFormat SoundBuffer::GetFormat() const
{
@ -29,8 +26,6 @@ namespace Nz
/*!
* \brief Gets the internal raw samples
* \return Pointer to raw data
*
* \remark Produces a NazaraError if there is no sound buffer with NAZARA_AUDIO_SAFE defined
*/
inline const Int16* SoundBuffer::GetSamples() const
{
@ -40,8 +35,6 @@ namespace Nz
/*!
* \brief Gets the number of samples in the sound buffer
* \return Count of samples (number of seconds * sample rate * channel count)
*
* \remark Produces a NazaraError if there is no sound buffer with NAZARA_AUDIO_SAFE defined
*/
inline UInt64 SoundBuffer::GetSampleCount() const
{
@ -51,8 +44,6 @@ namespace Nz
/*!
* \brief Gets the rates of sample in the sound buffer
* \return Rate of sample in Hertz (Hz)
*
* \remark Produces a NazaraError if there is no sound buffer with NAZARA_AUDIO_SAFE defined
*/
inline UInt32 SoundBuffer::GetSampleRate() const
{
@ -60,4 +51,3 @@ namespace Nz
}
}
#include <Nazara/Audio/DebugOff.hpp>

View File

@ -1,6 +1,6 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// For conditions of distribution and use, see copyright notice in Export.hpp
#pragma once
@ -8,8 +8,8 @@
#define NAZARA_AUDIO_SOUNDEMITTER_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Audio/Config.hpp>
#include <Nazara/Audio/Enums.hpp>
#include <Nazara/Audio/Export.hpp>
#include <Nazara/Core/Time.hpp>
#include <Nazara/Math/Vector3.hpp>
#include <limits>

View File

@ -1,8 +1,7 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// For conditions of distribution and use, see copyright notice in Export.hpp
#include <Nazara/Audio/Debug.hpp>
namespace Nz
{
@ -16,4 +15,3 @@ namespace Nz
}
}
#include <Nazara/Audio/DebugOff.hpp>

View File

@ -1,6 +1,6 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// For conditions of distribution and use, see copyright notice in Export.hpp
#pragma once
@ -8,8 +8,8 @@
#define NAZARA_AUDIO_SOUNDSTREAM_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Audio/Config.hpp>
#include <Nazara/Audio/Enums.hpp>
#include <Nazara/Audio/Export.hpp>
#include <Nazara/Core/Resource.hpp>
#include <Nazara/Core/ResourceLoader.hpp>
#include <Nazara/Core/ResourceParameters.hpp>

View File

@ -1,240 +0,0 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - BulletPhysics3D module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_BULLETPHYSICS3D_BULLETCOLLIDER3D_HPP
#define NAZARA_BULLETPHYSICS3D_BULLETCOLLIDER3D_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/BulletPhysics3D/Config.hpp>
#include <Nazara/BulletPhysics3D/Enums.hpp>
#include <Nazara/Core/ObjectLibrary.hpp>
#include <Nazara/Math/Box.hpp>
#include <Nazara/Math/Plane.hpp>
#include <Nazara/Math/Quaternion.hpp>
#include <Nazara/Math/Vector3.hpp>
#include <NazaraUtils/Signal.hpp>
#include <NazaraUtils/SparsePtr.hpp>
#include <memory>
class btBoxShape;
class btCapsuleShape;
class btCompoundShape;
class btCollisionShape;
class btConeShape;
class btConvexHullShape;
class btCylinderShape;
class btEmptyShape;
class btSphereShape;
class btStaticPlaneShape;
namespace Nz
{
class PrimitiveList;
class StaticMesh;
struct Primitive;
class NAZARA_BULLETPHYSICS3D_API BulletCollider3D
{
public:
BulletCollider3D() = default;
BulletCollider3D(const BulletCollider3D&) = delete;
BulletCollider3D(BulletCollider3D&&) = delete;
virtual ~BulletCollider3D();
virtual void BuildDebugMesh(std::vector<Vector3f>& vertices, std::vector<UInt16>& indices, const Matrix4f& offsetMatrix = Matrix4f::Identity()) const = 0;
Boxf ComputeAABB(const Vector3f& translation, const Quaternionf& rotation, const Vector3f& scale) const;
virtual Boxf ComputeAABB(const Matrix4f& offsetMatrix = Matrix4f::Identity(), const Vector3f& scale = Vector3f::Unit()) const;
virtual void ComputeInertia(float mass, Vector3f* inertia) const;
virtual std::shared_ptr<StaticMesh> GenerateDebugMesh() const;
virtual btCollisionShape* GetShape() const = 0;
virtual BulletColliderType3D GetType() const = 0;
BulletCollider3D& operator=(const BulletCollider3D&) = delete;
BulletCollider3D& operator=(BulletCollider3D&&) = delete;
static std::shared_ptr<BulletCollider3D> Build(const PrimitiveList& list);
private:
static std::shared_ptr<BulletCollider3D> CreateGeomFromPrimitive(const Primitive& primitive);
};
class NAZARA_BULLETPHYSICS3D_API BulletBoxCollider3D final : public BulletCollider3D
{
public:
BulletBoxCollider3D(const Vector3f& lengths);
~BulletBoxCollider3D();
void BuildDebugMesh(std::vector<Vector3f>& vertices, std::vector<UInt16>& indices, const Matrix4f& offsetMatrix) const override;
Vector3f GetLengths() const;
btCollisionShape* GetShape() const override;
BulletColliderType3D GetType() const override;
private:
std::unique_ptr<btBoxShape> m_shape;
Vector3f m_lengths;
};
class NAZARA_BULLETPHYSICS3D_API BulletCapsuleCollider3D final : public BulletCollider3D
{
public:
BulletCapsuleCollider3D(float length, float radius);
~BulletCapsuleCollider3D();
void BuildDebugMesh(std::vector<Vector3f>& vertices, std::vector<UInt16>& indices, const Matrix4f& offsetMatrix) const override;
float GetLength() const;
float GetRadius() const;
btCollisionShape* GetShape() const override;
BulletColliderType3D GetType() const override;
private:
std::unique_ptr<btCapsuleShape> m_shape;
float m_length;
float m_radius;
};
class NAZARA_BULLETPHYSICS3D_API BulletCompoundCollider3D final : public BulletCollider3D
{
public:
struct ChildCollider;
BulletCompoundCollider3D(std::vector<ChildCollider> childs);
~BulletCompoundCollider3D();
void BuildDebugMesh(std::vector<Vector3f>& vertices, std::vector<UInt16>& indices, const Matrix4f& offsetMatrix) const override;
const std::vector<ChildCollider>& GetGeoms() const;
btCollisionShape* GetShape() const override;
BulletColliderType3D GetType() const override;
struct ChildCollider
{
std::shared_ptr<BulletCollider3D> collider;
Matrix4f offsetMatrix;
};
private:
std::unique_ptr<btCompoundShape> m_shape;
std::vector<ChildCollider> m_childs;
};
class NAZARA_BULLETPHYSICS3D_API BulletConeCollider3D final : public BulletCollider3D
{
public:
BulletConeCollider3D(float length, float radius);
~BulletConeCollider3D();
void BuildDebugMesh(std::vector<Vector3f>& vertices, std::vector<UInt16>& indices, const Matrix4f& offsetMatrix) const override;
float GetLength() const;
float GetRadius() const;
btCollisionShape* GetShape() const override;
BulletColliderType3D GetType() const override;
private:
std::unique_ptr<btConeShape> m_shape;
float m_length;
float m_radius;
};
class NAZARA_BULLETPHYSICS3D_API BulletConvexCollider3D final : public BulletCollider3D
{
public:
BulletConvexCollider3D(SparsePtr<const Vector3f> vertices, unsigned int vertexCount);
~BulletConvexCollider3D();
void BuildDebugMesh(std::vector<Vector3f>& vertices, std::vector<UInt16>& indices, const Matrix4f& offsetMatrix) const override;
btCollisionShape* GetShape() const override;
BulletColliderType3D GetType() const override;
private:
std::unique_ptr<btConvexHullShape> m_shape;
};
class NAZARA_BULLETPHYSICS3D_API BulletCylinderCollider3D final : public BulletCollider3D
{
public:
BulletCylinderCollider3D(float length, float radius);
~BulletCylinderCollider3D();
void BuildDebugMesh(std::vector<Vector3f>& vertices, std::vector<UInt16>& indices, const Matrix4f& offsetMatrix) const override;
float GetLength() const;
float GetRadius() const;
btCollisionShape* GetShape() const override;
BulletColliderType3D GetType() const override;
private:
std::unique_ptr<btCylinderShape> m_shape;
Matrix4f m_matrix;
float m_length;
float m_radius;
};
class NAZARA_BULLETPHYSICS3D_API BulletNullCollider3D final : public BulletCollider3D
{
public:
BulletNullCollider3D();
~BulletNullCollider3D();
void BuildDebugMesh(std::vector<Vector3f>& vertices, std::vector<UInt16>& indices, const Matrix4f& offsetMatrix) const override;
void ComputeInertia(float mass, Vector3f* inertia) const override;
btCollisionShape* GetShape() const override;
BulletColliderType3D GetType() const override;
private:
std::unique_ptr<btEmptyShape> m_shape;
};
class NAZARA_BULLETPHYSICS3D_API BulletSphereCollider3D final : public BulletCollider3D
{
public:
BulletSphereCollider3D(float radius);
~BulletSphereCollider3D();
void BuildDebugMesh(std::vector<Vector3f>& vertices, std::vector<UInt16>& indices, const Matrix4f& offsetMatrix) const override;
float GetRadius() const;
btCollisionShape* GetShape() const override;
BulletColliderType3D GetType() const override;
private:
std::unique_ptr<btSphereShape> m_shape;
Vector3f m_position;
float m_radius;
};
class NAZARA_BULLETPHYSICS3D_API BulletStaticPlaneCollider3D final : public BulletCollider3D
{
public:
BulletStaticPlaneCollider3D(const Planef& plane);
BulletStaticPlaneCollider3D(const Vector3f& normal, float distance);
~BulletStaticPlaneCollider3D();
void BuildDebugMesh(std::vector<Vector3f>& vertices, std::vector<UInt16>& indices, const Matrix4f& offsetMatrix) const override;
float GetDistance() const;
const Vector3f& GetNormal() const;
btCollisionShape* GetShape() const override;
BulletColliderType3D GetType() const override;
private:
std::unique_ptr<btStaticPlaneShape> m_shape;
Vector3f m_normal;
float m_distance;
};
}
#include <Nazara/BulletPhysics3D/BulletCollider3D.inl>
#endif // NAZARA_BULLETPHYSICS3D_BULLETCOLLIDER3D_HPP

View File

@ -1,12 +0,0 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - BulletPhysics3D module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <memory>
#include <Nazara/BulletPhysics3D/Debug.hpp>
namespace Nz
{
}
#include <Nazara/BulletPhysics3D/DebugOff.hpp>

View File

@ -1,82 +0,0 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - BulletPhysics3D module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_BULLETPHYSICS3D_BULLETCONSTRAINT3D_HPP
#define NAZARA_BULLETPHYSICS3D_BULLETCONSTRAINT3D_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/BulletPhysics3D/BulletPhysWorld3D.hpp>
#include <Nazara/BulletPhysics3D/BulletRigidBody3D.hpp>
#include <Nazara/BulletPhysics3D/Config.hpp>
#include <Nazara/Core/HandledObject.hpp>
#include <Nazara/Core/ObjectHandle.hpp>
class btTypedConstraint;
namespace Nz
{
class BulletConstraint3D;
using BulletConstraint3DHandle = ObjectHandle<BulletConstraint3D>;
class NAZARA_BULLETPHYSICS3D_API BulletConstraint3D : public HandledObject<BulletConstraint3D>
{
public:
BulletConstraint3D(const BulletConstraint3D&) = delete;
BulletConstraint3D(BulletConstraint3D&& constraint) noexcept;
virtual ~BulletConstraint3D();
BulletRigidBody3D& GetBodyA();
const BulletRigidBody3D& GetBodyA() const;
BulletRigidBody3D& GetBodyB();
const BulletRigidBody3D& GetBodyB() const;
BulletPhysWorld3D& GetWorld();
const BulletPhysWorld3D& GetWorld() const;
inline bool IsBodyCollisionEnabled() const;
bool IsSingleBody() const;
BulletConstraint3D& operator=(const BulletConstraint3D&) = delete;
BulletConstraint3D& operator=(BulletConstraint3D&& constraint) noexcept;
protected:
BulletConstraint3D(std::unique_ptr<btTypedConstraint> constraint, bool disableCollisions = false);
template<typename T> T* GetConstraint();
template<typename T> const T* GetConstraint() const;
private:
void Destroy();
std::unique_ptr<btTypedConstraint> m_constraint;
bool m_bodyCollisionEnabled;
};
class NAZARA_BULLETPHYSICS3D_API BulletPivotConstraint3D : public BulletConstraint3D
{
public:
BulletPivotConstraint3D(BulletRigidBody3D& first, const Vector3f& pivot);
BulletPivotConstraint3D(BulletRigidBody3D& first, BulletRigidBody3D& second, const Vector3f& pivot, bool disableCollisions = false);
BulletPivotConstraint3D(BulletRigidBody3D& first, BulletRigidBody3D& second, const Vector3f& firstAnchor, const Vector3f& secondAnchor, bool disableCollisions = false);
~BulletPivotConstraint3D() = default;
Vector3f GetFirstAnchor() const;
Vector3f GetSecondAnchor() const;
float GetDamping() const;
float GetImpulseClamp() const;
void SetFirstAnchor(const Vector3f& firstAnchor);
void SetSecondAnchor(const Vector3f& secondAnchor);
void SetDamping(float damping);
void SetImpulseClamp(float impulseClamp);
};
}
#include <Nazara/BulletPhysics3D/BulletConstraint3D.inl>
#endif // NAZARA_BULLETPHYSICS3D_BULLETCONSTRAINT3D_HPP

View File

@ -1,27 +0,0 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - BulletPhysics3D module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/BulletPhysics3D/Debug.hpp>
namespace Nz
{
inline bool BulletConstraint3D::IsBodyCollisionEnabled() const
{
return m_bodyCollisionEnabled;
}
template<typename T>
T* BulletConstraint3D::GetConstraint()
{
return SafeCast<T*>(m_constraint.get());
}
template<typename T>
const T* BulletConstraint3D::GetConstraint() const
{
return SafeCast<const T*>(m_constraint.get());
}
}
#include <Nazara/BulletPhysics3D/DebugOff.hpp>

View File

@ -1,77 +0,0 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - BulletPhysics3D module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_BULLETPHYSICS3D_BULLETPHYSWORLD3D_HPP
#define NAZARA_BULLETPHYSICS3D_BULLETPHYSWORLD3D_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/BulletPhysics3D/Config.hpp>
#include <Nazara/Core/Time.hpp>
#include <Nazara/Math/Box.hpp>
#include <Nazara/Math/Vector3.hpp>
#include <NazaraUtils/FunctionRef.hpp>
#include <NazaraUtils/MovablePtr.hpp>
#include <optional>
class btDynamicsWorld;
class btRigidBody;
namespace Nz
{
class BulletRigidBody3D;
class NAZARA_BULLETPHYSICS3D_API BulletPhysWorld3D
{
friend BulletRigidBody3D;
public:
struct RaycastHit;
BulletPhysWorld3D();
BulletPhysWorld3D(const BulletPhysWorld3D&) = delete;
BulletPhysWorld3D(BulletPhysWorld3D&& ph) = delete;
~BulletPhysWorld3D();
btDynamicsWorld* GetDynamicsWorld();
Vector3f GetGravity() const;
std::size_t GetMaxStepCount() const;
Time GetStepSize() const;
bool RaycastQuery(const Vector3f& from, const Vector3f& to, const FunctionRef<std::optional<float>(const RaycastHit& hitInfo)>& callback);
bool RaycastQueryFirst(const Vector3f& from, const Vector3f& to, RaycastHit* hitInfo = nullptr);
void SetGravity(const Vector3f& gravity);
void SetMaxStepCount(std::size_t maxStepCount);
void SetStepSize(Time stepSize);
void Step(Time timestep);
BulletPhysWorld3D& operator=(const BulletPhysWorld3D&) = delete;
BulletPhysWorld3D& operator=(BulletPhysWorld3D&&) = delete;
struct RaycastHit
{
float fraction;
BulletRigidBody3D* hitBody = nullptr;
Vector3f hitPosition;
Vector3f hitNormal;
};
private:
btRigidBody* AddRigidBody(std::size_t& rigidBodyIndex, FunctionRef<void(btRigidBody* body)> constructor);
void RemoveRigidBody(btRigidBody* rigidBody, std::size_t rigidBodyIndex);
struct BulletWorld;
std::size_t m_maxStepCount;
std::unique_ptr<BulletWorld> m_world;
Vector3f m_gravity;
Time m_stepSize;
Time m_timestepAccumulator;
};
}
#endif // NAZARA_BULLETPHYSICS3D_BULLETPHYSWORLD3D_HPP

View File

@ -1,33 +0,0 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - BulletPhysics3D module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_BULLETPHYSICS3D_HPP
#define NAZARA_BULLETPHYSICS3D_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/BulletPhysics3D/Config.hpp>
#include <Nazara/Core/Core.hpp>
namespace Nz
{
class NAZARA_BULLETPHYSICS3D_API BulletPhysics3D : public ModuleBase<BulletPhysics3D>
{
friend ModuleBase;
public:
using Dependencies = TypeList<Core>;
struct Config {};
BulletPhysics3D(Config /*config*/);
~BulletPhysics3D() = default;
private:
static BulletPhysics3D* s_instance;
};
}
#endif // NAZARA_BULLETPHYSICS3D_HPP

View File

@ -1,96 +0,0 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - BulletPhysics3D module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_BULLETPHYSICS3D_BULLETRIGIDBODY3D_HPP
#define NAZARA_BULLETPHYSICS3D_BULLETRIGIDBODY3D_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/BulletPhysics3D/BulletCollider3D.hpp>
#include <Nazara/BulletPhysics3D/Config.hpp>
#include <Nazara/Core/Enums.hpp>
#include <Nazara/Math/Matrix4.hpp>
#include <Nazara/Math/Quaternion.hpp>
#include <Nazara/Math/Vector3.hpp>
#include <NazaraUtils/MovablePtr.hpp>
class btRigidBody;
namespace Nz
{
class BulletPhysWorld3D;
class NAZARA_BULLETPHYSICS3D_API BulletRigidBody3D
{
public:
BulletRigidBody3D(BulletPhysWorld3D* world, const Matrix4f& mat = Matrix4f::Identity());
BulletRigidBody3D(BulletPhysWorld3D* world, std::shared_ptr<BulletCollider3D> geom, const Matrix4f& mat = Matrix4f::Identity());
BulletRigidBody3D(const BulletRigidBody3D& object) = delete;
BulletRigidBody3D(BulletRigidBody3D&& object) noexcept;
~BulletRigidBody3D();
void AddForce(const Vector3f& force, CoordSys coordSys = CoordSys::Global);
void AddForce(const Vector3f& force, const Vector3f& point, CoordSys coordSys = CoordSys::Global);
void AddTorque(const Vector3f& torque, CoordSys coordSys = CoordSys::Global);
inline void DisableSleeping();
void EnableSleeping(bool enable);
void FallAsleep();
Boxf GetAABB() const;
float GetAngularDamping() const;
Vector3f GetAngularVelocity() const;
inline const std::shared_ptr<BulletCollider3D>& GetGeom() const;
float GetLinearDamping() const;
Vector3f GetLinearVelocity() const;
float GetMass() const;
Vector3f GetMassCenter(CoordSys coordSys = CoordSys::Local) const;
Matrix4f GetMatrix() const;
Vector3f GetPosition() const;
inline btRigidBody* GetRigidBody() const;
Quaternionf GetRotation() const;
inline std::size_t GetUniqueIndex() const;
inline BulletPhysWorld3D* GetWorld() const;
bool IsSimulationEnabled() const;
bool IsSleeping() const;
bool IsSleepingEnabled() const;
void SetAngularDamping(float angularDamping);
void SetAngularVelocity(const Vector3f& angularVelocity);
void SetGeom(std::shared_ptr<BulletCollider3D> geom, bool recomputeInertia = true);
void SetLinearDamping(float damping);
void SetLinearVelocity(const Vector3f& velocity);
void SetMass(float mass);
void SetMassCenter(const Vector3f& center);
void SetPosition(const Vector3f& position);
void SetPositionAndRotation(const Vector3f& position, const Quaternionf& rotation);
void SetRotation(const Quaternionf& rotation);
Quaternionf ToLocal(const Quaternionf& worldRotation);
Vector3f ToLocal(const Vector3f& worldPosition);
Quaternionf ToWorld(const Quaternionf& localRotation);
Vector3f ToWorld(const Vector3f& localPosition);
void WakeUp();
BulletRigidBody3D& operator=(const BulletRigidBody3D& object) = delete;
BulletRigidBody3D& operator=(BulletRigidBody3D&& object) noexcept;
protected:
void Destroy();
private:
std::shared_ptr<BulletCollider3D> m_geom;
std::size_t m_bodyPoolIndex;
btRigidBody* m_body;
BulletPhysWorld3D* m_world;
};
}
#include <Nazara/BulletPhysics3D/BulletRigidBody3D.inl>
#endif // NAZARA_BULLETPHYSICS3D_BULLETRIGIDBODY3D_HPP

View File

@ -1,34 +0,0 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - BulletPhysics3D module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/BulletPhysics3D/Debug.hpp>
namespace Nz
{
inline void BulletRigidBody3D::DisableSleeping()
{
return EnableSleeping(false);
}
inline const std::shared_ptr<BulletCollider3D>& BulletRigidBody3D::GetGeom() const
{
return m_geom;
}
inline btRigidBody* BulletRigidBody3D::GetRigidBody() const
{
return m_body;
}
inline std::size_t BulletRigidBody3D::GetUniqueIndex() const
{
return m_bodyPoolIndex;
}
inline BulletPhysWorld3D* BulletRigidBody3D::GetWorld() const
{
return m_world;
}
}
#include <Nazara/BulletPhysics3D/DebugOff.hpp>

View File

@ -1,32 +0,0 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - BulletPhysics3D module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_BULLETPHYSICS3D_COMPONENTS_BULLETRIGIDBODY3DCOMPONENT_HPP
#define NAZARA_BULLETPHYSICS3D_COMPONENTS_BULLETRIGIDBODY3DCOMPONENT_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/BulletPhysics3D/BulletRigidBody3D.hpp>
namespace Nz
{
class NAZARA_BULLETPHYSICS3D_API BulletRigidBody3DComponent : public BulletRigidBody3D
{
friend class BulletPhysics3DSystem;
public:
using BulletRigidBody3D::BulletRigidBody3D;
BulletRigidBody3DComponent(const BulletRigidBody3DComponent&) = default;
BulletRigidBody3DComponent(BulletRigidBody3DComponent&&) noexcept = default;
~BulletRigidBody3DComponent() = default;
BulletRigidBody3DComponent& operator=(const BulletRigidBody3DComponent&) = default;
BulletRigidBody3DComponent& operator=(BulletRigidBody3DComponent&&) noexcept = default;
};
}
#include <Nazara/BulletPhysics3D/Components/BulletRigidBody3DComponent.inl>
#endif // NAZARA_BULLETPHYSICS3D_COMPONENTS_BULLETRIGIDBODY3DCOMPONENT_HPP

View File

@ -1,11 +0,0 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - BulletPhysics3D module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/BulletPhysics3D/Debug.hpp>
namespace Nz
{
}
#include <Nazara/BulletPhysics3D/DebugOff.hpp>

View File

@ -1,48 +0,0 @@
/*
Nazara Engine - BulletPhysics3D module
Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#pragma once
#ifndef NAZARA_BULLETPHYSICS3D_CONFIG_HPP
#define NAZARA_BULLETPHYSICS3D_CONFIG_HPP
/// Chaque modification d'un paramètre du module nécessite une recompilation de celui-ci
// Active les tests de sécurité basés sur le code (Conseillé pour le développement)
#define NAZARA_BULLETPHYSICS3D_SAFE 1
/// Vérification des valeurs et types de certaines constantes
#include <Nazara/BulletPhysics3D/ConfigCheck.hpp>
#if defined(NAZARA_STATIC)
#define NAZARA_BULLETPHYSICS3D_API
#else
#ifdef NAZARA_BULLETPHYSICS3D_BUILD
#define NAZARA_BULLETPHYSICS3D_API NAZARA_EXPORT
#else
#define NAZARA_BULLETPHYSICS3D_API NAZARA_IMPORT
#endif
#endif
#endif // NAZARA_BULLETPHYSICS3D_CONFIG_HPP

View File

@ -1,10 +0,0 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - BulletPhysics3D module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_BULLETPHYSICS3D_CONFIGCHECK_HPP
#define NAZARA_BULLETPHYSICS3D_CONFIGCHECK_HPP
#endif // NAZARA_BULLETPHYSICS3D_CONFIGCHECK_HPP

View File

@ -1,5 +0,0 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - BulletPhysics3D module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// no header guards

View File

@ -1,5 +0,0 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - BulletPhysics3D module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// no header guards

View File

@ -1,30 +0,0 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - BulletPhysics3D module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_BULLETPHYSICS3D_ENUMS_HPP
#define NAZARA_BULLETPHYSICS3D_ENUMS_HPP
namespace Nz
{
enum class BulletColliderType3D
{
Box,
Capsule,
Cone,
Compound,
ConvexHull,
Cylinder,
Heightfield,
Null,
Scene,
Sphere,
StaticPlane,
Max = StaticPlane
};
}
#endif // NAZARA_BULLETPHYSICS3D_ENUMS_HPP

View File

@ -1,73 +0,0 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - BulletPhysics3D module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_BULLETPHYSICS3D_SYSTEMS_BULLETPHYSICS3DSYSTEM_HPP
#define NAZARA_BULLETPHYSICS3D_SYSTEMS_BULLETPHYSICS3DSYSTEM_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/BulletPhysics3D/BulletPhysWorld3D.hpp>
#include <Nazara/BulletPhysics3D/Components/BulletRigidBody3DComponent.hpp>
#include <Nazara/Core/Clock.hpp>
#include <Nazara/Core/Time.hpp>
#include <NazaraUtils/TypeList.hpp>
#include <entt/entt.hpp>
#include <vector>
namespace Nz
{
class NAZARA_BULLETPHYSICS3D_API BulletPhysics3DSystem
{
public:
static constexpr Int64 ExecutionOrder = 0;
using Components = TypeList<BulletRigidBody3DComponent, class NodeComponent>;
struct RaycastHit;
BulletPhysics3DSystem(entt::registry& registry);
BulletPhysics3DSystem(const BulletPhysics3DSystem&) = delete;
BulletPhysics3DSystem(BulletPhysics3DSystem&&) = delete;
~BulletPhysics3DSystem();
template<typename... Args> BulletRigidBody3DComponent CreateRigidBody(Args&&... args);
void Dump();
inline BulletPhysWorld3D& GetPhysWorld();
inline const BulletPhysWorld3D& GetPhysWorld() const;
bool RaycastQuery(const Vector3f& from, const Vector3f& to, const FunctionRef<std::optional<float>(const RaycastHit& hitInfo)>& callback);
bool RaycastQueryFirst(const Vector3f& from, const Vector3f& to, RaycastHit* hitInfo = nullptr);
void Update(Time elapsedTime);
BulletPhysics3DSystem& operator=(const BulletPhysics3DSystem&) = delete;
BulletPhysics3DSystem& operator=(BulletPhysics3DSystem&&) = delete;
struct RaycastHit : BulletPhysWorld3D::RaycastHit
{
entt::handle hitEntity;
};
private:
void OnConstruct(entt::registry& registry, entt::entity entity);
void OnDestruct(entt::registry& registry, entt::entity entity);
std::size_t m_activeObjectCount;
std::size_t m_stepCount;
std::vector<entt::entity> m_physicsEntities;
entt::registry& m_registry;
entt::observer m_physicsConstructObserver;
entt::scoped_connection m_constructConnection;
entt::scoped_connection m_destructConnection;
BulletPhysWorld3D m_physWorld;
Time m_physicsTime;
Time m_updateTime;
};
}
#include <Nazara/BulletPhysics3D/Systems/BulletPhysics3DSystem.inl>
#endif // NAZARA_BULLETPHYSICS3D_SYSTEMS_BULLETPHYSICS3DSYSTEM_HPP

View File

@ -1,26 +0,0 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - BulletPhysics3D module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/BulletPhysics3D/Debug.hpp>
namespace Nz
{
template<typename... Args>
BulletRigidBody3DComponent BulletPhysics3DSystem::CreateRigidBody(Args&&... args)
{
return BulletRigidBody3DComponent(&m_physWorld, std::forward<Args>(args)...);
}
inline BulletPhysWorld3D& BulletPhysics3DSystem::GetPhysWorld()
{
return m_physWorld;
}
inline const BulletPhysWorld3D& BulletPhysics3DSystem::GetPhysWorld() const
{
return m_physWorld;
}
}
#include <Nazara/BulletPhysics3D/DebugOff.hpp>

View File

@ -1,48 +0,0 @@
// this file was automatically generated and should not be edited
/*
Nazara Engine - Physics2D module
Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#pragma once
#ifndef NAZARA_GLOBAL_CHIPMUNKPHYSICS2D_HPP
#define NAZARA_GLOBAL_CHIPMUNKPHYSICS2D_HPP
#include <Nazara/ChipmunkPhysics2D/ChipmunkArbiter2D.hpp>
#include <Nazara/ChipmunkPhysics2D/ChipmunkCollider2D.hpp>
#include <Nazara/ChipmunkPhysics2D/ChipmunkConstraint2D.hpp>
#include <Nazara/ChipmunkPhysics2D/ChipmunkPhysics2D.hpp>
#include <Nazara/ChipmunkPhysics2D/ChipmunkPhysWorld2D.hpp>
#include <Nazara/ChipmunkPhysics2D/ChipmunkRigidBody2D.hpp>
#include <Nazara/ChipmunkPhysics2D/Config.hpp>
#include <Nazara/ChipmunkPhysics2D/Enums.hpp>
#ifdef NAZARA_ENTT
#include <Nazara/ChipmunkPhysics2D/Components.hpp>
#include <Nazara/ChipmunkPhysics2D/Systems.hpp>
#endif
#endif // NAZARA_GLOBAL_CHIPMUNKPHYSICS2D_HPP

View File

@ -1,16 +0,0 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - ChipmunkPhysics2D module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <memory>
#include <Nazara/ChipmunkPhysics2D/Debug.hpp>
namespace Nz
{
inline ChipmunkArbiter2D::ChipmunkArbiter2D(cpArbiter* arbiter) :
m_arbiter(arbiter)
{
}
}
#include <Nazara/ChipmunkPhysics2D/DebugOff.hpp>

View File

@ -1,196 +0,0 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - ChipmunkPhysics2D module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <memory>
#include <Nazara/ChipmunkPhysics2D/Debug.hpp>
namespace Nz
{
inline ChipmunkCollider2D::ChipmunkCollider2D() :
m_categoryMask(0xFFFFFFFF),
m_collisionGroup(0),
m_collisionMask(0xFFFFFFFF),
m_surfaceVelocity(Vector2f::Zero()),
m_trigger(false),
m_elasticity(0.f),
m_friction(0.f),
m_collisionId(0)
{
}
inline UInt32 ChipmunkCollider2D::GetCategoryMask() const
{
return m_categoryMask;
}
inline UInt32 ChipmunkCollider2D::GetCollisionGroup() const
{
return m_collisionGroup;
}
inline unsigned int ChipmunkCollider2D::GetCollisionId() const
{
return m_collisionId;
}
inline UInt32 ChipmunkCollider2D::GetCollisionMask() const
{
return m_collisionMask;
}
inline float ChipmunkCollider2D::GetElasticity() const
{
return m_elasticity;
}
inline float ChipmunkCollider2D::GetFriction() const
{
return m_friction;
}
inline Vector2f ChipmunkCollider2D::GetSurfaceVelocity() const
{
return m_surfaceVelocity;
}
inline bool ChipmunkCollider2D::IsTrigger() const
{
return m_trigger;
}
inline void ChipmunkCollider2D::SetCategoryMask(UInt32 categoryMask)
{
m_categoryMask = categoryMask;
}
inline void ChipmunkCollider2D::SetCollisionGroup(UInt32 groupId)
{
m_collisionGroup = groupId;
}
inline void ChipmunkCollider2D::SetCollisionId(unsigned int typeId)
{
m_collisionId = typeId;
}
inline void ChipmunkCollider2D::SetCollisionMask(UInt32 mask)
{
m_collisionMask = mask;
}
inline void ChipmunkCollider2D::SetElasticity(float elasticity)
{
m_elasticity = elasticity;
}
inline void ChipmunkCollider2D::SetFriction(float friction)
{
m_friction = friction;
}
inline void ChipmunkCollider2D::SetSurfaceVelocity(const Vector2f& surfaceVelocity)
{
m_surfaceVelocity = surfaceVelocity;
}
inline void ChipmunkCollider2D::SetTrigger(bool trigger)
{
m_trigger = trigger;
}
inline float ChipmunkBoxCollider2D::GetRadius() const
{
return m_radius;
}
inline const Rectf& ChipmunkBoxCollider2D::GetRect() const
{
return m_rect;
}
inline Vector2f ChipmunkBoxCollider2D::GetSize() const
{
return m_rect.GetLengths();
}
inline const Vector2f& ChipmunkCircleCollider2D::GetOffset() const
{
return m_offset;
}
inline float ChipmunkCircleCollider2D::GetRadius() const
{
return m_radius;
}
inline bool Nz::ChipmunkCompoundCollider2D::DoesOverrideCollisionProperties() const
{
return m_doesOverrideCollisionProperties;
}
inline const std::vector<std::shared_ptr<ChipmunkCollider2D>>& ChipmunkCompoundCollider2D::GetGeoms() const
{
return m_geoms;
}
inline void Nz::ChipmunkCompoundCollider2D::OverridesCollisionProperties(bool shouldOverride)
{
m_doesOverrideCollisionProperties = shouldOverride;
}
inline const std::vector<Vector2d>& ChipmunkConvexCollider2D::GetVertices() const
{
return m_vertices;
}
ChipmunkSegmentCollider2D::ChipmunkSegmentCollider2D(const Vector2f& first, const Vector2f& second, float thickness) :
ChipmunkSegmentCollider2D(first, first, second, second, thickness)
{
}
inline ChipmunkSegmentCollider2D::ChipmunkSegmentCollider2D(const Vector2f& first, const Vector2f& firstNeighbor, const Vector2f& second, const Vector2f& secondNeighbor, float thickness) :
m_first(first),
m_firstNeighbor(firstNeighbor),
m_second(second),
m_secondNeighbor(secondNeighbor),
m_thickness(thickness)
{
}
inline const Vector2f& ChipmunkSegmentCollider2D::GetFirstPoint() const
{
return m_first;
}
inline const Vector2f& ChipmunkSegmentCollider2D::GetFirstPointNeighbor() const
{
return m_firstNeighbor;
}
inline float ChipmunkSegmentCollider2D::GetLength() const
{
return m_first.Distance(m_second);
}
inline const Vector2f& ChipmunkSegmentCollider2D::GetSecondPoint() const
{
return m_second;
}
inline const Vector2f& ChipmunkSegmentCollider2D::GetSecondPointNeighbor() const
{
return m_secondNeighbor;
}
inline float ChipmunkSegmentCollider2D::GetThickness() const
{
return m_thickness;
}
}
#include <Nazara/ChipmunkPhysics2D/DebugOff.hpp>

View File

@ -1,238 +0,0 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - ChipmunkPhysics2D module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_CHIPMUNKPHYSICS2D_CHIPMUNKCONSTRAINT2D_HPP
#define NAZARA_CHIPMUNKPHYSICS2D_CHIPMUNKCONSTRAINT2D_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/ChipmunkPhysics2D/ChipmunkPhysWorld2D.hpp>
#include <Nazara/ChipmunkPhysics2D/ChipmunkRigidBody2D.hpp>
#include <Nazara/ChipmunkPhysics2D/Config.hpp>
#include <Nazara/Core/HandledObject.hpp>
#include <Nazara/Core/ObjectHandle.hpp>
#include <Nazara/Math/Angle.hpp>
#include <NazaraUtils/MovablePtr.hpp>
struct cpConstraint;
namespace Nz
{
class ChipmunkConstraint2D;
using ChipmunkConstraint2DHandle = ObjectHandle<ChipmunkConstraint2D>;
class NAZARA_CHIPMUNKPHYSICS2D_API ChipmunkConstraint2D : public HandledObject<ChipmunkConstraint2D>
{
public:
ChipmunkConstraint2D(const ChipmunkConstraint2D&) = delete;
ChipmunkConstraint2D(ChipmunkConstraint2D&& constraint) noexcept;
virtual ~ChipmunkConstraint2D();
void EnableBodyCollision(bool enable);
ChipmunkRigidBody2D& GetBodyA();
const ChipmunkRigidBody2D& GetBodyA() const;
ChipmunkRigidBody2D& GetBodyB();
const ChipmunkRigidBody2D& GetBodyB() const;
float GetErrorBias() const;
float GetLastImpulse() const;
float GetMaxBias() const;
float GetMaxForce() const;
ChipmunkPhysWorld2D& GetWorld();
const ChipmunkPhysWorld2D& GetWorld() const;
bool IsBodyCollisionEnabled() const;
bool IsSingleBody() const;
void SetErrorBias(float bias);
void SetMaxBias(float bias);
void SetMaxForce(float force);
ChipmunkConstraint2D& operator=(const ChipmunkConstraint2D&) = delete;
ChipmunkConstraint2D& operator=(ChipmunkConstraint2D&& constraint) noexcept;
protected:
ChipmunkConstraint2D(ChipmunkPhysWorld2D* world, cpConstraint* constraint);
MovablePtr<cpConstraint> m_constraint;
private:
void Destroy();
};
class ChipmunkDampedSpringConstraint2D;
using ChipmunkDampedSpringConstraint2DHandle = ObjectHandle<ChipmunkDampedSpringConstraint2D>;
class NAZARA_CHIPMUNKPHYSICS2D_API ChipmunkDampedSpringConstraint2D : public ChipmunkConstraint2D
{
public:
ChipmunkDampedSpringConstraint2D(ChipmunkRigidBody2D& first, ChipmunkRigidBody2D& second, const Vector2f& firstAnchor, const Vector2f& secondAnchor, float restLength, float stiffness, float damping);
~ChipmunkDampedSpringConstraint2D() = default;
float GetDamping() const;
Vector2f GetFirstAnchor() const;
float GetRestLength() const;
Vector2f GetSecondAnchor() const;
float GetStiffness() const;
void SetDamping(float newDamping);
void SetFirstAnchor(const Vector2f& firstAnchor);
void SetRestLength(float newLength);
void SetSecondAnchor(const Vector2f& firstAnchor);
void SetStiffness(float newStiffness);
};
class ChipmunkDampedRotarySpringConstraint2D;
using ChipmunkDampedRotarySpringConstraint2DHandle = ObjectHandle<ChipmunkDampedRotarySpringConstraint2D>;
class NAZARA_CHIPMUNKPHYSICS2D_API ChipmunkDampedRotarySpringConstraint2D : public ChipmunkConstraint2D
{
public:
ChipmunkDampedRotarySpringConstraint2D(ChipmunkRigidBody2D& first, ChipmunkRigidBody2D& second, const RadianAnglef& restAngle, float stiffness, float damping);
~ChipmunkDampedRotarySpringConstraint2D() = default;
float GetDamping() const;
RadianAnglef GetRestAngle() const;
float GetStiffness() const;
void SetDamping(float newDamping);
void SetRestAngle(const RadianAnglef& newAngle);
void SetStiffness(float newStiffness);
};
class ChipmunkGearConstraint2D;
using ChipmunkGearConstraint2DHandle = ObjectHandle<ChipmunkGearConstraint2D>;
class NAZARA_CHIPMUNKPHYSICS2D_API ChipmunkGearConstraint2D : public ChipmunkConstraint2D
{
public:
ChipmunkGearConstraint2D(ChipmunkRigidBody2D& first, ChipmunkRigidBody2D& second, float phase, float ratio);
~ChipmunkGearConstraint2D() = default;
float GetPhase() const;
float GetRatio() const;
void SetPhase(float phase);
void SetRatio(float ratio);
};
class ChipmunkMotorConstraint2D;
using ChipmunkMotorConstraint2DHandle = ObjectHandle<ChipmunkMotorConstraint2D>;
class NAZARA_CHIPMUNKPHYSICS2D_API ChipmunkMotorConstraint2D : public ChipmunkConstraint2D
{
public:
ChipmunkMotorConstraint2D(ChipmunkRigidBody2D& first, ChipmunkRigidBody2D& second, float rate);
~ChipmunkMotorConstraint2D() = default;
float GetRate() const;
void SetRate(float rate);
};
class ChipmunkPinConstraint2D;
using ChipmunkPinConstraint2DHandle = ObjectHandle<ChipmunkPinConstraint2D>;
class NAZARA_CHIPMUNKPHYSICS2D_API ChipmunkPinConstraint2D : public ChipmunkConstraint2D
{
public:
ChipmunkPinConstraint2D(ChipmunkRigidBody2D& body, const Vector2f& anchor);
ChipmunkPinConstraint2D(ChipmunkRigidBody2D& first, ChipmunkRigidBody2D& second, const Vector2f& firstAnchor, const Vector2f& secondAnchor);
~ChipmunkPinConstraint2D() = default;
float GetDistance() const;
Vector2f GetFirstAnchor() const;
Vector2f GetSecondAnchor() const;
void SetDistance(float newDistance);
void SetFirstAnchor(const Vector2f& firstAnchor);
void SetSecondAnchor(const Vector2f& firstAnchor);
};
class ChipmunkPivotConstraint2D;
using ChipmunkPivotConstraint2DHandle = ObjectHandle<ChipmunkPivotConstraint2D>;
class NAZARA_CHIPMUNKPHYSICS2D_API ChipmunkPivotConstraint2D : public ChipmunkConstraint2D
{
public:
ChipmunkPivotConstraint2D(ChipmunkRigidBody2D& body, const Vector2f& anchor);
ChipmunkPivotConstraint2D(ChipmunkRigidBody2D& first, ChipmunkRigidBody2D& second, const Vector2f& anchor);
ChipmunkPivotConstraint2D(ChipmunkRigidBody2D& first, ChipmunkRigidBody2D& second, const Vector2f& firstAnchor, const Vector2f& secondAnchor);
~ChipmunkPivotConstraint2D() = default;
Vector2f GetFirstAnchor() const;
Vector2f GetSecondAnchor() const;
void SetFirstAnchor(const Vector2f& firstAnchor);
void SetSecondAnchor(const Vector2f& firstAnchor);
};
class ChipmunkRatchetConstraint2D;
using ChipmunkRatchetConstraint2DHandle = ObjectHandle<ChipmunkRatchetConstraint2D>;
class NAZARA_CHIPMUNKPHYSICS2D_API ChipmunkRatchetConstraint2D : public ChipmunkConstraint2D
{
public:
ChipmunkRatchetConstraint2D(ChipmunkRigidBody2D& first, ChipmunkRigidBody2D& second, float phase, float ratchet);
~ChipmunkRatchetConstraint2D() = default;
RadianAnglef GetAngle() const;
float GetPhase() const;
float GetRatchet() const;
void SetAngle(const RadianAnglef& angle);
void SetPhase(float phase);
void SetRatchet(float ratchet);
};
class ChipmunkRotaryLimitConstraint2D;
using ChipmunkRotaryLimitConstraint2DHandle = ObjectHandle<ChipmunkRotaryLimitConstraint2D>;
class NAZARA_CHIPMUNKPHYSICS2D_API ChipmunkRotaryLimitConstraint2D : public ChipmunkConstraint2D
{
public:
ChipmunkRotaryLimitConstraint2D(ChipmunkRigidBody2D& first, ChipmunkRigidBody2D& second, const RadianAnglef& minAngle, const RadianAnglef& maxAngle);
~ChipmunkRotaryLimitConstraint2D() = default;
RadianAnglef GetMaxAngle() const;
RadianAnglef GetMinAngle() const;
void SetMaxAngle(const RadianAnglef& maxAngle);
void SetMinAngle(const RadianAnglef& minAngle);
};
class ChipmunkSlideConstraint2D;
using ChipmunkSlideConstraint2DHandle = ObjectHandle<ChipmunkSlideConstraint2D>;
class NAZARA_CHIPMUNKPHYSICS2D_API ChipmunkSlideConstraint2D : public ChipmunkConstraint2D
{
public:
ChipmunkSlideConstraint2D(ChipmunkRigidBody2D& first, ChipmunkRigidBody2D& second, const Vector2f& firstAnchor, const Vector2f& secondAnchor, float min, float max);
~ChipmunkSlideConstraint2D() = default;
Vector2f GetFirstAnchor() const;
float GetMaxDistance() const;
float GetMinDistance() const;
Vector2f GetSecondAnchor() const;
void SetFirstAnchor(const Vector2f& firstAnchor);
void SetMaxDistance(float newMaxDistance);
void SetMinDistance(float newMinDistance);
void SetSecondAnchor(const Vector2f& firstAnchor);
};
}
#include <Nazara/ChipmunkPhysics2D/ChipmunkConstraint2D.inl>
#endif // NAZARA_CHIPMUNKPHYSICS2D_CHIPMUNKCONSTRAINT2D_HPP

View File

@ -1,12 +0,0 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - ChipmunkPhysics2D module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <memory>
#include <Nazara/ChipmunkPhysics2D/Debug.hpp>
namespace Nz
{
}
#include <Nazara/ChipmunkPhysics2D/DebugOff.hpp>

View File

@ -1,33 +0,0 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - ChipmunkPhysics2D module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_CHIPMUNKPHYSICS2D_HPP
#define NAZARA_CHIPMUNKPHYSICS2D_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/ChipmunkPhysics2D/Config.hpp>
#include <Nazara/Core/Core.hpp>
namespace Nz
{
class NAZARA_CHIPMUNKPHYSICS2D_API ChipmunkPhysics2D : public ModuleBase<ChipmunkPhysics2D>
{
friend ModuleBase;
public:
using Dependencies = TypeList<Core>;
struct Config {};
ChipmunkPhysics2D(Config /*config*/);
~ChipmunkPhysics2D() = default;
private:
static ChipmunkPhysics2D* s_instance;
};
}
#endif // NAZARA_CHIPMUNKPHYSICS2D_HPP

View File

@ -1,99 +0,0 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - ChipmunkPhysics2D module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/ChipmunkPhysics2D/Debug.hpp>
namespace Nz
{
inline ChipmunkRigidBody2D::ChipmunkRigidBody2D(ChipmunkPhysWorld2D& world, const DynamicSettings& settings)
{
Create(world, settings);
}
inline ChipmunkRigidBody2D::ChipmunkRigidBody2D(ChipmunkPhysWorld2D& world, const StaticSettings& settings)
{
Create(world, settings);
}
inline ChipmunkRigidBody2D::~ChipmunkRigidBody2D()
{
Destroy();
}
inline void ChipmunkRigidBody2D::AddForce(const Vector2f& force, CoordSys coordSys)
{
return AddForce(force, GetMassCenter(coordSys), coordSys);
}
inline void ChipmunkRigidBody2D::AddImpulse(const Vector2f& impulse, CoordSys coordSys)
{
return AddImpulse(impulse, GetMassCenter(coordSys), coordSys);
}
inline UInt32 ChipmunkRigidBody2D::GetBodyIndex() const
{
return m_bodyIndex;
}
inline const std::shared_ptr<ChipmunkCollider2D>& ChipmunkRigidBody2D::GetGeom() const
{
return m_geom;
}
inline cpBody* ChipmunkRigidBody2D::GetHandle() const
{
return m_handle;
}
inline float ChipmunkRigidBody2D::GetMass() const
{
return m_mass;
}
inline const Vector2f& ChipmunkRigidBody2D::GetPositionOffset() const
{
return m_positionOffset;
}
inline std::size_t ChipmunkRigidBody2D::GetShapeIndex(cpShape* shape) const
{
auto it = std::find(m_shapes.begin(), m_shapes.end(), shape);
if (it == m_shapes.end())
return InvalidShapeIndex;
return std::distance(m_shapes.begin(), it);
}
inline std::size_t ChipmunkRigidBody2D::GetShapeCount() const
{
return m_shapes.size();
}
inline const ChipmunkRigidBody2D::VelocityFunc& ChipmunkRigidBody2D::GetVelocityFunction() const
{
return m_velocityFunc;
}
inline ChipmunkPhysWorld2D* ChipmunkRigidBody2D::GetWorld() const
{
return m_world;
}
inline bool ChipmunkRigidBody2D::IsKinematic() const
{
return m_mass <= 0.f;
}
inline bool ChipmunkRigidBody2D::IsSimulationEnabled() const
{
return m_isSimulationEnabled;
}
inline bool ChipmunkRigidBody2D::IsStatic() const
{
return m_isStatic;
}
}
#include <Nazara/ChipmunkPhysics2D/DebugOff.hpp>

View File

@ -1,40 +0,0 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - ChipmunkPhysics2D module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_CHIPMUNKPHYSICS2D_COMPONENTS_CHIPMUNKRIGIDBODY2DCOMPONENT_HPP
#define NAZARA_CHIPMUNKPHYSICS2D_COMPONENTS_CHIPMUNKRIGIDBODY2DCOMPONENT_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/ChipmunkPhysics2D/ChipmunkRigidBody2D.hpp>
#include <variant>
namespace Nz
{
class NAZARA_CHIPMUNKPHYSICS2D_API ChipmunkRigidBody2DComponent : public ChipmunkRigidBody2D
{
friend class ChipmunkPhysics2DSystem;
public:
inline ChipmunkRigidBody2DComponent(const ChipmunkRigidBody2D::DynamicSettings& settings);
inline ChipmunkRigidBody2DComponent(const ChipmunkRigidBody2D::StaticSettings& settings);
ChipmunkRigidBody2DComponent(const ChipmunkRigidBody2DComponent&) = default;
ChipmunkRigidBody2DComponent(ChipmunkRigidBody2DComponent&&) noexcept = default;
~ChipmunkRigidBody2DComponent() = default;
ChipmunkRigidBody2DComponent& operator=(const ChipmunkRigidBody2DComponent&) = default;
ChipmunkRigidBody2DComponent& operator=(ChipmunkRigidBody2DComponent&&) noexcept = default;
private:
inline void Construct(ChipmunkPhysWorld2D& world);
using Setting = std::variant<ChipmunkRigidBody2D::DynamicSettings, ChipmunkRigidBody2D::StaticSettings>;
std::unique_ptr<Setting> m_settings;
};
}
#include <Nazara/ChipmunkPhysics2D/Components/ChipmunkRigidBody2DComponent.inl>
#endif // NAZARA_CHIPMUNKPHYSICS2D_COMPONENTS_CHIPMUNKRIGIDBODY2DCOMPONENT_HPP

Some files were not shown because too many files have changed in this diff Show More