-
-
Notifications
You must be signed in to change notification settings - Fork 964
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
feat: [Physics] Adding margins to convex hull colliders (Issue1577) #2257
feat: [Physics] Adding margins to convex hull colliders (Issue1577) #2257
Conversation
Added margin field to parent class ColliderShape, therefore all collider shapes can have access.
…llColliders_FeatureEnhancement
@dotnet-policy-service agree
|
/// The Margin of the generated convex hull. | ||
/// </userdoc> | ||
[DataMember(48)] | ||
public float Margin { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small note, it looks like margins in bullet by default should be around 0.04
for dynamic and 0.0
for static objects. Convex hulls are likely used as replacement for the lack of support of non-static meshes, so best set it to the default value for dynamics, so 0.04
by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, adding that now
Context: Margins in bullet by default should be around 0.04 for dynamic and 0.0 for static objects. Convex hulls are likely used as replacement for the lack of support of non-static meshes, so best set it to the default value for dynamics, so 0.04 by default.
…llColliders_FeatureEnhancement
Looks good, thanks a bunch ! |
PR Details
Allow specification of margin for collider shapes. Shows to be useful for ConvexHull colliders.
Description
Margin property now able to be set on ConvexHull collider shape. Added margin getter and setting vars onto ConvexHullColliderShape as well as the viewable field in the properties box for the user to adjust. The base class ColliderShape contains where margin is defined as recommened so all collider shapes can potentially benefit from the new variable.
Related Issue
Link to issue:
#1577
Link to initial discussion:
#1574
Motivation and Context
Originally reported as a missing field that solves an issue related to a test project not being able to adjust the corresponding collider. This margin not being able to be adjusted was causing unintended collisions and not allowing the user to be able to properly set up their ConvexHullCollider properties to fix the problem in the property box.
For additonal testing, I made a fork of the users orignal project that showcases the issue here:
https://github.com/dloe/StrideEngineIssue1577_RigidBodyPhysicsBugProject
Types of changes
Checklist