public void Load(PhysicsSimulator physicsSimulator, PhysicsProcessor physicsProcessor) { int count = _bottomRowBlockCount * (1 + _bottomRowBlockCount) / 2; _blockBody = new Body[count]; _blockGeom = new Geom[count]; _blockLink = new ObjectLinker[count]; for (int i = 0; i < _blockBody.Length; i++) { _blockBody[i] = BodyFactory.Instance.CreateBody(physicsSimulator, _referenceBody); _blockGeom[i] = GeomFactory.Instance.CreateGeom(physicsSimulator, _blockBody[i], _referenceGeom); // POINT OF INTEREST // Create the link for each body, and register it into the phyisics processor _blockLink[i] = new ObjectLinker(_blockBody[i]); physicsProcessor.AddLink(_blockLink[i]); } CreatePyramid(); }
// POINT OF INTEREST // Register a link to get it syncronised after each update public void AddLink(ObjectLinker link) { _linkList.Add(link); }