forked from Unity-Technologies/EntityComponentSystemSamples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCartesianGridOnPlane.cs
More file actions
28 lines (24 loc) · 798 Bytes
/
Copy pathCartesianGridOnPlane.cs
File metadata and controls
28 lines (24 loc) · 798 Bytes
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
using Unity.Entities;
using Unity.Mathematics;
public struct CartesianGridOnPlane : IComponentData
{
public BlobAssetReference<CartesianGridOnPlaneBlob> Blob;
}
public struct CartesianGridOnPlaneBlob
{
public ushort RowCount;
public ushort ColCount;
// Offset vector for trailing edge of unit-size object.
// Pre-added to grid center.
// [0] = ( cx + 0.0f, cz + -0.5f ); // North
// [1] = ( cx + 0.0f, cz + 0.5f ); // South
// [2] = ( cx + 0.5f, cz + 0.0f ); // West
// [3] = ( cx + -0.5f, cz + 0.0f ); // East
public BlobArray<float2> TrailingOffsets;
// NativeArray<4bit x rowCount x colCount> of walls.
// 0x01 = North
// 0x02 = South
// 0x04 = West
// 0x08 = East
public BlobArray<byte> Walls;
}