public void ReadMemMap() { long size = AcessDLL.GetSize(memMapName.text); float[] f = new float[size]; AcessDLL.ReadMemoryShare(memMapName.text, f); dataGridContent.PopulateData(f); }
public void OpenSharedMemory() { Debug.Log("Open!"); memMapName = memMapNameInputField.text; particleCount = int.Parse(memMapSizeInputField.text); bufSize = particleCount * 3; // for x, y and z coordinates. int r = AcessDLL.OpenMemoryShare(memMapName, bufSize); fluidContainer.StartFluidSimulation(particleCount); }
// Update is called once per frame void Update() { if (isSimulating) { ParticleSystem.Particle[] fluidParticles = new ParticleSystem.Particle[particleCount]; bool r = AcessDLL.ReadMemoryShare(memMapName, dataStream); psFluid.GetParticles(fluidParticles); //Debug.Log(fluidParticles.Length); //Debug.Log(dataStream.Length); int particleIndex = 0; for (int i = 0; i < dataStream.Length; i += 3) { Vector3 newPos = new Vector3(dataStream[i], dataStream[i + 1], dataStream[i + 2]); //fluidParticles[particleIndex].color = colors[ii]; fluidParticles[particleIndex].position = newPos; //Debug.DrawLine(newPos, new Vector3(newPos.x + 0.1f, newPos.y, newPos.z)); particleIndex++; } psFluid.SetParticles(fluidParticles, fluidParticles.Length); } }
public void CloseSharedMemory() { Debug.Log("Close"); fluidContainer.StopFluidSimulation(); AcessDLL.CloseAllMemoryShare(); }
public void CloseMemMap() { AcessDLL.CloseAllMemoryShare(); }
public void WriteMemMap() { AcessDLL.WriteMemoryShare(memMapName.text, dataGridContent.fList); }
public void OpenMemMap() { AcessDLL.OpenMemoryShare(memMapName.text, long.Parse(memMapSize.text)); }