public void CreateConnectionToWorld(HkdBreakableBody destructionBody) { if (BlocksConnectedToWorld.Count == 0) return; HkdFixedConnectivity conn = HkdFixedConnectivity.Create(); var voxelMap = MySession.Static.VoxelMaps.Instances.Single(); foreach (var pos in BlocksConnectedToWorld) { HkdFixedConnectivity.Connection c = new HkdFixedConnectivity.Connection(Vector3.Zero, Vector3.Up, 1, m_blocksShapes[pos].Shape, voxelMap.Physics.RigidBody, 0); conn.AddConnection(ref c); c.RemoveReference(); } destructionBody.SetFixedConnectivity(conn); conn.RemoveReference(); }
public void CreateConnectionToWorld(HkdBreakableBody destructionBody, HkWorld havokWorld) { if (BlocksConnectedToWorld.Count == 0) return; HkdFixedConnectivity conn = HkdFixedConnectivity.Create(); foreach (var pos in BlocksConnectedToWorld) { HkdFixedConnectivity.Connection c = new HkdFixedConnectivity.Connection(Vector3.Zero, Vector3.Up, 1, m_blocksShapes[pos].Shape, havokWorld.GetFixedBody(), 0); conn.AddConnection(ref c); c.RemoveReference(); } destructionBody.SetFixedConnectivity(conn); conn.RemoveReference(); }