//
// Generated by Brutal.Jolt.Generate; do not edit by hand.
#nullable enable
using System.Runtime.CompilerServices;
using Brutal.Interop;
using Brutal.Numerics;
namespace Brutal.JoltApi
{
///
///
/// This class contains the information needed to create a soft body object Note: Soft bodies are still in
/// development and come with several caveats. Read the Architecture and API documentation for more information!
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:17
///
/// class SoftBodyCreationSettings
///
///
[InteropHandle]
public readonly partial struct SoftBodyCreationSettings : IDisposable
{
///
///
/// Constructor
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:23
///
/// SoftBodyCreationSettings() = default
///
///
public static SoftBodyCreationSettings Create() => Jolt.PInvoke.SoftBodyCreationSettings_Create();
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:24
///
/// SoftBodyCreationSettings(const SoftBodySharedSettings *inSettings, RVec3Arg inPosition, QuatArg inRotation, ObjectLayer inObjectLayer)
///
///
public static SoftBodyCreationSettings Create(
SoftBodySharedSettings settings,
float3 position,
floatQuat rotation,
ushort objectLayer
) => Jolt.PInvoke.SoftBodyCreationSettings_Create_2(settings, position, rotation, objectLayer);
///
///
/// Saves the state of this object in binary form to inStream. Doesn't store the shared settings nor the
/// group filter.
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:27
///
/// void SaveBinaryState(StreamOut &inStream) const
///
///
public void SaveBinaryState(StreamOut stream) =>
Jolt.PInvoke.SoftBodyCreationSettings_SaveBinaryState(this, stream);
///
///
/// Restore the state of this object from inStream. Doesn't restore the shared settings nor the group
/// filter.
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:30
///
/// void RestoreBinaryState(StreamIn &inStream)
///
///
public void RestoreBinaryState(StreamIn stream) =>
Jolt.PInvoke.SoftBodyCreationSettings_RestoreBinaryState(this, stream);
///
///
/// Save this body creation settings, its shared settings and group filter. Pass in an empty map in
/// ioSharedSettingsMap / ioMaterialMap / ioGroupFilterMap or reuse the same map while saving multiple
/// shapes to the same stream in order to avoid writing duplicates. Pass nullptr to ioSharedSettingsMap and
/// ioMaterial map to skip saving shared settings and materials Pass nullptr to ioGroupFilterMap to skip
/// saving group filters
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:42
///
/// void SaveWithChildren(StreamOut &inStream, SharedSettingsToIDMap *ioSharedSettingsMap, MaterialToIDMap *ioMaterialMap, GroupFilterToIDMap *ioGroupFilterMap) const
///
///
///
///
/// A null sharedSettingsMap leaves the objects it covers out of the stream: Jolt writes them as null (a
/// body's shape needs both its shape and material maps).
///
///
/// A null materialMap leaves the objects it covers out of the stream: Jolt writes them as null (a body's
/// shape needs both its shape and material maps).
///
///
/// A null groupFilterMap leaves the objects it covers out of the stream: Jolt writes them as null (a body's
/// shape needs both its shape and material maps).
///
///
public void SaveWithChildren(
StreamOut stream,
SharedSettingsToIDMap sharedSettingsMap,
MaterialToIDMap materialMap,
GroupFilterToIDMap groupFilterMap
) =>
Jolt.PInvoke.SoftBodyCreationSettings_SaveWithChildren(
this,
stream,
sharedSettingsMap,
materialMap,
groupFilterMap
);
///
///
/// Restore a shape, all its children and materials. Pass in an empty map in ioSharedSettingsMap /
/// ioMaterialMap / ioGroupFilterMap or reuse the same map while reading multiple shapes from the same
/// stream in order to restore duplicates.
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:47
///
/// static SBCSResult sRestoreWithChildren(StreamIn &inStream, IDToSharedSettingsMap &ioSharedSettingsMap, IDToMaterialMap &ioMaterialMap, IDToGroupFilterMap &ioGroupFilterMap)
///
///
///
///
/// Throws JoltException with Jolt's error message when the operation fails. The returned handle is an owned
/// copy; Dispose it when you're done with it.
///
///
public static SoftBodyCreationSettings RestoreWithChildren(
StreamIn stream,
IDToSharedSettingsMap sharedSettingsMap,
IDToMaterialMap materialMap,
IDToGroupFilterMap groupFilterMap
)
{
var _handle = Jolt.PInvoke.SoftBodyCreationSettings_RestoreWithChildren(
stream,
sharedSettingsMap,
materialMap,
groupFilterMap
);
if (_handle.IsNull())
throw JoltException.FromLastError();
return _handle;
}
///
///
/// Defines the configuration of this soft body
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:49
///
/// RefConst<SoftBodySharedSettings> mSettings
///
///
///
///
/// The returned handle carries its own reference; Dispose it once when you're done.
///
///
public SoftBodySharedSettings GetSettings() => Jolt.PInvoke.SoftBodyCreationSettings_GetSettings(this);
///
///
/// Defines the configuration of this soft body
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:49
///
/// RefConst<SoftBodySharedSettings> mSettings
///
///
public void SetSettings(SoftBodySharedSettings value) =>
Jolt.PInvoke.SoftBodyCreationSettings_SetSettings(this, value);
///
///
/// Initial position of the soft body
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:51
///
/// RVec3 mPosition { RVec3::sZero() }
///
///
public float3 GetPosition() => Jolt.PInvoke.SoftBodyCreationSettings_GetPosition(this);
///
///
/// Initial position of the soft body
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:51
///
/// RVec3 mPosition { RVec3::sZero() }
///
///
public void SetPosition(float3 value) => Jolt.PInvoke.SoftBodyCreationSettings_SetPosition(this, value);
///
///
/// Initial rotation of the soft body
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:52
///
/// Quat mRotation { Quat::sIdentity() }
///
///
public floatQuat GetRotation() => Jolt.PInvoke.SoftBodyCreationSettings_GetRotation(this);
///
///
/// Initial rotation of the soft body
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:52
///
/// Quat mRotation { Quat::sIdentity() }
///
///
public void SetRotation(floatQuat value) => Jolt.PInvoke.SoftBodyCreationSettings_SetRotation(this, value);
///
///
/// User data value (can be used by application)
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:55
///
/// uint64 mUserData = 0
///
///
public ulong GetUserData() => Jolt.PInvoke.SoftBodyCreationSettings_GetUserData(this);
///
///
/// User data value (can be used by application)
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:55
///
/// uint64 mUserData = 0
///
///
public void SetUserData(ulong value) => Jolt.PInvoke.SoftBodyCreationSettings_SetUserData(this, value);
///
///
/// The collision layer this body belongs to (determines if two objects can collide)
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:58
///
/// ObjectLayer mObjectLayer = 0
///
///
///
///
/// @name Collision settings
///
///
public ushort GetObjectLayer() => Jolt.PInvoke.SoftBodyCreationSettings_GetObjectLayer(this);
///
///
/// The collision layer this body belongs to (determines if two objects can collide)
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:58
///
/// ObjectLayer mObjectLayer = 0
///
///
///
///
/// @name Collision settings
///
///
public void SetObjectLayer(ushort value) => Jolt.PInvoke.SoftBodyCreationSettings_SetObjectLayer(this, value);
///
///
/// The collision group this body belongs to (determines if two objects can collide)
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:59
///
/// CollisionGroup mCollisionGroup
///
///
///
///
/// The returned handle is an owned copy; Dispose it when you're done with it.
///
///
public CollisionGroup GetCollisionGroup() => Jolt.PInvoke.SoftBodyCreationSettings_GetCollisionGroup(this);
///
///
/// The collision group this body belongs to (determines if two objects can collide)
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:59
///
/// CollisionGroup mCollisionGroup
///
///
///
///
/// The value is copied into the field; the handle you pass stays yours to Dispose.
///
///
public void SetCollisionGroup(CollisionGroup value) =>
Jolt.PInvoke.SoftBodyCreationSettings_SetCollisionGroup(this, value);
///
///
/// Number of solver iterations
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:61
///
/// uint32 mNumIterations = 5
///
///
public uint GetNumIterations() => Jolt.PInvoke.SoftBodyCreationSettings_GetNumIterations(this);
///
///
/// Number of solver iterations
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:61
///
/// uint32 mNumIterations = 5
///
///
public void SetNumIterations(uint value) => Jolt.PInvoke.SoftBodyCreationSettings_SetNumIterations(this, value);
///
///
/// Linear damping: dv/dt = -mLinearDamping * v. Value should be zero or positive and is usually close to 0.
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:62
///
/// float mLinearDamping = 0.1f
///
///
public float GetLinearDamping() => Jolt.PInvoke.SoftBodyCreationSettings_GetLinearDamping(this);
///
///
/// Linear damping: dv/dt = -mLinearDamping * v. Value should be zero or positive and is usually close to 0.
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:62
///
/// float mLinearDamping = 0.1f
///
///
public void SetLinearDamping(float value) =>
Jolt.PInvoke.SoftBodyCreationSettings_SetLinearDamping(this, value);
///
///
/// Maximum linear velocity that a vertex can reach (m/s)
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:63
///
/// float mMaxLinearVelocity = 500.0f
///
///
public float GetMaxLinearVelocity() => Jolt.PInvoke.SoftBodyCreationSettings_GetMaxLinearVelocity(this);
///
///
/// Maximum linear velocity that a vertex can reach (m/s)
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:63
///
/// float mMaxLinearVelocity = 500.0f
///
///
public void SetMaxLinearVelocity(float value) =>
Jolt.PInvoke.SoftBodyCreationSettings_SetMaxLinearVelocity(this, value);
///
///
/// Restitution when colliding
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:64
///
/// float mRestitution = 0.0f
///
///
public float GetRestitution() => Jolt.PInvoke.SoftBodyCreationSettings_GetRestitution(this);
///
///
/// Restitution when colliding
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:64
///
/// float mRestitution = 0.0f
///
///
public void SetRestitution(float value) => Jolt.PInvoke.SoftBodyCreationSettings_SetRestitution(this, value);
///
///
/// Friction coefficient when colliding
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:65
///
/// float mFriction = 0.2f
///
///
public float GetFriction() => Jolt.PInvoke.SoftBodyCreationSettings_GetFriction(this);
///
///
/// Friction coefficient when colliding
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:65
///
/// float mFriction = 0.2f
///
///
public void SetFriction(float value) => Jolt.PInvoke.SoftBodyCreationSettings_SetFriction(this, value);
///
///
/// n * R * T, amount of substance * ideal gas constant * absolute temperature, see
/// https://en.wikipedia.org/wiki/Pressure
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:66
///
/// float mPressure = 0.0f
///
///
public float GetPressure() => Jolt.PInvoke.SoftBodyCreationSettings_GetPressure(this);
///
///
/// n * R * T, amount of substance * ideal gas constant * absolute temperature, see
/// https://en.wikipedia.org/wiki/Pressure
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:66
///
/// float mPressure = 0.0f
///
///
public void SetPressure(float value) => Jolt.PInvoke.SoftBodyCreationSettings_SetPressure(this, value);
///
///
/// Value to multiply gravity with for this body
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:67
///
/// float mGravityFactor = 1.0f
///
///
public float GetGravityFactor() => Jolt.PInvoke.SoftBodyCreationSettings_GetGravityFactor(this);
///
///
/// Value to multiply gravity with for this body
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:67
///
/// float mGravityFactor = 1.0f
///
///
public void SetGravityFactor(float value) =>
Jolt.PInvoke.SoftBodyCreationSettings_SetGravityFactor(this, value);
///
///
/// How big the particles are, can be used to push the vertices a little bit away from the surface of other
/// bodies to prevent z-fighting
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:68
///
/// float mVertexRadius = 0.0f
///
///
public float GetVertexRadius() => Jolt.PInvoke.SoftBodyCreationSettings_GetVertexRadius(this);
///
///
/// How big the particles are, can be used to push the vertices a little bit away from the surface of other
/// bodies to prevent z-fighting
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:68
///
/// float mVertexRadius = 0.0f
///
///
public void SetVertexRadius(float value) => Jolt.PInvoke.SoftBodyCreationSettings_SetVertexRadius(this, value);
///
///
/// Update the position of the body while simulating (set to false for something that is attached to the
/// static world)
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:69
///
/// bool mUpdatePosition = true
///
///
public bool GetUpdatePosition() => Jolt.PInvoke.SoftBodyCreationSettings_GetUpdatePosition(this);
///
///
/// Update the position of the body while simulating (set to false for something that is attached to the
/// static world)
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:69
///
/// bool mUpdatePosition = true
///
///
public void SetUpdatePosition(bool value) =>
Jolt.PInvoke.SoftBodyCreationSettings_SetUpdatePosition(this, value);
///
///
/// Bake specified mRotation in the vertices and set the body rotation to identity (simulation is slightly
/// more accurate if the rotation of a soft body is kept to identity)
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:70
///
/// bool mMakeRotationIdentity = true
///
///
public bool GetMakeRotationIdentity() => Jolt.PInvoke.SoftBodyCreationSettings_GetMakeRotationIdentity(this);
///
///
/// Bake specified mRotation in the vertices and set the body rotation to identity (simulation is slightly
/// more accurate if the rotation of a soft body is kept to identity)
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:70
///
/// bool mMakeRotationIdentity = true
///
///
public void SetMakeRotationIdentity(bool value) =>
Jolt.PInvoke.SoftBodyCreationSettings_SetMakeRotationIdentity(this, value);
///
///
/// If this body can go to sleep or not
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:71
///
/// bool mAllowSleeping = true
///
///
public bool GetAllowSleeping() => Jolt.PInvoke.SoftBodyCreationSettings_GetAllowSleeping(this);
///
///
/// If this body can go to sleep or not
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:71
///
/// bool mAllowSleeping = true
///
///
public void SetAllowSleeping(bool value) => Jolt.PInvoke.SoftBodyCreationSettings_SetAllowSleeping(this, value);
///
///
/// If the faces in this soft body should be treated as double sided for the purpose of collision detection
/// (ray cast / collide shape / cast shape)
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:72
///
/// bool mFacesDoubleSided = false
///
///
public bool GetFacesDoubleSided() => Jolt.PInvoke.SoftBodyCreationSettings_GetFacesDoubleSided(this);
///
///
/// If the faces in this soft body should be treated as double sided for the purpose of collision detection
/// (ray cast / collide shape / cast shape)
///
///
/// C++:
/// Jolt/Physics/SoftBody/SoftBodyCreationSettings.h:72
///
/// bool mFacesDoubleSided = false
///
///
public void SetFacesDoubleSided(bool value) =>
Jolt.PInvoke.SoftBodyCreationSettings_SetFacesDoubleSided(this, value);
public void Dispose() => Jolt.PInvoke.SoftBodyCreationSettings_Destroy(this);
}
}