mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-11 14:44:36 +00:00
initial commit jolt
This commit is contained in:
parent
0c2aa5328c
commit
8acf7da95b
1086 changed files with 214612 additions and 4 deletions
26
Engine/lib/JoltPhysics/Samples/Utils/SoftBodyCreator.h
Normal file
26
Engine/lib/JoltPhysics/Samples/Utils/SoftBodyCreator.h
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
|
||||
// SPDX-FileCopyrightText: 2023 Jorrit Rouwe
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Jolt/Physics/SoftBody/SoftBodySharedSettings.h>
|
||||
|
||||
namespace SoftBodyCreator
|
||||
{
|
||||
/// Create a square cloth
|
||||
/// @param inGridSizeX Number of points along the X axis
|
||||
/// @param inGridSizeZ Number of points along the Z axis
|
||||
/// @param inGridSpacing Distance between points
|
||||
/// @param inVertexGetInvMass Function that determines the inverse mass of each vertex
|
||||
Ref<SoftBodySharedSettings> CreateCloth(uint inGridSizeX = 30, uint inGridSizeZ = 30, float inGridSpacing = 0.75f, const function<float(uint, uint)> &inVertexGetInvMass = [](uint, uint) { return 1.0f; }, const function<Vec3(uint, uint)> &inVertexPerturbation = [](uint, uint) { return Vec3::sZero(); }, SoftBodySharedSettings::EBendType inBendType = SoftBodySharedSettings::EBendType::None, const SoftBodySharedSettings::VertexAttributes &inVertexAttributes = { 1.0e-5f, 1.0e-5f, 1.0e-5f });
|
||||
|
||||
/// Same as above but fixates the corners of the cloth
|
||||
Ref<SoftBodySharedSettings> CreateClothWithFixatedCorners(uint inGridSizeX = 30, uint inGridSizeZ = 30, float inGridSpacing = 0.75f);
|
||||
|
||||
/// Create a hollow sphere
|
||||
/// @param inRadius Radius of the sphere
|
||||
/// @param inNumTheta Number of segments in the theta direction
|
||||
/// @param inNumPhi Number of segments in the phi direction
|
||||
Ref<SoftBodySharedSettings> CreateSphere(float inRadius = 1.0f, uint inNumTheta = 10, uint inNumPhi = 20, SoftBodySharedSettings::EBendType inBendType = SoftBodySharedSettings::EBendType::None, const SoftBodySharedSettings::VertexAttributes &inVertexAttributes = { 1.0e-4f, 1.0e-4f, 1.0e-3f });
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue