Skip to content

Fixed Capsule collider generating incorrect dimensions#848

Open
Elevons wants to merge 4 commits intoBabylonJS:masterfrom
Elevons:master
Open

Fixed Capsule collider generating incorrect dimensions#848
Elevons wants to merge 4 commits intoBabylonJS:masterfrom
Elevons:master

Conversation

@Elevons
Copy link
Copy Markdown

@Elevons Elevons commented May 3, 2026

Capsule Collider was creating the a collider with the wrong dimensions, fixed it! :)


private _createCapsuleCollisionMesh(sourceMesh: AbstractMesh, boundingInfo: BoundingInfo): void {
const size = boundingInfo.boundingBox.maximum.subtract(boundingInfo.boundingSphere.minimum);
const size = boundingInfo.boundingBox.maximum.subtract(boundingInfo.boundingBox.minimum);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! I missed that part!
Replacing boundingBox by boundingSphere on both minumum and maximum did not do the trick?

{this._getCollisionType(this._collisionMesh, "lod", <GiMeshNetwork size={42} />)}
</div>
<>
<EditorInspectorSwitchField
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just ot understand, what is the purpose of it?

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

Successfully merging this pull request may close these issues.

2 participants