forked from Unity-Technologies/UnityCsReference
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCloth.bindings.cs
More file actions
187 lines (145 loc) · 7.34 KB
/
Copy pathCloth.bindings.cs
File metadata and controls
187 lines (145 loc) · 7.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
// Unity C# reference source
// Copyright (c) Unity Technologies. For terms of use, see
// https://unity3d.com/legal/licenses/Unity_Reference_Only_License
using System;
using UnityEngine.Bindings;
using UnityEngine.Scripting;
using System.Collections.Generic;
using UnityEngine.Internal;
using System.Runtime.InteropServices;
using RequiredByNativeCodeAttribute = UnityEngine.Scripting.RequiredByNativeCodeAttribute;
using UsedByNativeCodeAttribute = UnityEngine.Scripting.UsedByNativeCodeAttribute;
namespace UnityEngine
{
[NativeHeader("Modules/Cloth/Cloth.h")]
[UsedByNativeCode]
public struct ClothSphereColliderPair
{
public SphereCollider first { get; set; }
public SphereCollider second { get; set; }
public ClothSphereColliderPair(SphereCollider a)
{
// initialize internal fields so that compiler does not complain about using properties before "this" is ready
first = a;
second = null;
}
public ClothSphereColliderPair(SphereCollider a, SphereCollider b)
{
// initialize internal fields so that compiler does not complain about using properties before "this" is ready
first = a;
second = b;
}
}
// The ClothSkinningCoefficient struct is used to set up how a [[Cloth]] component is allowed to move with respect to the [[SkinnedMeshRenderer]] it is attached to.
[UsedByNativeCode]
public struct ClothSkinningCoefficient
{
//Distance a vertex is allowed to travel from the skinned mesh vertex position.
public float maxDistance;
//Definition of a sphere a vertex is not allowed to enter. This allows collision against the animated cloth.
public float collisionSphereDistance;
}
[RequireComponent(typeof(Transform), typeof(SkinnedMeshRenderer))]
[NativeHeader("Modules/Cloth/Cloth.h")]
[NativeClass("Unity::Cloth")]
public sealed partial class Cloth : UnityEngine.Component
{
extern public Vector3[] vertices {[NativeName("GetPositions")] get; }
extern public Vector3[] normals {[NativeName("GetNormals")] get; }
extern public ClothSkinningCoefficient[] coefficients {[NativeName("GetCoefficients")] get; [NativeName("SetCoefficients")] set; }
extern public CapsuleCollider[] capsuleColliders {[NativeName("GetCapsuleColliders")] get; [NativeName("SetCapsuleColliders")] set; }
extern public ClothSphereColliderPair[] sphereColliders {[NativeName("GetSphereColliders")] get; [NativeName("SetSphereColliders")] set; }
extern public float sleepThreshold { get; set; }
// Bending stiffness of the cloth.
extern public float bendingStiffness { get; set; }
// Stretching stiffness of the cloth.
extern public float stretchingStiffness { get; set; }
// Damp cloth motion.
extern public float damping { get; set; }
// A constant, external acceleration applied to the cloth.
extern public Vector3 externalAcceleration { get; set; }
// A random, external acceleration applied to the cloth.
extern public Vector3 randomAcceleration { get; set; }
// Should gravity affect the cloth simulation?
extern public bool useGravity { get; set; }
// Is this cloth enabled?
extern public bool enabled { get; set; }
// The friction of the cloth when colliding with the character.
extern public float friction { get; set; }
// How much to increase mass of colliding particles
extern public float collisionMassScale { get; set; }
// Enable continuous collision to improve collision stability
extern public bool enableContinuousCollision { get; set; }
// Add 1 virtual particle per triangle to improve collision stability
extern public float useVirtualParticles { get; set; }
// How much world-space movement of the character will affect cloth vertices.
extern public float worldVelocityScale { get; set; }
// How much world-space acceleration of the character will affect cloth vertices.
extern public float worldAccelerationScale { get; set; }
extern public float clothSolverFrequency { get; set; }
[Obsolete("Parameter solverFrequency is obsolete and no longer supported. Please use clothSolverFrequency instead.")]
public bool solverFrequency
{
get { return clothSolverFrequency > 0.0f ? true : false; }
set { clothSolverFrequency = value == true ? 120f : 0.0f; } // use the default value
}
extern public bool useTethers { get; set; }
extern public float stiffnessFrequency { get; set; }
extern public float selfCollisionDistance { get; set; }
extern public float selfCollisionStiffness { get; set; }
extern public void ClearTransformMotion();
extern private UInt32[] GetSelfAndInterCollisionIndices();
internal void Internal_GetSelfAndInterCollisionIndices(List<UInt32> indicesOutList)
{
UInt32[] indices = GetSelfAndInterCollisionIndices();
indicesOutList.Clear();
indicesOutList.AddRange(indices);
}
extern private void SetSelfAndInterCollisionIndices(UInt32[] indicesIn);
internal void Internal_SetSelfAndInterCollisionIndices(List<UInt32> indicesInList)
{
SetSelfAndInterCollisionIndices(indicesInList.ToArray());
}
extern private UInt32[] GetVirtualParticleIndices();
internal void Internal_GetVirtualParticleIndices(List<UInt32> indicesOutList)
{
UInt32[] indices = GetVirtualParticleIndices();
indicesOutList.Clear();
indicesOutList.AddRange(indices);
}
extern private void SetVirtualParticleIndices(UInt32[] indicesIn);
internal void Internal_SetVirtualParticleIndices(List<UInt32> indicesInList)
{
SetVirtualParticleIndices(indicesInList.ToArray());
}
extern private Vector3[] GetVirtualParticleWeights();
internal void Internal_GetVirtualParticleWeights(List<Vector3> weightsOutList)
{
Vector3[] weights = GetVirtualParticleWeights();
weightsOutList.Clear();
weightsOutList.AddRange(weights);
}
extern private void SetVirtualParticleWeights(Vector3[] weightsIn);
internal void Internal_SetVirtualParticleWeights(List<Vector3> weightsInList)
{
SetVirtualParticleWeights(weightsInList.ToArray());
}
[Obsolete("useContinuousCollision is no longer supported, use enableContinuousCollision instead")]
public float useContinuousCollision { get; set; }
[Obsolete("Deprecated.Cloth.selfCollisions is no longer supported since Unity 5.0.", true)]
public bool selfCollision { get; }
extern public void SetEnabledFading(bool enabled, float interpolationTime);
[ExcludeFromDocs]
public void SetEnabledFading(bool enabled)
{
SetEnabledFading(enabled, 0.5f);
}
extern private RaycastHit Raycast(Ray ray, float maxDistance, ref bool hasHit);
internal bool Raycast(Ray ray, out RaycastHit hitInfo, float maxDistance)
{
bool hasHit = false;
hitInfo = Raycast(ray, maxDistance, ref hasHit);
return hasHit;
}
}
}