protected override void OnCreate() { entityManager = World.Active.EntityManager; playerSystem = World.Active.GetOrCreateSystem <PlayerEntitySystem>(); UpdateCurrentCellIndex(); previousCellIndex = new int2(100); sectorArchetype = entityManager.CreateArchetype( ComponentType.ReadWrite <LocalToWorld>(), ComponentType.ReadWrite <Translation>(), ComponentType.ReadWrite <RenderMeshProxy>() ); float3 matrixRoot = new float3(currentCellIndex.x, 0, currentCellIndex.y); sectorMatrix = new Matrix <Entity>(5, Allocator.Persistent, matrixRoot); cellMatrix = new Matrix <CellMatrixItem>(5, Allocator.Persistent, matrixRoot); EntityQueryDesc sectorSortQueryDesc = new EntityQueryDesc { All = new ComponentType[] { typeof(AdjacentCell), typeof(SectorCell), typeof(WorleyNoise.PointData) }, None = new ComponentType[] { typeof(Tags.TerrainEntity) } }; sectorSortQuery = GetEntityQuery(sectorSortQueryDesc); worley = TerrainSettings.CellWorley(); topologyUtil = new TopologyUtil().Construct(); }
protected override void OnCreate() { entityManager = World.Active.EntityManager; playerSystem = World.Active.GetOrCreateSystem <PlayerEntitySystem>(); cellSystem = World.Active.GetOrCreateSystem <CellSystem>(); monoBehaviour = GameObject.FindObjectOfType <DebugMonoBehaviour>(); debugWorley = TerrainSettings.CellWorley(); topologyUtil = new TopologyUtil().Construct(); worleyCurrentMarker = CreateCube(float3.zero, new float4(0, 1, 0, 1)); worleyAdjacentMarker = CreateCube(float3.zero, new float4(0, 0, 1, 1)); }
protected override void OnCreate() { entityManager = World.Active.EntityManager; topologyUtil = new TopologyUtil().Construct(); EntityQueryDesc meshDataQuery = new EntityQueryDesc { All = new ComponentType[] { typeof(Tags.TerrainEntity), typeof(WorleyNoise.PointData), typeof(TopologySystem.Height) }, None = new ComponentType[] { typeof(Vertex) } }; meshDataGroup = GetEntityQuery(meshDataQuery); }
protected override void OnCreate() { entityManager = World.Active.EntityManager; cellSystem = World.Active.GetOrCreateSystem <CellSystem>(); topologyUtil = new TopologyUtil().Construct(); EntityQueryDesc sectorQuery = new EntityQueryDesc { All = new ComponentType[] { typeof(Tags.TerrainEntity), typeof(CellSystem.AdjacentCell), typeof(CellSystem.SectorCell) }, None = new ComponentType[] { typeof(TypeComponent) } }; sectorGroup = GetEntityQuery(sectorQuery); }
protected override void OnCreate() { entityManager = World.Active.EntityManager; cellSystem = World.Active.GetOrCreateSystem <CellSystem>(); topologyUtil = new TopologyUtil().Construct(); EntityQueryDesc topologyQuery = new EntityQueryDesc { All = new ComponentType[] { typeof(WorleyNoise.PointData), typeof(SectorSystem.MasterCell) }, None = new ComponentType[] { typeof(Height) } }; topologyGroup = GetEntityQuery(topologyQuery); }
public WorleyNoise(int seed, float frequency, float perterbAmp, float cellularJitter, DistanceFunction distanceFunction, CellularReturnType cellularReturnType, Distance2EdgeBorder distance2EdgeBorder) { this.seed = seed; this.frequency = frequency; this.perterbAmp = perterbAmp; this.cellularJitter = cellularJitter; this.distanceFunction = distanceFunction; this.cellularReturnType = cellularReturnType; this.distance2EdgeBorder = distance2EdgeBorder; topologyUtil = new TopologyUtil().Construct(); cell_2D = new CELL_2D(); X_PRIME = 1619; Y_PRIME = 31337; }
protected override void OnCreate() { entityManager = World.Active.EntityManager; topologyUtil = new TopologyUtil().Construct(); waterArchetype = entityManager.CreateArchetype( ComponentType.ReadWrite <LocalToWorld>(), ComponentType.ReadWrite <Translation>(), ComponentType.ReadWrite <RenderMeshProxy>(), ComponentType.ReadWrite <Tags.WaterEntity>() ); EntityQueryDesc meshDataQuery = new EntityQueryDesc { All = new ComponentType[] { typeof(Tags.TerrainEntity), typeof(Tags.CreateWaterEntity), typeof(TopologySystem.Height) }, None = new ComponentType[] { typeof(Vertex) } }; meshDataGroup = GetEntityQuery(meshDataQuery); }