defold / defold/defold

physics.get_shape() returns the wrong size when physics.scale is set to less than 1.0 in 3D

Open
#11,636 1 comment 0 reactions 0 assignees View on GitHub
bug bullet3d engine physics
Dominant language
C++
Stars
6.3k
Forks
455
Avg merge
2d 2h
Merged PRs (30d)
129

Description

**Describe the bug (REQUIRED)**
When using 3D physics, the diameter (sphere), dimensions (box) or diameter and height (capsule) are wrong when physics.scale is set to less than 1.0.

**To Reproduce (REQUIRED)**

1. Set physics.scale to something smaller than 1.0, for example 0.1.
2. Use physics.get_shape() on any 3D shape
3. The size returned is multiplied by physics.scale.

**Expected behavior (REQUIRED)**
The actual size should be returned, like it is in 2D, regardless of physics.scale setting.

**Defold version (REQUIRED):**
Image

**Platforms (REQUIRED):**
macOS

**Minimal repro case project (OPTIONAL):**
[DiameterBug.zip](https://github.com/user-attachments/files/24254613/DiameterBug.zip)

**Workaround (OPTIONAL):**
Divide the size by physics.scale when using 3D physics.

**Additional context (OPTIONAL):**
Add any other context about the problem here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.