-
-
Notifications
You must be signed in to change notification settings - Fork 277
/
TypeBatch.cs
37 lines (34 loc) · 1.12 KB
/
TypeBatch.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
using BepuUtilities;
using BepuUtilities.Memory;
using System.Runtime.CompilerServices;
namespace BepuPhysics.Constraints
{
/// <summary>
/// Stores the raw AOSOA formatted data associated with constraints in a type batch.
/// </summary>
public struct TypeBatch
{
//Note the constraint data is all stored untyped. It is up to the user to read from these pointers correctly.
public Buffer<byte> BodyReferences;
public Buffer<byte> PrestepData;
public Buffer<byte> AccumulatedImpulses;
public Buffer<ConstraintHandle> IndexToHandle;
public int ConstraintCount;
public int TypeId;
public int BundleCount
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
return BundleIndexing.GetBundleCount(ConstraintCount);
}
}
public void Dispose(BufferPool pool)
{
pool.Return(ref BodyReferences);
pool.Return(ref PrestepData);
pool.Return(ref AccumulatedImpulses);
pool.Return(ref IndexToHandle);
}
}
}