Modules Matali Physics Core
Overview of Matali Physics Core module
Matali Physics Core is an advanced, modern, multi-platform, high-performance 3d physics engine. Matali Physics Core is the "heart" of Matali Physics environment.
Advanced Rigid Body Simulation
Us - Uniform scaling
Primitive shapesTranslationRotationUsNUs Sphere Hemisphere Cube Cuboid Cylinder Two radius cylinder (Tapered cylinder, Truncated cone) Cone Pyramid Capsule Two radius capsule (Tapered capsule) Tetrahedron Convex hull Convex triangle mesh Non-convex triangle mesh Heightmap Fluid Triangle Point Segment Plain
NUs - Non-uniform scaling
• Rigid body dynamics with effective automatic activity management, control for linear and angular velocity, linear and angular damping, and other parameters • Fully multithreaded simulation, stable and robust, highly optimized solver • Extensive mass properties, local and global gravity, forces • Action and force fields with ranges defined by any primitive shapes • Parametric action fields • A rich set of primitive shapes on which operations of Minkowski sum and construction of convex hull are available, creating further unique shapes • Operations on arbitrary sets of triangles through the triangle mesh controllers • Real-time deformable triangle meshes • Real-time deformable large-scale heightmaps • Animated large-scale fluid surfaces • Heightmaps with holes and with non-rectangular shaped terrain • Multiple heightmaps and fluid surfaces on a single physics scene • Built-in functions to transform non-convex triangle meshes into a set of convex objects (physics objects and/or shapes and/or primitive shapes) • Materials defining values of static and dynamic friction, restitution, determining appearance and destruction of physics objects • Real-time changeable value of friction and restitution for every heightmap point • Fully interpolated values of height, friction and restitution for heightmap • Groups of physics objects with advanced modeling of destruction process. Each rigid body group can be breakable and the group destruction process is fully modeled by physics scene developers • Programmable fall apart of physics object groups • Real-time resizable physics objects, group of physics objects and group of physics objects with constraints with correct, automatic recalculation physical parameters and constraints • Kinematic objects controlled by animation system • Scalable buoyancy of physics objects • Switchable static state of physics objects
Advanced Collision Detection And Collision Filtering
• Continuous collision detection (CCD) between all primitive shapes and shapes derived therefrom • Contact reporting • Impact factors • Rigid body collisions allocation on different collision groups (maximum 64) • Trigger shapes
• One natural constraint • Distance limits for X, Y and Z axes • Angle limits for X, Y and Z axes (defined as Euler angles or quaternions) • Advanced control for distance and angle limits • Working in normal, spring or deformation mode • Parameters determining indestructibility of constraint
Built-In APIs: Ray Casting, Volume Query
• Ray-surface intersection tests for all primitive shapes • Volume queries specified as a transformed "fat" segment • Volume queries specified as a transformed box • Volume queries specified as a transformed sphere
Advanced Management Of Multiple Physics Scenes And Physics Objects
• Fully dynamic physics scenes constructed as sets of physics objects and groups of physics objects • Managers: physics objects and physics scenes • Physics objects with constraints and groups of physics objects with constraints can be during initialization rotated, moved and scaled • Concurrent sequential processing of multiple physics scenes • Physics objects lifetime maintenance through the counters of frames • Full support for cameras (frustum, view matrix, projection matrix) • Support for instancing • Handling of transparent objects (including objects with variable transparency) • Determining when and how objects are drawn
Physics-Based Animations And Physical AI
• Total control of constraints (distances and angles) • Keyframes modeling based on constraints control • Support for force-feedback • All examples of physics-based animations provided with C++ source code • All examples of physical AI provided with C++ source code
Rigid Particles Simulation
• Generic particle system • Particle dynamics • Advanced particles management • Collision handling and filtering • Inter-particle interactions • Lifetime and other parameters maintenance
• Simulation of real and imagined vehicles • Steering through the controllers and/or switches and/or ray casting and/or volume queries • Vehicles created as groups of physics objects connected constraints • All examples of vehicles provided with C++ source code
• Full support for selected motion characteristics of object • Sounds ranges defined by any primitive shapes
• Support for changing music synthesis parameters depending on physics simulation parameters and vice versa • Support for synchronizing physics simulations with music synthesis
Internal controllers Description Cursor controller Provides functions to handle cursor Screen to ray controller Provides functions to throw the ray in 3D space for given screen coordinates Fluid surface controller Provides functions to create sinusoidal or cosinusoidal fluid surface perturbation in real-time Heightmap controller Provides functions to deform heightmap in real-time Triangle mesh controller Provides functions to add triangles to arbitrary set of triangles and to modify triangles in the set in real-time Destruction controller Provides functions to destroy groups of objects unconnected constraints Motion controller Provides additional parameters to control the movement of object during collision • A rich set of internal controllers • Powerful mechanism of user controllers • Scalable to your needs, full-featured character controllers • Priorities determining the order of user controllers execution • All examples of using internal controllers provided with C++ source code • All examples of using user controllers provided with C++ source code • All examples of using character controllers provided with C++ source code
Serialization And Deserialization
Serialized physics scene elements Simulation parameters Physics objects (with materials, cameras, controllers, fog sources, light and sound sources, contact points, etc) Shapes Primitive shapes Constraints Meshes • Serialization of entire physics scenes to easily parsable XML data • Deserialization of entire physics scenes from easily parsable XML data • Serialization of entire physics scenes to a file, memory or stream • Deserialization of entire physics scenes from a file, memory or stream • Real-time snapshot creation. Such snapshots can be loaded and further processed from the point at which were taken • Serialization in two modes: optimized or complete • Serialization of user controllers through the programmable Archive class • User data handling and automatic serialization/deserialization of such data
• Full support for user-defined debuggers • Built-in mechanisms required for custom debugging
Supported platforms Android 10 (API level 29) and higher Android TV 10 (API level 29) and higher *BSD (mainly FreeBSD 12.2 and higher) iOS 15 and higher iPadOS 15 and higher Linux (distributions) macOS 12 Monterey and higher Steam Deck tvOS 15 and higher UWP Desktop UWP Xbox Series X/S Windows 11 Windows 10 Platforms Available as Steam Deck, UWP, Windows Compiled static library (.lib) Android, Android TV, *BSD, iOS, iPadOS, Linux, macOS, Steam Deck, tvOS Compiled static library (.a) Supported types of activity Android Native Activity
Frequently asked questions
- Can I create hinge-type constraints in the Matali Physics environment?
- Of course, Matali Physics Core offers natural constraint that can dynamically transform into any other ones. If needed, you can initialize the constraint parameters according to the hinge-type constraint and not change them later, or change following the events in the scene - all depending your needs.
- Does Matali Physics Core support native, implicit cylinder shape?
- Yes. All supported shapes are listed in the "Primitive Shapes" table in the "Advanced Rigid Body Simulation" section of this webpage.
- Can I change the size of one physics object without creating many identical shapes?
- Of course. Matali Physics Core provides full support for physics object scaling.
- Can I dynamically change size of any physics object?
- Yes. You can change the scale of physics objects, groups of physics objects as well as groups of physics objects with constraints both during creation/initialization and in real-time during simulation. Matali Physics Core is probably the only real-time 3d physics engine that offers such ready-to-use functionality.
- Does Matali Physics Core offer programmable collision events or similar functionality?
- Of course. In the group of user controllers, Matali Physics Core offers programmable controller from collision events.
- How can I modify single triangles in non-convex triangle meshes?
- Such functionality is offered by the triangle mesh controller.
- Can I build the entire physics scene as a fully dynamic and destructible?
- Yes. Matali Physics Core engine is the best solution for such scenes.
- Can Matali Physics Core handle multiple physics scenes in one game scene?
- Of course, the examples are available in Matali Physics Game.
- Can Matali Physics Core be integrated into my game engine?
- This is a very difficult question. Generally yes, it is possible, but will require, just like in case of any other physics engine, a lot of work on your side. If you want to create games immediately, a better approach is to rely on Matali Physics as a platform, port your own modules (and C++ codes) into it, and then create and publish games.
- I used Matali Physics engine before when it was in C#. Can I use code I wrote in C# in the current version for C++?
- In most cases, after minor changes, the code related to the use of Matali Physics engine in C# can be ported directly to the current version in C++.