forked from bepu/bepuphysics2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIBatchIntegrationMode.cs
60 lines (50 loc) · 2.23 KB
/
IBatchIntegrationMode.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
namespace BepuPhysics.Constraints
{
//These are used as compile time specialization constants. The solver can preprocess constraint references to know whether a given batch has any constraints that need integration.
//The first batch, for example, is known to require integration for every single constraint, since the first batch is necessarily the first time you see any body.
//Similarly, there is a number of batches beyond which no constraints will have any integration responsibilities.
//By marking those ahead of time, we avoid the nonzero cost of checking the integration flags.
/// <summary>
/// Marks a type as determining the integration mode for a solver batch.
/// </summary>
public interface IBatchIntegrationMode
{
}
/// <summary>
/// The batch was determined to have only constraints with integration responsibilities, so there's no need to check.
/// </summary>
public struct BatchShouldAlwaysIntegrate : IBatchIntegrationMode
{
}
/// <summary>
/// The batch was determined to have no constraints with integration responsibilities, so there's no need to check.
/// </summary>
public struct BatchShouldNeverIntegrate : IBatchIntegrationMode
{
}
/// <summary>
/// The batch was determined to have some constraints with integration responsibilities.
/// </summary>
public struct BatchShouldConditionallyIntegrate : IBatchIntegrationMode
{
}
/// <summary>
/// Marks a type as determining whether pose integration should be performed on bodies within the constraint batch.
/// </summary>
public interface IBatchPoseIntegrationAllowed
{
}
/// <summary>
/// Marks a batch as integrating poses for any bodies with integration responsibility within the constraint batch.
/// Constraints which need to be updated in response to pose integration will also have their UpdateForNewPose function called.
/// </summary>
public struct AllowPoseIntegration : IBatchPoseIntegrationAllowed
{
}
/// <summary>
/// Marks a batch as not integrating poses for any bodies within the constraint batch.
/// </summary>
public struct DisallowPoseIntegration : IBatchPoseIntegrationAllowed
{
}
}