Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
SoftBodyCreationSettings.h
Go to the documentation of this file.
1// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
2// SPDX-FileCopyrightText: 2023 Jorrit Rouwe
3// SPDX-License-Identifier: MIT
4
5#pragma once
6
12
14
18{
20
21public:
24 SoftBodyCreationSettings(const SoftBodySharedSettings *inSettings, RVec3Arg inPosition, QuatArg inRotation, ObjectLayer inObjectLayer) : mSettings(inSettings), mPosition(inPosition), mRotation(inRotation), mObjectLayer(inObjectLayer) { }
25
27 void SaveBinaryState(StreamOut &inStream) const;
28
30 void RestoreBinaryState(StreamIn &inStream);
31
38
42 void SaveWithChildren(StreamOut &inStream, SharedSettingsToIDMap *ioSharedSettingsMap, MaterialToIDMap *ioMaterialMap, GroupFilterToIDMap *ioGroupFilterMap) const;
43
45
47 static SBCSResult sRestoreWithChildren(StreamIn &inStream, IDToSharedSettingsMap &ioSharedSettingsMap, IDToMaterialMap &ioMaterialMap, IDToGroupFilterMap &ioGroupFilterMap);
48
50
51 RVec3 mPosition { RVec3::sZero() };
52 Quat mRotation { Quat::sIdentity() };
53
55 uint64 mUserData = 0;
56
58 ObjectLayer mObjectLayer = 0;
60
61 uint32 mNumIterations = 5;
62 float mLinearDamping = 0.1f;
63 float mMaxLinearVelocity = 500.0f;
64 float mRestitution = 0.0f;
65 float mFriction = 0.2f;
66 float mPressure = 0.0f;
67 float mGravityFactor = 1.0f;
68 bool mUpdatePosition = true;
69 bool mMakeRotationIdentity = true;
70 bool mAllowSleeping = true;
71};
72
#define JPH_EXPORT
Definition Core.h:236
std::uint64_t uint64
Definition Core.h:457
#define JPH_NAMESPACE_END
Definition Core.h:379
std::uint32_t uint32
Definition Core.h:456
#define JPH_NAMESPACE_BEGIN
Definition Core.h:373
uint16 ObjectLayer
Definition ObjectLayer.h:16
#define JPH_DECLARE_SERIALIZABLE_NON_VIRTUAL(linkage, class_name)
Definition SerializableObject.h:80
Definition Array.h:36
Definition CollisionGroup.h:20
Definition Quat.h:33
static JPH_INLINE Quat sIdentity()
Definition Quat.h:103
Definition Reference.h:163
Helper class that either contains a valid result or an error.
Definition Result.h:12
Definition SoftBodyCreationSettings.h:18
SoftBodyCreationSettings(const SoftBodySharedSettings *inSettings, RVec3Arg inPosition, QuatArg inRotation, ObjectLayer inObjectLayer)
Definition SoftBodyCreationSettings.h:24
SoftBodyCreationSettings()=default
Constructor.
RefConst< SoftBodySharedSettings > mSettings
Defines the configuration of this soft body.
Definition SoftBodyCreationSettings.h:49
CollisionGroup mCollisionGroup
The collision group this body belongs to (determines if two objects can collide)
Definition SoftBodyCreationSettings.h:59
Definition SoftBodySharedSettings.h:16
StreamUtils::IDToObjectMap< SoftBodySharedSettings > IDToSharedSettingsMap
Definition SoftBodySharedSettings.h:102
StreamUtils::ObjectToIDMap< SoftBodySharedSettings > SharedSettingsToIDMap
Definition SoftBodySharedSettings.h:101
Simple binary input stream.
Definition StreamIn.h:13
Simple binary output stream.
Definition StreamOut.h:13
Definition UnorderedMap.h:30
Definition Vec3.h:17
static JPH_INLINE Vec3 sZero()
Vector with all zeros.
Definition Vec3.inl:107