public void MortonOrder_0_0() { uint morton = ConverMortonOrder.GetMortonOrder(0, 0, 1, 1); Assert.AreEqual(0, morton); // Use the Assert class to test conditions }
public void Register(SpriteRenderer target) { uint targetMorton = ConverMortonOrder.GetSpriteRendererMortonOrder(target, lengthX, lengthY); if (cells[targetMorton] == null) { Debug.Log("新規登録" + targetMorton); cells[targetMorton] = new MortonCell <SpriteRenderer>(); } cells[targetMorton].Objects.Add(target); }
public void MortonOrderSpriteRenderer_1_1() { float lengthX = 250; float lengthY = 125; GameObject obj = new GameObject(); obj.AddComponent <SpriteRenderer>(); SpriteRenderer target = obj.GetComponent <SpriteRenderer>(); target.transform.position = new Vector3(lengthX * 3, lengthY * 1, 0); target.size = new Vector2(100, 100); uint morton = ConverMortonOrder.GetSpriteRendererMortonOrder(target, lengthX, lengthY); Assert.AreEqual(22, morton); }
public void Init() { float lengthX = 250; float lengthY = 125; GameObject obj = new GameObject(); obj.AddComponent <SpriteRenderer>(); SpriteRenderer target = obj.GetComponent <SpriteRenderer>(); target.transform.position = new Vector3(lengthX * 3, lengthY * 1, 0); target.size = new Vector2(100, 100); // 登録 uint targetMorton = ConverMortonOrder.GetSpriteRendererMortonOrder(target, lengthX, lengthY); if (cells[targetMorton] == null) { cells[targetMorton] = new MortonCell <SpriteRenderer>(); cells[targetMorton].Objects = new List <SpriteRenderer>(); } cells[targetMorton].Objects.Add(target); }
public void MortonOrderDeci_3_1() { uint morton = ConverMortonOrder.GetMortonOrder(32, 16, 10, 10); Assert.AreEqual(0b0111, morton); }
public void MortonOrder_3_1() { uint morton = ConverMortonOrder.GetMortonOrder(3, 1, 1, 1); Assert.AreEqual(0b0111, morton); }