Template SDFCollisionErrorFunction on SDF collider type (#1400)#1400
Closed
cdtwigg wants to merge 1 commit into
Closed
Template SDFCollisionErrorFunction on SDF collider type (#1400)#1400cdtwigg wants to merge 1 commit into
cdtwigg wants to merge 1 commit into
Conversation
Contributor
|
@cdtwigg has exported this pull request. If you are a Meta employee, you can view the originating Diff in D105199128. |
meta-codesync Bot
pushed a commit
that referenced
this pull request
May 15, 2026
Summary: Add a second template parameter SdfColliderType to SDFCollisionErrorFunctionT, defaulting to SDFColliderT<float> for backward compatibility. This enables the collision error function to work with any collider type that provides the duck-typed interface (evaluate, evaluateWithGradient, bounds, parentJoint, localToParentTransform, update, isValid). Changes: - sdf_collision_geometry.h: Add wrapper methods to SDFColliderT (evaluate, evaluateWithGradient, bounds, parentJoint, localToParentTransform, update) that adapt it to the duck-typed interface - sdf_collision_error_function.h: Move template method definitions from .cpp to header (required for multi-parameter template instantiation). Replace all direct SDFColliderT member access with duck-typed interface calls - sdf_collision_error_function.cpp: Reduced to explicit instantiations only - gen_fwd_input.toml: Remove SDFCollisionErrorFunction (multi-param template cannot use gen_fwd; aliases are in the header) Backward compatibility is preserved: `using SDFCollisionErrorFunction = SDFCollisionErrorFunctionT<float>` uses the default SDFColliderT<float>. Reviewed By: cstollmeta Differential Revision: D105199128
940a26e to
dc3361d
Compare
meta-codesync Bot
pushed a commit
that referenced
this pull request
May 16, 2026
Summary: Add a second template parameter SdfColliderType to SDFCollisionErrorFunctionT, defaulting to SDFColliderT<float> for backward compatibility. This enables the collision error function to work with any collider type that provides the duck-typed interface (evaluate, evaluateWithGradient, bounds, parentJoint, localToParentTransform, update, isValid). Changes: - sdf_collision_geometry.h: Add wrapper methods to SDFColliderT (evaluate, evaluateWithGradient, bounds, parentJoint, localToParentTransform, update) that adapt it to the duck-typed interface - sdf_collision_error_function.h: Move template method definitions from .cpp to header (required for multi-parameter template instantiation). Replace all direct SDFColliderT member access with duck-typed interface calls - sdf_collision_error_function.cpp: Reduced to explicit instantiations only - gen_fwd_input.toml: Remove SDFCollisionErrorFunction (multi-param template cannot use gen_fwd; aliases are in the header) Backward compatibility is preserved: `using SDFCollisionErrorFunction = SDFCollisionErrorFunctionT<float>` uses the default SDFColliderT<float>. Reviewed By: cstollmeta Differential Revision: D105199128
dc3361d to
2148089
Compare
Summary: Add a second template parameter SdfColliderType to SDFCollisionErrorFunctionT, defaulting to SDFColliderT<float> for backward compatibility. This enables the collision error function to work with any collider type that provides the duck-typed interface (evaluate, evaluateWithGradient, bounds, parentJoint, localToParentTransform, update, isValid). Changes: - sdf_collision_geometry.h: Add wrapper methods to SDFColliderT (evaluate, evaluateWithGradient, bounds, parentJoint, localToParentTransform, update) that adapt it to the duck-typed interface - sdf_collision_error_function.h: Move template method definitions from .cpp to header (required for multi-parameter template instantiation). Replace all direct SDFColliderT member access with duck-typed interface calls - sdf_collision_error_function.cpp: Reduced to explicit instantiations only - gen_fwd_input.toml: Remove SDFCollisionErrorFunction (multi-param template cannot use gen_fwd; aliases are in the header) Backward compatibility is preserved: `using SDFCollisionErrorFunction = SDFCollisionErrorFunctionT<float>` uses the default SDFColliderT<float>. Reviewed By: cstollmeta Differential Revision: D105199128
2148089 to
99cf4f8
Compare
Contributor
|
This pull request has been merged in c45af0b. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Add a second template parameter SdfColliderType to SDFCollisionErrorFunctionT, defaulting to SDFColliderT for backward compatibility. This enables the collision error function to work with any collider type that provides the duck-typed interface (evaluate, evaluateWithGradient, bounds, parentJoint, localToParentTransform, update, isValid).
Changes:
Backward compatibility is preserved:
using SDFCollisionErrorFunction = SDFCollisionErrorFunctionT<float>uses the default SDFColliderT.Reviewed By: cstollmeta
Differential Revision: D105199128