Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] A way to clear mCachedResult in Shape Settings #955

Closed
cykoder opened this issue Mar 5, 2024 · 1 comment
Closed

[Feature request] A way to clear mCachedResult in Shape Settings #955

cykoder opened this issue Mar 5, 2024 · 1 comment

Comments

@cykoder
Copy link

cykoder commented Mar 5, 2024

I had a use case where I was trying to do create a shape instance, detect error and sanitize only if there is an error (childShape is a MeshShapeSettings instance):

        auto createdRef = childShape->Create();
        if (createdRef.HasError())
        {
            // Remove degenerate and duplicate triangles, then try again
            childShape->Sanitize();

            createdRef = childShape->Create();
            if (createdRef.HasError()) // still has error from cached result
            {
                return;
            }
        }

I can't see a way in the API to clear mCachedResult so that this is possible. This is because in my use case, most meshes have no error, but the few that do should be sanitized. I figured it'd be better performance to not require sanitize before create each time.

@jrouwe jrouwe closed this as completed in b8012e1 Mar 5, 2024
@jrouwe
Copy link
Owner

jrouwe commented Mar 5, 2024

I've added Shape::ClearCachedShape.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants