Skip to content

Commit 55b164c

Browse files
authored
Merge pull request #201 from VaclavElias/chore-upgrade-examples-to-bepu-2
refactor: Upgrade examples to Bepu
2 parents 8f68cd7 + 12196aa commit 55b164c

File tree

57 files changed

+1407
-200
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1407
-200
lines changed

Stride.CommunityToolkit.sln

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Physics_Example001", "examp
6767
EndProject
6868
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example09_Renderer", "examples\code-only\Example09_Renderer\Example09_Renderer.csproj", "{5996C17E-629C-4F58-88F9-494559EB4FBF}"
6969
EndProject
70-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example10_StrideUI_DragAndDrop", "examples\code-only\Example10_StrideUI_DragAndDrop\Example10_StrideUI_DragAndDrop.csproj", "{2D37B4BA-50F7-4347-8DC0-FA58C2AC2803}"
71-
EndProject
7270
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stride.CommunityToolkit.ImGui", "src\Stride.CommunityToolkit.ImGui\Stride.CommunityToolkit.ImGui.csproj", "{43BB82C0-78B8-4DE9-8F14-0664973CCB7B}"
7371
EndProject
7472
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example11_ImGui", "examples\code-only\Example11_ImGui\Example11_ImGui.csproj", "{EE31DB88-2FE2-45ED-B80F-76F0C1CB2008}"
@@ -85,6 +83,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example01_Basic3DScene_Bull
8583
EndProject
8684
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stride.CommunityToolkit.DebugShapes", "src\Stride.CommunityToolkit.DebugShapes\Stride.CommunityToolkit.DebugShapes.csproj", "{11BB58D0-9592-424C-B9C9-71D545BFABBB}"
8785
EndProject
86+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example10_StrideUI_DragAndDrop", "examples\code-only\Example10_StrideUI_DragAndDrop\Example10_StrideUI_DragAndDrop.csproj", "{BD3BA6F3-9BE4-4EA7-B496-847AEDB6F3C1}"
87+
EndProject
88+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example10_StrideUI_DragAndDrop_BulletPhysics", "examples\code-only\Example10_StrideUI_DragAndDrop_BulletPhysics\Example10_StrideUI_DragAndDrop_BulletPhysics.csproj", "{A8DBD6E0-47F3-4CAC-A5F9-DA6E4AB78726}"
89+
EndProject
90+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example14_Raycast", "examples\code-only\Example14_Raycast\Example14_Raycast.csproj", "{B442A84F-737B-45CC-B2DE-89495E2FDDBC}"
91+
EndProject
92+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example15_Constraint", "examples\code-only\Example15_Constraint\Example15_Constraint.csproj", "{490BB399-8A47-43C7-9D8C-7D7DF900CB50}"
93+
EndProject
8894
Global
8995
GlobalSection(SolutionConfigurationPlatforms) = preSolution
9096
Debug|Any CPU = Debug|Any CPU
@@ -190,10 +196,6 @@ Global
190196
{5996C17E-629C-4F58-88F9-494559EB4FBF}.Debug|Any CPU.Build.0 = Debug|Any CPU
191197
{5996C17E-629C-4F58-88F9-494559EB4FBF}.Release|Any CPU.ActiveCfg = Release|Any CPU
192198
{5996C17E-629C-4F58-88F9-494559EB4FBF}.Release|Any CPU.Build.0 = Release|Any CPU
193-
{2D37B4BA-50F7-4347-8DC0-FA58C2AC2803}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
194-
{2D37B4BA-50F7-4347-8DC0-FA58C2AC2803}.Debug|Any CPU.Build.0 = Debug|Any CPU
195-
{2D37B4BA-50F7-4347-8DC0-FA58C2AC2803}.Release|Any CPU.ActiveCfg = Release|Any CPU
196-
{2D37B4BA-50F7-4347-8DC0-FA58C2AC2803}.Release|Any CPU.Build.0 = Release|Any CPU
197199
{43BB82C0-78B8-4DE9-8F14-0664973CCB7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
198200
{43BB82C0-78B8-4DE9-8F14-0664973CCB7B}.Debug|Any CPU.Build.0 = Debug|Any CPU
199201
{43BB82C0-78B8-4DE9-8F14-0664973CCB7B}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -226,6 +228,22 @@ Global
226228
{11BB58D0-9592-424C-B9C9-71D545BFABBB}.Debug|Any CPU.Build.0 = Debug|Any CPU
227229
{11BB58D0-9592-424C-B9C9-71D545BFABBB}.Release|Any CPU.ActiveCfg = Release|Any CPU
228230
{11BB58D0-9592-424C-B9C9-71D545BFABBB}.Release|Any CPU.Build.0 = Release|Any CPU
231+
{BD3BA6F3-9BE4-4EA7-B496-847AEDB6F3C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
232+
{BD3BA6F3-9BE4-4EA7-B496-847AEDB6F3C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
233+
{BD3BA6F3-9BE4-4EA7-B496-847AEDB6F3C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
234+
{BD3BA6F3-9BE4-4EA7-B496-847AEDB6F3C1}.Release|Any CPU.Build.0 = Release|Any CPU
235+
{A8DBD6E0-47F3-4CAC-A5F9-DA6E4AB78726}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
236+
{A8DBD6E0-47F3-4CAC-A5F9-DA6E4AB78726}.Debug|Any CPU.Build.0 = Debug|Any CPU
237+
{A8DBD6E0-47F3-4CAC-A5F9-DA6E4AB78726}.Release|Any CPU.ActiveCfg = Release|Any CPU
238+
{A8DBD6E0-47F3-4CAC-A5F9-DA6E4AB78726}.Release|Any CPU.Build.0 = Release|Any CPU
239+
{B442A84F-737B-45CC-B2DE-89495E2FDDBC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
240+
{B442A84F-737B-45CC-B2DE-89495E2FDDBC}.Debug|Any CPU.Build.0 = Debug|Any CPU
241+
{B442A84F-737B-45CC-B2DE-89495E2FDDBC}.Release|Any CPU.ActiveCfg = Release|Any CPU
242+
{B442A84F-737B-45CC-B2DE-89495E2FDDBC}.Release|Any CPU.Build.0 = Release|Any CPU
243+
{490BB399-8A47-43C7-9D8C-7D7DF900CB50}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
244+
{490BB399-8A47-43C7-9D8C-7D7DF900CB50}.Debug|Any CPU.Build.0 = Debug|Any CPU
245+
{490BB399-8A47-43C7-9D8C-7D7DF900CB50}.Release|Any CPU.ActiveCfg = Release|Any CPU
246+
{490BB399-8A47-43C7-9D8C-7D7DF900CB50}.Release|Any CPU.Build.0 = Release|Any CPU
229247
EndGlobalSection
230248
GlobalSection(SolutionProperties) = preSolution
231249
HideSolutionNode = FALSE
@@ -250,11 +268,14 @@ Global
250268
{991716B1-BECA-4D4F-9438-1CC1686962AC} = {A9C673A6-1426-40DD-A060-B0749261DB7C}
251269
{DE8458AC-2F74-428E-808F-C39EA986D110} = {A9C673A6-1426-40DD-A060-B0749261DB7C}
252270
{5996C17E-629C-4F58-88F9-494559EB4FBF} = {30457B66-9E10-4290-9744-D0079DE0448B}
253-
{2D37B4BA-50F7-4347-8DC0-FA58C2AC2803} = {30457B66-9E10-4290-9744-D0079DE0448B}
254271
{EE31DB88-2FE2-45ED-B80F-76F0C1CB2008} = {30457B66-9E10-4290-9744-D0079DE0448B}
255272
{8821704B-5698-4C9A-B05F-C18B7122DD8B} = {30457B66-9E10-4290-9744-D0079DE0448B}
256273
{E8FA4D0B-D5B3-48B4-AFB5-CEF86BFF88BC} = {30457B66-9E10-4290-9744-D0079DE0448B}
257274
{F55B9EC1-1C44-4CFD-B151-F0F05DEB43EA} = {30457B66-9E10-4290-9744-D0079DE0448B}
275+
{BD3BA6F3-9BE4-4EA7-B496-847AEDB6F3C1} = {30457B66-9E10-4290-9744-D0079DE0448B}
276+
{A8DBD6E0-47F3-4CAC-A5F9-DA6E4AB78726} = {30457B66-9E10-4290-9744-D0079DE0448B}
277+
{B442A84F-737B-45CC-B2DE-89495E2FDDBC} = {30457B66-9E10-4290-9744-D0079DE0448B}
278+
{490BB399-8A47-43C7-9D8C-7D7DF900CB50} = {30457B66-9E10-4290-9744-D0079DE0448B}
258279
EndGlobalSection
259280
GlobalSection(ExtensibilityGlobals) = postSolution
260281
SolutionGuid = {C7A8C18E-C1F5-492F-8173-51EC9495B78C}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Contribute Examples
2+
3+
You can see all examples in the [examples](https://github.com/stride3d/stride-community-toolkit/tree/main/examples/code-only) folder.
4+
5+
If you would like your example be launchable from the console application, you can add it to the `Stride.CommunityToolkit.Examples` project which you can find here: [Stride.CommunityToolkit.Examples](https://github.com/stride3d/stride-community-toolkit/tree/main/src/Stride.CommunityToolkit.Examples).
6+
7+
1. Make sure you create an anchor class named `NamespaceAnchor.cs` if your example contains only `Programs.cs`, so the namespace can be accessible from `Stride.CommunityToolkit.Examples`.
8+
```csharp
9+
namespace ExampleXY_YourExampleNamespace;
10+
11+
/// <summary>
12+
/// This empty class is here to make the namespace available in the nameof() operator in the main examples project.
13+
/// </summary>
14+
internal static class NamespaceAnchor;
15+
```
16+
1. Add your example project to `Stride.CommunityToolkit.Examples` project.
17+
1. Update `Providers/ExampleProvider.cs`
18+
1. Run `Stride.CommunityToolkit.Examples`
19+
1. You should see your example listed in the console application.
20+
```
21+
Stride Community Toolkit Examples
22+
23+
[1] Basic Example - Capsule with rigid body
24+
[2] Basic Example - Capsule with rigid body in F#
25+
[3] Basic Example - Capsule with rigid body in Visual Basic
26+
[4] Basic Example - Give me a cube
27+
[5] Basic Example - Stride UI - Canvas - Capsule with rigid body and Window
28+
[6] Basic Example - Stride UI - Grid - Save and load game state
29+
[7] Basic Example - Procedural Geometry
30+
[8] Basic Example - Particles
31+
[9] Advance Example - Myra UI - Draggable Window, GetService()
32+
[10] Advance Example - Image Processing
33+
[11] Advance Example - Root Renderer Shader
34+
[12] Other - CubeClicker
35+
[13] Other - Debug Shapes
36+
[14] Other - Renderer
37+
[Q] Quit
38+
39+
Enter choice and press ENTER to continue
40+
```
41+
1. Update the `Stride.CommunityToolkit.Docs/includes/manual/examples/basic-examples-outro.md` file with the new example.

docs/contributing/toc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ items:
1818
items:
1919
- name: New library project
2020
href: toolkit/library-project.md
21+
- name: 💡Contribute to the examples
22+
expanded: false
23+
href: examples/index.md
2124
- name: 📖 Contribute to the documentation
2225
expanded: false
2326
href: documentation/index.md

docs/includes/manual/examples/basic-examples-outro.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,14 @@ Stride Community Toolkit Examples
1414
[5] Basic Example - Stride UI - Canvas - Capsule with rigid body and Window
1515
[6] Basic Example - Stride UI - Grid - Save and load game state
1616
[7] Basic Example - Procedural Geometry
17-
[8] Advance Example - Myra UI - Draggable Window, GetService()
18-
[9] Advance Example - Image Processing
17+
[8] Basic Example - Particles
18+
[9] Advance Example - Myra UI - Draggable Window, GetService()
19+
[10] Advance Example - Stride UI - Draggable Window
20+
[11] Advance Example - Image Processing
21+
[12] Advance Example - Root Renderer Shader
22+
[13] Other - CubeClicker
23+
[14] Other - Debug Shapes
24+
[15] Other - Renderer
1925
[Q] Quit
2026
2127
Enter choice and press ENTER to continue

examples/code-only/Example02_GiveMeACube/Example02_GiveMeACube.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<ProjectReference Include="..\..\..\src\Stride.CommunityToolkit.Bullet\Stride.CommunityToolkit.Bullet.csproj" />
11+
<ProjectReference Include="..\..\..\src\Stride.CommunityToolkit.Bepu\Stride.CommunityToolkit.Bepu.csproj" />
1212
<ProjectReference Include="..\..\..\src\Stride.CommunityToolkit.Skyboxes\Stride.CommunityToolkit.Skyboxes.csproj" />
1313
<ProjectReference Include="..\..\..\src\Stride.CommunityToolkit.Windows\Stride.CommunityToolkit.Windows.csproj" />
1414
</ItemGroup>

examples/code-only/Example02_GiveMeACube/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Stride.CommunityToolkit.Bullet;
1+
using Stride.CommunityToolkit.Bepu;
22
using Stride.CommunityToolkit.Engine;
33
using Stride.CommunityToolkit.Rendering.ProceduralModels;
44
using Stride.CommunityToolkit.Skyboxes;

examples/code-only/Example03_StrideUI_CapsuleAndWindow/Example03_StrideUI_CapsuleAndWindow.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<ProjectReference Include="..\..\..\src\Stride.CommunityToolkit.Bullet\Stride.CommunityToolkit.Bullet.csproj" />
11+
<ProjectReference Include="..\..\..\src\Stride.CommunityToolkit.Bepu\Stride.CommunityToolkit.Bepu.csproj" />
1212
<ProjectReference Include="..\..\..\src\Stride.CommunityToolkit.Skyboxes\Stride.CommunityToolkit.Skyboxes.csproj" />
1313
<ProjectReference Include="..\..\..\src\Stride.CommunityToolkit.Windows\Stride.CommunityToolkit.Windows.csproj" />
1414
</ItemGroup>

examples/code-only/Example03_StrideUI_CapsuleAndWindow/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Stride.CommunityToolkit.Bullet;
1+
using Stride.CommunityToolkit.Bepu;
22
using Stride.CommunityToolkit.Engine;
33
using Stride.CommunityToolkit.Rendering.ProceduralModels;
44
using Stride.CommunityToolkit.Skyboxes;

examples/code-only/Example04_MyraUI/Example04_MyraUI.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<ProjectReference Include="..\..\..\src\Stride.CommunityToolkit.Bullet\Stride.CommunityToolkit.Bullet.csproj" />
11+
<ProjectReference Include="..\..\..\src\Stride.CommunityToolkit.Bepu\Stride.CommunityToolkit.Bepu.csproj" />
1212
<ProjectReference Include="..\..\..\src\Stride.CommunityToolkit.Skyboxes\Stride.CommunityToolkit.Skyboxes.csproj" />
1313
<ProjectReference Include="..\..\..\src\Stride.CommunityToolkit.Windows\Stride.CommunityToolkit.Windows.csproj" />
1414
</ItemGroup>

examples/code-only/Example04_MyraUI/Program.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using Example04_MyraUI;
2-
using Stride.CommunityToolkit.Bullet;
2+
using Stride.CommunityToolkit.Bepu;
33
using Stride.CommunityToolkit.Engine;
44
using Stride.CommunityToolkit.Rendering.Compositing;
55
using Stride.CommunityToolkit.Skyboxes;
@@ -34,9 +34,8 @@ void SetupBase3DScene()
3434
game.Add3DGround();
3535
}
3636

37-
/// <summary>
38-
/// Initializes the health bar if it is not already visible.
39-
/// </summary>
37+
38+
// Initializes the health bar if it is not already visible.
4039
void InitializeHealthBar()
4140
{
4241
if (isHealthBarVisible) return;

0 commit comments

Comments
 (0)