-
-
Notifications
You must be signed in to change notification settings - Fork 281
/
Copy pathIBodyAccessFilter.cs
127 lines (120 loc) · 4.54 KB
/
IBodyAccessFilter.cs
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
namespace BepuPhysics.Constraints
{
/// <summary>
/// Constrains which body properties should be accessed in a body during constraint data gathering/scattering.
/// </summary>
public interface IBodyAccessFilter
{
/// <summary>
/// Gets whether position is loaded by the constraint.
/// </summary>
public bool GatherPosition { get; }
/// <summary>
/// Gets whether orientation is loaded by the constraint.
/// </summary>
public bool GatherOrientation { get; }
/// <summary>
/// Gets whether body mass is loaded by this constraint.
/// </summary>
public bool GatherMass { get; }
/// <summary>
/// Gets whether body inertia tensor is loaded by this constraint.
/// </summary>
public bool GatherInertiaTensor { get; }
/// <summary>
/// Gets whether to load or store body linear velocity in this constraint.
/// </summary>
public bool AccessLinearVelocity { get; }
/// <summary>
/// Gets whether to load or store body linear velocity in this constraint.
/// </summary>
public bool AccessAngularVelocity { get; }
}
/// <summary>
/// Marks all body properties as necessary for gather/scatter.
/// </summary>
public struct AccessAll : IBodyAccessFilter
{
public bool GatherPosition => true;
public bool GatherOrientation => true;
public bool GatherMass => true;
public bool GatherInertiaTensor => true;
public bool AccessLinearVelocity => true;
public bool AccessAngularVelocity => true;
}
/// <summary>
/// Used for kinematic integration; the inertias are known ahead of time and there's no reason to gather them.
/// </summary>
public struct AccessNoInertia : IBodyAccessFilter
{
public bool GatherPosition => true;
public bool GatherOrientation => true;
public bool GatherMass => false;
public bool GatherInertiaTensor => false;
public bool AccessLinearVelocity => true;
public bool AccessAngularVelocity => true;
}
public struct AccessNoPose : IBodyAccessFilter
{
public bool GatherPosition => false;
public bool GatherOrientation => false;
public bool GatherMass => true;
public bool GatherInertiaTensor => true;
public bool AccessLinearVelocity => true;
public bool AccessAngularVelocity => true;
}
public struct AccessNoPosition : IBodyAccessFilter
{
public bool GatherPosition => false;
public bool GatherOrientation => true;
public bool GatherMass => true;
public bool GatherInertiaTensor => true;
public bool AccessLinearVelocity => true;
public bool AccessAngularVelocity => true;
}
public struct AccessNoOrientation : IBodyAccessFilter
{
public bool GatherPosition => true;
public bool GatherOrientation => false;
public bool GatherMass => true;
public bool GatherInertiaTensor => true;
public bool AccessLinearVelocity => true;
public bool AccessAngularVelocity => true;
}
public struct AccessOnlyVelocity: IBodyAccessFilter
{
public bool GatherPosition => false;
public bool GatherOrientation => false;
public bool GatherMass => false;
public bool GatherInertiaTensor => false;
public bool AccessLinearVelocity => true;
public bool AccessAngularVelocity => true;
}
public struct AccessOnlyAngular : IBodyAccessFilter
{
public bool GatherPosition => false;
public bool GatherOrientation => true;
public bool GatherMass => false;
public bool GatherInertiaTensor => true;
public bool AccessLinearVelocity => false;
public bool AccessAngularVelocity => true;
}
public struct AccessOnlyAngularWithoutPose : IBodyAccessFilter
{
public bool GatherPosition => false;
public bool GatherOrientation => false;
public bool GatherMass => false;
public bool GatherInertiaTensor => true;
public bool AccessLinearVelocity => false;
public bool AccessAngularVelocity => true;
}
public struct AccessOnlyLinear : IBodyAccessFilter
{
public bool GatherPosition => true;
public bool GatherOrientation => false;
public bool GatherMass => true;
public bool GatherInertiaTensor => false;
public bool AccessLinearVelocity => true;
public bool AccessAngularVelocity => false;
}
}