SoftBodyCreator.h 1.1 KB

123456789101112131415161718192021222324252627
  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 <Jolt/Physics/SoftBody/SoftBodySharedSettings.h>
  6. namespace SoftBodyCreator
  7. {
  8. /// Create a square cloth
  9. /// @param inGridSize Number of points along each axis
  10. /// @param inGridSpacing Distance between points
  11. /// @param inFixateCorners If the corners should be fixated and have infinite mass
  12. Ref<SoftBodySharedSettings> CreateCloth(uint inGridSize = 30, float inGridSpacing = 0.75f, bool inFixateCorners = true);
  13. /// Create a cube
  14. /// @param inGridSize Number of points along each axis
  15. /// @param inGridSpacing Distance between points
  16. Ref<SoftBodySharedSettings> CreateCube(uint inGridSize = 5, float inGridSpacing = 0.5f);
  17. /// Create a hollow sphere
  18. /// @param inRadius Radius of the sphere
  19. /// @param inNumTheta Number of segments in the theta direction
  20. /// @param inNumPhi Number of segments in the phi direction
  21. Ref<SoftBodySharedSettings> CreateSphere(float inRadius = 1.0f, uint inNumTheta = 10, uint inNumPhi = 20);
  22. };