RegisterTypes.h 1.3 KB

1234567891011121314151617181920212223242526272829
  1. // Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
  2. // SPDX-FileCopyrightText: 2021 Jorrit Rouwe
  3. // SPDX-License-Identifier: MIT
  4. #pragma once
  5. JPH_NAMESPACE_BEGIN
  6. /// Internal helper function
  7. JPH_EXPORT extern bool VerifyJoltVersionIDInternal(uint64 inVersionID);
  8. /// This function can be used to verify the library ABI is compatible with your
  9. /// application.
  10. /// Use it in this way: `assert(VerifyJoltVersionID());`.
  11. /// Returns `false` if the library used is not compatible with your app.
  12. JPH_INLINE bool VerifyJoltVersionID() { return VerifyJoltVersionIDInternal(JPH_VERSION_ID); }
  13. /// Internal helper function
  14. JPH_EXPORT extern void RegisterTypesInternal(uint64 inVersionID);
  15. /// Register all physics types with the factory and install their collision handlers with the CollisionDispatch class.
  16. /// If you have your own custom shape types you probably need to register their handlers with the CollisionDispatch before calling this function.
  17. /// If you implement your own default material (PhysicsMaterial::sDefault) make sure to initialize it before this function or else this function will create one for you.
  18. JPH_INLINE void RegisterTypes() { RegisterTypesInternal(JPH_VERSION_ID); }
  19. /// Unregisters all types with the factory and cleans up the default material
  20. JPH_EXPORT extern void UnregisterTypes();
  21. JPH_NAMESPACE_END