ConveyorBeltTest.h 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. // Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
  2. // SPDX-FileCopyrightText: 2023 Jorrit Rouwe
  3. // SPDX-License-Identifier: MIT
  4. #pragma once
  5. #include <Tests/Test.h>
  6. class ConveyorBeltTest : public Test, public ContactListener
  7. {
  8. public:
  9. JPH_DECLARE_RTTI_VIRTUAL(JPH_NO_EXPORT, ConveyorBeltTest)
  10. // Description of the test
  11. virtual const char * GetDescription() const override
  12. {
  13. return "Demonstrates how to use a contact listener to implement a conveyor belt.";
  14. }
  15. // See: Test
  16. virtual void Initialize() override;
  17. // If this test implements a contact listener, it should be returned here
  18. virtual ContactListener *GetContactListener() override { return this; }
  19. // See: ContactListener
  20. virtual void OnContactAdded(const Body &inBody1, const Body &inBody2, const ContactManifold &inManifold, ContactSettings &ioSettings) override;
  21. virtual void OnContactPersisted(const Body &inBody1, const Body &inBody2, const ContactManifold &inManifold, ContactSettings &ioSettings) override;
  22. private:
  23. BodyIDVector mLinearBelts;
  24. BodyID mAngularBelt;
  25. };