// Don't call remove reference on this, this shape is pooled public HkShape GetDebrisShape(MyModel model, HkShapeType shapeType) { MyModelShapeInfo info = new MyModelShapeInfo(); info.Model = model; info.ShapeType = shapeType; HkShape shape; if (!m_shapes.TryGetValue(info, out shape)) { shape = CreateShape(model, shapeType); m_shapes.Add(info, shape); } return(shape); }
public HkShape GetDebrisShape(MyModel model, HkShapeType shapeType, float scale) { HkShape shape; MyModelShapeInfo key = new MyModelShapeInfo { Model = model, ShapeType = shapeType, Scale = scale }; if (!this.m_shapes.TryGetValue(key, out shape)) { shape = this.CreateShape(model, shapeType, scale); this.m_shapes.TryAdd(key, shape); } return(shape); }
// Don't call remove reference on this, this shape is pooled public HkShape GetDebrisShape(MyModel model, HkShapeType shapeType) { MyModelShapeInfo info = new MyModelShapeInfo(); info.Model = model; info.ShapeType = shapeType; HkShape shape; if (!m_shapes.TryGetValue(info, out shape)) { shape = CreateShape(model, shapeType); m_shapes.Add(info, shape); } return shape; }