You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Bullet allows specifying a margin for colliders which can be especially useful in case of ConvexHull. Reported as missing by @mathmb1986 in #1574
var subHull = new ConvexHullColliderShape(verts, indices, Scaling);
+ subHull.Margin = Margin;
L136
var subHull = new ConvexHullColliderShape(verts[0], indices[0], Scaling);
+ subHull.Margin = Margin;
L151
var subHull = new ConvexHullColliderShape(subVerts, subIndex, Scaling);
+ subHull.Margin = Margin;
A closer look should be placed on application of margin to all subHull components to see if this makes sense. Also, maybe it would make more sense to add Margin property on the base class ColliderShape - which is where Margin is defined in Bullet - this way all collider shapes could benefit.
The text was updated successfully, but these errors were encountered:
Hi, as a newcomer to the engine I was wondering if this issue is being worked on by anyone. If not, I would like to try this issue to get more familiar with the code base.
Thanks!
I'd say go for it if you want to learn the engine it will be very usefull info. AFAIK no one is working on new features for Bullet specifically right now, @Eideren, @Nicogo1705 and I are doing some unrelated work with Bepu in this PR since the future goal is to move on to Bepu but there is still a lot of work to do before that happens.
dloe
added a commit
to dloe/stride_fork
that referenced
this issue
May 20, 2024
* Added margin fields to ConvexHullCollider (#1577)
Added margin field to parent class ColliderShape, therefore all collider shapes can have access.
* Added default for margin to be 0.04f
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.
Is your feature request related to a problem? Please describe.
Bullet allows specifying a margin for colliders which can be especially useful in case of ConvexHull. Reported as missing by @mathmb1986 in #1574
Suggested code changes in the thread mentioned above:
https://github.com/stride3d/stride/blob/master/sources/engine/Stride.Assets/Physics/ColliderShapeAssetCompiler.cs
L135
ConvexHullColliderShapeDesc convexHullDescClone = new ConvexHullColliderShapeDesc { Scaling = convexHullDesc.Scaling, + Margin = convexHullDesc.Margin, LocalOffset = convexHullDesc.LocalOffset, LocalRotation = convexHullDesc.LocalRotation, Decomposition = convexHullDesc.Decomposition, };
https://github.com/stride3d/stride/blob/master/sources/engine/Stride.Physics/Shapes/ConvexHullColliderShape.cs
L40
https://github.com/stride3d/stride/blob/master/sources/engine/Stride.Physics/Data/ConvexHullColliderShapeDesc.cs
L51
L84
shape = new ConvexHullColliderShape(ConvexHulls[0][0], ConvexHullsIndices[0][0], Scaling) { NeedsCustomCollisionCallback = true, + Margin = Margin, };
L109
var subHull = new ConvexHullColliderShape(verts, indices, Scaling); + subHull.Margin = Margin;
L136
var subHull = new ConvexHullColliderShape(verts[0], indices[0], Scaling); + subHull.Margin = Margin;
L151
var subHull = new ConvexHullColliderShape(subVerts, subIndex, Scaling); + subHull.Margin = Margin;
A closer look should be placed on application of margin to all
subHull
components to see if this makes sense. Also, maybe it would make more sense to addMargin
property on the base classColliderShape
- which is where Margin is defined in Bullet - this way all collider shapes could benefit.The text was updated successfully, but these errors were encountered: