Skip to content
Permalink
Browse files

Merge pull request #289 from Eideren/bulletsharp_nuget

Update BulletSharp to latest version
  • Loading branch information
xen2 committed Jun 27, 2019
2 parents 0c0ed33 + 58e4e12 commit 5cee86cd3d8807c39446c07d0481348afd7c4131
Showing with 1,067 additions and 897 deletions.
  1. +2 −2 deps/BulletPhysics/Android/arm64-v8a/libbulletc.so
  2. +2 −2 deps/BulletPhysics/Android/armeabi-v7a/libbulletc.so
  3. +2 −2 deps/BulletPhysics/Android/x86/libbulletc.so
  4. +2 −2 deps/BulletPhysics/Android/x86_64/libbulletc.so
  5. +3 −0 deps/BulletPhysics/BulletSharp.NetStandard.dll
  6. 0 deps/BulletPhysics/{BulletSharp.dll.config → BulletSharp.NetStandard.dll.config}
  7. +2 −2 deps/BulletPhysics/Linux/libbulletc.so
  8. +13 −0 deps/BulletPhysics/README.md
  9. +2 −2 deps/BulletPhysics/UWP/ARM/libbulletc.dll
  10. +2 −2 deps/BulletPhysics/UWP/x64/libbulletc.dll
  11. +2 −2 deps/BulletPhysics/UWP/x86/libbulletc.dll
  12. +0 −3 deps/BulletPhysics/Windows/BulletSharp.dll
  13. +2 −2 deps/BulletPhysics/Windows/x64/libbulletc.dll
  14. +2 −2 deps/BulletPhysics/Windows/x86/libbulletc.dll
  15. +0 −40 deps/BulletPhysics/build.bat
  16. +1 −1 deps/BulletPhysics/checkout.bat
  17. +3 −0 deps/BulletPhysics/iOS/BulletSharp.NetStandard.dll
  18. +0 −3 deps/BulletPhysics/iOS/BulletSharp.dll
  19. +2 −2 deps/BulletPhysics/iOS/libbulletc.a
  20. +2 −2 deps/BulletPhysics/macOS/libbulletc.dylib
  21. +6 −6 deps/BulletPhysics/sign.bat
  22. +0 −1 sources/core/Xenko.Core.Mathematics/Vector3.cs
  23. +2 −1 sources/editor/Xenko.Assets.Presentation/AssetEditors/Gizmos/PhysicsGizmo.cs
  24. +63 −0 sources/editor/Xenko.Assets.Presentation/Properties/Resources.Designer.cs
  25. +18 −1 sources/engine/Xenko.Navigation/NavigationMeshBuilder.cs
  26. +1 −1 sources/engine/Xenko.Physics/ColliderShape.cs
  27. +2 −0 sources/engine/Xenko.Physics/ColliderShapeTypes.cs
  28. +4 −4 sources/engine/Xenko.Physics/Constraints/ConeTwistConstraint.cs
  29. +2 −2 sources/engine/Xenko.Physics/Constraints/HingeConstraint.cs
  30. +2 −2 sources/engine/Xenko.Physics/Constraints/Point2PointConstraint.cs
  31. +6 −6 sources/engine/Xenko.Physics/Constraints/RotationalLimitMotor.cs
  32. +1 −1 sources/engine/Xenko.Physics/Constraints/SliderConstraint.cs
  33. +6 −6 sources/engine/Xenko.Physics/Constraints/TranslationalLimitMotor.cs
  34. +5 −0 sources/engine/Xenko.Physics/Data/BoxColliderShapeDesc.cs
  35. +5 −0 sources/engine/Xenko.Physics/Data/CapsuleColliderShapeDesc.cs
  36. +15 −0 sources/engine/Xenko.Physics/Data/ColliderShapeAssetDesc.cs
  37. +5 −0 sources/engine/Xenko.Physics/Data/ConeColliderShapeDesc.cs
  38. +95 −0 sources/engine/Xenko.Physics/Data/ConvexHullColliderShapeDesc.cs
  39. +5 −0 sources/engine/Xenko.Physics/Data/CylinderColliderShapeDesc.cs
  40. +1 −0 sources/engine/Xenko.Physics/Data/IColliderShapeDesc.cs
  41. +5 −0 sources/engine/Xenko.Physics/Data/SphereColliderShapeDesc.cs
  42. +5 −0 sources/engine/Xenko.Physics/Data/StaticPlaneColliderShapeDesc.cs
  43. +17 −11 sources/engine/Xenko.Physics/Elements/CharacterComponent.cs
  44. +57 −50 sources/engine/Xenko.Physics/Elements/RigidbodyComponent.cs
  45. +3 −146 sources/engine/Xenko.Physics/Engine/PhysicsColliderShape.cs
  46. +96 −23 sources/engine/Xenko.Physics/Engine/PhysicsComponent.cs
  47. +2 −1 sources/engine/Xenko.Physics/Engine/PhysicsShapesRenderingService.cs
  48. +3 −0 sources/engine/Xenko.Physics/Shapes/BoxColliderShape.cs
  49. +8 −8 sources/engine/Xenko.Physics/Shapes/CapsuleColliderShape.cs
  50. +14 −7 sources/engine/Xenko.Physics/Shapes/ConeColliderShape.cs
  51. +13 −5 sources/engine/Xenko.Physics/Shapes/ConvexHullColliderShape.cs
  52. +13 −9 sources/engine/Xenko.Physics/Shapes/CylinderColliderShape.cs
  53. +5 −15 sources/engine/Xenko.Physics/Shapes/HeightfieldColliderShape.cs
  54. +6 −3 sources/engine/Xenko.Physics/Shapes/SphereColliderShape.cs
  55. +103 −0 sources/engine/Xenko.Physics/Shapes/StaticMeshColliderShape.cs
  56. +9 −4 sources/engine/Xenko.Physics/Shapes/StaticPlaneColliderShape.cs
  57. +409 −462 sources/engine/Xenko.Physics/Simulation.cs
  58. +5 −12 sources/engine/Xenko.Physics/Xenko.Physics.csproj
  59. +0 −39 sources/engine/Xenko.Physics/XenkoMotionState.cs
  60. +3 −0 sources/tools/Xenko.Importer.Assimp/Xenko.Importer.Assimp.vcxproj
  61. +3 −0 sources/tools/Xenko.Importer.FBX/Xenko.Importer.FBX.vcxproj
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
File renamed without changes.
Git LFS file not shown
@@ -0,0 +1,13 @@
## BulletPhysics

This folder houses bullet, the physics engine used by `Xenko.Physics` assembly.

* `libbulletc.*` is the bullet c++ library, we should have one lib compiled for each platform and architecture.

* `BulletSharp.NetStandard.dll` is the C# wrapper around that c++ library, there's one dll for iOS (within /iOS) and the other for any other platform. Take a look at https://xamarin.github.io/bugzilla-archives/24/24943/bug.html for more info about the reason as to why we have to make a specific dll for iOS.

### Sources

The sources, build scripts and instructions are hosted over at https://github.com/xenko3d/BulletSharpPInvoke

At the time of writing this (26/June/19), the files in this folder were built under commit [2a79f9af9c3fcc61aaad69a9a24e6b1f7246f758](https://github.com/xenko3d/BulletSharpPInvoke/commit/2a79f9af9c3fcc61aaad69a9a24e6b1f7246f758), changes were merged with xenko through [PR#289](https://github.com/xenko3d/xenko/pull/289).
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown

This file was deleted.

Git LFS file not shown
Git LFS file not shown

This file was deleted.

@@ -6,5 +6,5 @@ IF NOT ERRORLEVEL 0 (
ECHO "Could not find git.exe"
EXIT /B %ERRORLEVEL%
)
%GIT_CMD% clone git@github.com:xenko3d/bullet2-sharp-mobile.git ../../externals/bullet2-sharp-mobile
%GIT_CMD% clone git@github.com:Eideren/BulletSharpPInvoke.git ../../externals/BulletSharpPInvoke
if NOT ERRORLEVEL 0 pause
Git LFS file not shown

This file was deleted.

Git LFS file not shown
Git LFS file not shown
@@ -1,12 +1,12 @@
call "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\vc\vcvarsall.bat" x86

ildasm /all /out:Windows\BulletSharp.il Windows\BulletSharp.dll
ildasm /all /out:iOS\BulletSharp.il iOS\BulletSharp.dll
ildasm /all /out:BulletSharp.NetStandard.il BulletSharp.NetStandard.dll
ildasm /all /out:iOS\BulletSharp.NetStandard.il iOS\BulletSharp.NetStandard.dll

@echo "Please patch Windows\BulletSharp.il and iOS\BulletSharp.il Xenko.Core.Mathematics reference with .publickeytoken = ( BA CA CC 89 C3 B6 D5 56 )"
@echo "Please patch BulletSharp.NetStandard.il and iOS\BulletSharp.NetStandard.il Xenko.Core.Mathematics reference with .publickeytoken = ( BA CA CC 89 C3 B6 D5 56 )"
pause

mkdir Windows\Signed
mkdir Signed
mkdir iOS\Signed
ilasm /dll /key:..\..\build\paradox.snk /output:Windows\Signed\BulletSharp.dll Windows\BulletSharp.il
ilasm /dll /key:..\..\build\paradox.snk /output:iOS\Signed\BulletSharp.dll iOS\BulletSharp.il
ilasm /dll /key:..\..\build\xenko.public.snk /output:Signed\BulletSharp.NetStandard.dll BulletSharp.NetStandard.il
ilasm /dll /key:..\..\build\xenko.public.snk /output:iOS\Signed\BulletSharp.NetStandard.dll iOS\BulletSharp.NetStandard.il
@@ -27,7 +27,6 @@
* THE SOFTWARE.
*/
using System;
using System.ComponentModel;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
@@ -11,6 +11,7 @@
using Xenko.Graphics;
using Xenko.Physics;
using Xenko.Rendering;
using Xenko.Core.Assets;

namespace Xenko.Assets.Presentation.AssetEditors.Gizmos
{
@@ -107,7 +108,7 @@ private static List<IInlineColliderShapeDesc> CloneDescs(IEnumerable<IInlineColl
}
else
{
var cloned = desc.DeepClone();
var cloned = AssetCloner.Clone(desc, AssetClonerFlags.KeepReferences);
res.Add(cloned);
}
}

Some generated files are not rendered by default. Learn more.

@@ -544,7 +544,7 @@ private void BuildInput(StaticColliderData[] collidersLocal, CollisionFilterGrou

// Convert hull indices to int
int[] indices = new int[hull.Indices.Count];
if (hull.Indices.Count % 3 != 0) throw new InvalidOperationException("Physics hull does not consist of triangles");
if (hull.Indices.Count % 3 != 0) throw new InvalidOperationException($"{shapeType} does not consist of triangles");
for (int i = 0; i < hull.Indices.Count; i += 3)
{
indices[i] = (int)hull.Indices[i];
@@ -554,6 +554,23 @@ private void BuildInput(StaticColliderData[] collidersLocal, CollisionFilterGrou

entityNavigationMeshInputBuilder.AppendArrays(hull.Points.ToArray(), indices, transform);
}
else if (shapeType == typeof(StaticMeshColliderShape))
{
var mesh = (StaticMeshColliderShape)shape;
Matrix transform = mesh.PositiveCenterMatrix * entityWorldMatrix;

// Convert hull indices to int
int[] indices = new int[mesh.Indices.Count];
if (mesh.Indices.Count % 3 != 0) throw new InvalidOperationException($"{shapeType} does not consist of triangles");
for (int i = 0; i < mesh.Indices.Count; i += 3)
{
indices[i] = (int)mesh.Indices[i];
indices[i + 2] = (int)mesh.Indices[i + 1]; // NOTE: Reversed winding to create left handed input
indices[i + 1] = (int)mesh.Indices[i + 2];
}

entityNavigationMeshInputBuilder.AppendArrays(mesh.Vertices.ToArray(), indices, transform);
}
else if (shapeType == typeof(CompoundColliderShape))
{
// Unroll compound collider shapes
@@ -68,7 +68,7 @@ public virtual void UpdateLocalTransformations()
/// </value>
public Matrix NegativeCenterMatrix;

protected Vector3 cachedScaling;
protected Vector3 cachedScaling = Vector3.One;

/// <summary>
/// Gets or sets the scaling.
@@ -31,6 +31,8 @@ public enum ColliderShapeTypes

StaticPlane,

StaticMesh,

Cone,

Heightfield,
@@ -139,7 +139,7 @@ public void SetLimit(float swingSpan1, float swingSpan2, float twistSpan, float
/// <param name="angularOnly">if set to <c>true</c> [angular only].</param>
public void SetAngularOnly(bool angularOnly)
{
InternalConeTwistConstraint.SetAngularOnly(angularOnly);
InternalConeTwistConstraint.AngularOnly = angularOnly;
}

/// <summary>
@@ -148,7 +148,7 @@ public void SetAngularOnly(bool angularOnly)
/// <param name="damping">The damping.</param>
public void SetDamping(float damping)
{
InternalConeTwistConstraint.SetDamping(damping);
InternalConeTwistConstraint.Damping = damping;
}

/// <summary>
@@ -166,7 +166,7 @@ public void EnableMotor(bool b)
/// <param name="maxMotorImpulse">The maximum motor impulse.</param>
public void SetMaxMotorImpulse(float maxMotorImpulse)
{
InternalConeTwistConstraint.SetMaxMotorImpulse(maxMotorImpulse);
InternalConeTwistConstraint.MaxMotorImpulse = maxMotorImpulse;
}

/// <summary>
@@ -184,7 +184,7 @@ public void SetMaxMotorImpulseNormalized(float maxMotorImpulse)
/// <param name="q">The q.</param>
public void SetMotorTarget(Quaternion q)
{
InternalConeTwistConstraint.SetMotorTarget(q);
InternalConeTwistConstraint.MotorTarget = q;
}

/// <summary>
@@ -60,7 +60,7 @@ public float MaxMotorImpulse
/// </value>
public float MotorTargetVelocity
{
get { return InternalHingeConstraint.MotorTargetVelosity; }
get { return InternalHingeConstraint.MotorTargetVelocity; }
}

/// <summary>
@@ -170,7 +170,7 @@ public void EnableAngularMotor(bool enableMotor, float targetVelocity, float max
/// <param name="enableMotor">if set to <c>true</c> [enable motor].</param>
public void EnableMotor(bool enableMotor)
{
InternalHingeConstraint.EnableMotor(enableMotor);
InternalHingeConstraint.EnableMotor = enableMotor;
}

/// <summary>
@@ -16,7 +16,7 @@ public class Point2PointConstraint : Constraint
public Vector3 PivotInA
{
get { return InternalPoint2PointConstraint.PivotInA; }
set { InternalPoint2PointConstraint.SetPivotA(value); }
set { InternalPoint2PointConstraint.PivotInA = value; }
}

/// <summary>
@@ -28,7 +28,7 @@ public Vector3 PivotInA
public Vector3 PivotInB
{
get { return InternalPoint2PointConstraint.PivotInB; }
set { InternalPoint2PointConstraint.SetPivotB(value); }
set { InternalPoint2PointConstraint.PivotInB = value; }
}

/// <summary>

0 comments on commit 5cee86c

Please sign in to comment.
You can’t perform that action at this time.