public override void Teardown() { InteractionC.DestroyShapeInstance(ref _scene, ref _shapeInstanceHandle); InteractionC.RemoveShapeDescription(ref _scene, ref _shapeDescriptionHandle); base.Teardown(); }
/// <summary> /// Removes and destroys all descriptions from the internal scene. /// </summary> public void RemoveAllShapes() { foreach (var handle in _allHandles.Keys) { var localHandle = handle; InteractionC.RemoveShapeDescription(ref _scene, ref localHandle); } _allHandles.Clear(); _sphereDescMap.Clear(); _obbDescMap.Clear(); _meshDescMap.Clear(); }
/// <summary> /// Removes and destroys all descriptions from the internal scene. /// </summary> public void RemoveAllShapes() { for (var it = _allHandles.GetEnumerator(); it.MoveNext();) { var handle = it.Current.Key; var localHandle = handle; InteractionC.RemoveShapeDescription(ref _scene, ref localHandle); } _allHandles.Clear(); _sphereDescMap.Clear(); _obbDescMap.Clear(); _meshDescMap.Clear(); }
/// <summary> /// Returns a shape handle into the pool. /// </summary> public void ReturnShape(INTERACTION_SHAPE_DESCRIPTION_HANDLE handle) { ShapeInfo info; if (!_allHandles.TryGetValue(handle, out info)) { throw new InvalidOperationException("Tried to return a handle that was not allocated."); } if (!info.isCached) { _allHandles.Remove(handle); InteractionC.RemoveShapeDescription(ref _scene, ref handle); } }