Skip to content

Provide a generic overload for IShapeF #705

@LokiMidgard

Description

@LokiMidgard

Since IShapeF is an interface which is implemented by structs, those will get boxed that allocates and can trigger garbage collection.

providing an overload can prevent this. E.g. in the Shape class.

public static bool Intersects<TShapeA, TShapeB>(this TShape shapeA, TShape shapeB)
where TShape: struct, IShapeF
{
}

One could get a step further and obsolete the methods that take the interface and provide information why they should not be used.

If interested in this, I could look into and make pull requests for those changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImprovement to an existing feature: better defaults, expanded support, or quality-of-lifescope: apiPublic API surface: types, signatures, properties, interfaces, or serialization contractsscope: physicsCollisions subsystem: broadphase/narrowphase detection, spatial queries, collision layers

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions