Stride: PhysicsComponent.UpdatePhysicsTransformation() adds extra offset to physics debug model

Created on 24 Feb 2019  路  1Comment  路  Source: stride3d/stride

Release Type: Official Release

Version: 3.0.0.8 / 3.1.0.1-beta01-0441

Platform(s): Windows

Describe the bug
PhysicsComponent.UpdatePhysicsTransformation() adds extra offset to physics debug model when ColliderShape.LocalOffset is not 0.
That seems not to happen when a StaticColliderComponent gets CompoundColliderShape.

To Reproduce
Steps to reproduce the behavior:

  1. Create new game project.
  2. Add a StaticColliderComponent to the Sphere entity and add a sphere collider to it.
  3. Set the sphere collider's LocalOffset to X=1 Y=0 Z=0.
  4. Add a SyncScript like this.
    public class TestScript : SyncScript
    {
        public override void Start()
        {
        }

        public override void Update()
        {
            DebugText.Print(
            $"Sphere: {Entity.Transform.WorldMatrix.TranslationVector.ToString()}" + Environment.NewLine +
            $"Sphere Collider: {Entity.Get<StaticColliderComponent>().PhysicsWorldTransform.TranslationVector.ToString()}" + Environment.NewLine +
            $"Debug Entity: {Entity.Get<StaticColliderComponent>().DebugEntity?.Transform.WorldMatrix.TranslationVector.ToString()}" + Environment.NewLine +
            $"Debug Entity Child: {Entity.Get<StaticColliderComponent>().DebugEntity?.GetChild(0)?.Transform.WorldMatrix.TranslationVector.ToString()}",
            new Int2(10));
            if (Input.IsKeyPressed(Keys.Space))
            {
                Entity.Get<StaticColliderComponent>().UpdatePhysicsTransformation();
            }
        }
    }
  1. Add it to the Sphere entity.
  2. Add DebugPhysicsShapes asset and add it to the Sphere entity.
  3. Run the game.
  4. Press Ctrl + Shift + P keys.
  5. Press space key.

Expected behavior
Nothing happens when you press space key.

Screenshots
Step 8.
update00

Step 9.
update01

Log and callstacks

Additional context

area-Physics bug help wanted

Most helpful comment

I'm planning to step up and contribute on the engine, though... still intimidated. Wanted to grab this issue as my first to look at.

>All comments

I'm planning to step up and contribute on the engine, though... still intimidated. Wanted to grab this issue as my first to look at.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

domske picture domske  路  4Comments

EternalTamago picture EternalTamago  路  3Comments

Qibbi picture Qibbi  路  4Comments

Eideren picture Eideren  路  3Comments

xen2 picture xen2  路  4Comments