From 76827af073a54a0648d3a8a75ef793ee4511ebf5 Mon Sep 17 00:00:00 2001 From: Phr00t Date: Wed, 29 Jan 2020 11:09:14 -0500 Subject: [PATCH] Physics: fix collider mesh generation helper function --- sources/engine/Xenko.Physics/Bepu/BepuHelpers.cs | 4 ++-- sources/engine/Xenko.Physics/Bepu/BepuRigidbodyComponent.cs | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sources/engine/Xenko.Physics/Bepu/BepuHelpers.cs b/sources/engine/Xenko.Physics/Bepu/BepuHelpers.cs index 34bd5f934f..341ad58115 100644 --- a/sources/engine/Xenko.Physics/Bepu/BepuHelpers.cs +++ b/sources/engine/Xenko.Physics/Bepu/BepuHelpers.cs @@ -330,7 +330,7 @@ private static unsafe bool getMeshOutputs(Xenko.Rendering.Mesh modelMesh, out Li for (var k = 0; k < numIndices; k++) { // Offset indices - indicies[k] = (int)dst[k]; + indicies.Add((int)dst[k]); } } else @@ -342,7 +342,7 @@ private static unsafe bool getMeshOutputs(Xenko.Rendering.Mesh modelMesh, out Li for (var k = 0; k < numIndices; k++) { // Offset indices - indicies[k] = dst[k]; + indicies.Add(dst[k]); } } } diff --git a/sources/engine/Xenko.Physics/Bepu/BepuRigidbodyComponent.cs b/sources/engine/Xenko.Physics/Bepu/BepuRigidbodyComponent.cs index c1eb54166e..8a8cceb020 100644 --- a/sources/engine/Xenko.Physics/Bepu/BepuRigidbodyComponent.cs +++ b/sources/engine/Xenko.Physics/Bepu/BepuRigidbodyComponent.cs @@ -553,7 +553,10 @@ public override Xenko.Core.Mathematics.Quaternion Rotation } set { - if (bodyDescription.Pose.Orientation == BepuHelpers.ToBepu(value)) return; + if (bodyDescription.Pose.Orientation.X == value.X && + bodyDescription.Pose.Orientation.Y == value.Y && + bodyDescription.Pose.Orientation.Z == value.Z && + bodyDescription.Pose.Orientation.W == value.W) return; bodyDescription.Pose.Orientation.X = value.X; bodyDescription.Pose.Orientation.Y = value.Y;