Comments (3)
Background
The possibility of comparing two physics engines gives a chance to improve both. So I started looking for an alternative. The first 2 attempts have been a failure. Both Unity's default physics and DOTS Physics have many problems with the collision between a fast-ball and a fast-flipper. Also, simple ball stacking gives unstable behaviour. It may be possible to overcome that obstancles, but that would take a lot of time.
Bullet Physics
First tests looks good. Without any tweaking ball-flipper interactions looks realistic. Not same as VPX, but not bad. Portability looks good, linux, ios, osx, android are supported. Performance is ok too. I can put few more stacked balls than in current VPX physics. It doesn't mean VPX is slower, just that particular case is slow in VPX. For now it is also worst case scenario.
Current status
- we have first version of comunition interface between VPE Core and external physics engine (and with DebugUI too). This interface is probably not in finall form, but for start it is enought.
- basic ball - flipper or static object collisions works.
- manual ball roller for testing works... Well it is crucial tool to check models shape when debug draw of physical shapes don't work.
- flipper params are accessible to DebugUI. Few charts usefull in tweaking/debuging works fine. They are also accessible for VPX physics. Here is first place when we can compare both.
Guidlines
- A new Unity package containing a physics engine is added to the Unity project
Adding Bullet Physics is as simple as adding VPE to Unity. See instuction on my BulletPhysics repo.
- The editor somehow allows to select the desired engine (preferably on per-table basis, somewhere in the table inspector)
It is matter of one click in inspector to enable/disable Bullet Physics:
- If the (default) VPX engine is chosen, the other engine(s) should be invisible (not called at all in the game loop)
It works like that. There is one thing to remeber. Bullet physics code will be added to builded VPE. It will be possible to select engine later, when builded VPE will be executed.
- If another engine is chosen, the VPX engine should be completely disabled (no systems active).
Right now Bullet Physics will disable ECS systems used by VPX on start.
- Each engine can be configured somehow, by the table (i.e. at runtime)
It is easy to add single switch and gives table-dev decision witch physics should run.
My goal is to minimize number special params for object when different physics is selected. Just to avoid confusion.
- The overhead should be minimal
In most cases, code required to select different physics engine, will be not in performance critical parts. So, it should not create a problems. Also adding more physics engines to chose will not make difference.
from visualpinball.engine.
PRs concerning this:
- #66 is @ravarcade's original PR
- ravarcade#3 are my suggested changes
- ravarcade/VisualPinball.Engine.Unity.ImgGUI#1 are my the updates to debug UI
- ravarcade/VisualPinball.Engine.Unity.BulletPhysics#1 are my updates to Bullet physics
from visualpinball.engine.
Closed by #66.
from visualpinball.engine.
Related Issues (20)
- Not allowed to access vertices or normals on mesh (isReadable is false; Read/Write must be enabled in import settings. VPX10 blank table import. HOT 2
- trough does not get created when table is imported. HOT 1
- Unknown VisualPinball.Unity.IPhysicsEngine engine HOT 2
- Properly simulate score reels HOT 13
- All SystemBase-derived classes must be defined with the `partial` keyword HOT 6
- Update slingshot doc with component changes
- Add physics to spinners, gates, and switches.
- Add FlipperNudge to flippers
- Add Flipper Rubber Dampening when Flipper is in Up-Position
- Use LivecatchBounceMultiplier to reduce angular momentum instead of nulling it.
- Gate is missing Height property
- Simplify Flipper Parameters
- Current code version run in Linux ? HOT 3
- Handle Mechanical Sounds HOT 1
- A strange isuue with current vpe HOT 1
- Can only use 4 Balls in trough.
- InvalidOperationException: System.IndexOutOfRangeException:
- IndexOutOfRangeException: Index was outside the bounds of the array.
- Custom flat ramps
- Imported ramps cause lockup
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from visualpinball.engine.