rapier_physics 0.5.3
rapier_physics: ^0.5.3 copied to clipboard
A high-performance 3D physics engine for Flutter, powered by Rapier (Rust/WASM).
Changelog #
🌐 Language / 語言:English | 繁體中文
0.5.3 #
2026-08-26
- Engine Upgrade: Upgraded underlying native engine dependency to
rapier3d v0.35.2(andparry3d v0.30.2). - Web/WASM Re-initialization Guard: Fixed issue where switching scenes re-initialized WASM and caused runtime unreachable exceptions with stale handles.
- Build Scripts & Web Assets: Updated build script output paths directly to
web/andexample/web/, removing redundantprebuilt/web. - Cleanup: Cleaned up extraneous debug prints in
RapierWorld.
0.5.2 #
2026-08-25
- World & Controller Lifecycle Cleanup: Added
dispose()alias toRapierWorld, improveddestroy()to clear internal body, collider, and joint maps and nullify_groundBody. - Character Controller Safety: Enhanced
KinematicCharacterController.dispose()to reset controller handles safely and prevent double-free.
0.5.1 #
2026-08-21
- Character Controller Jump: Added a Jump button to the
CharacterControllerScenedemo, enabling vertical impulse-based jumping with on-screen UI controls. - Joystick Input Improvements: Refined joystick interaction in
CharacterControllerScenewith a configurable input area and improved touch responsiveness. - Windows DLL Updated: Rebuilt and updated
prebuilt/rapier_ffi.dll. - CompoundScene Table: Added
addTable— a compound rigid body consisting of a flat tabletop box and four box legs with individualColliderDesc.cuboidoffsets and darker-wood sub-mesh colouring.
0.5.0 #
2026-08-19
- Kinematic Character Controller: Introduced
KinematicCharacterControllerfor 3D character physics navigation, supporting auto-stepping, slope sliding, ground snapping, and dynamic body impulse pushing (applyImpulsesToDynamicBodies). - Scene Queries: Added comprehensive
SceneQueryAPI featuring raycasting (castRay,castRayAndGetNormal,intersectionWithRay,intersectionsWithRay) and shape casting (castShape,intersectionsWithShape) with customizable query filter flags (QueryFilterFlags). - Explicit Capsule Axis Alignment: Refactored
ColliderShapeTypeandColliderDescto explicitly support axis-aligned capsule variants (capsuleX,capsuleY,capsuleZ) across Dart API and Rust FFI. - FFI Modularization: Modularized native Rust FFI code into structured files (
world,rigid_body,collider,joint,character_controller,scene_query) and split Dart FFI bindings into dedicated implementation modules (lib/src/bindings/ffi/). - New Interactive Demos: Added 3D Character Controller demo and Scene Query raycasting/shape-casting demo in the example project (
example/lib/main_3d.dart). - Engine Upgrade: Upgraded the underlying native engine dependency to
rapier3d v0.34.0.
0.4.1 #
2026-07-19
- CompoundScene Dumbbell Spawner: Added time-based dumbbell spawning in
CompoundScene, continuously spawning compound rigid bodies from(0, 0, 20)at 10/sec up to a configurable cap. - BaseScene Camera & Ground: Increased default camera distance to 30 and expanded ground plane half-size to 10 with a larger checkerboard texture.
0.4.0 #
2026-06-27
- Windows Platform Support: Added support for the Windows platform, including a C++ plugin implementation, CMake configuration, and bundling of the prebuilt native
rapier_ffi.dlllibrary. - Swift Package Manager (SPM) Support: Restructured iOS and macOS native directories (
ios/rapier_physicsandmacos/rapier_physics) and addedPackage.swiftto support integration via Swift Package Manager. - Build Script Automation: Refactored
native/rapier_ffi/build.shto output.xcframeworkdirectly to the iOS and macOSrapier_physicssubfolders to match the SPM structure.
0.3.1 #
2026-05-07
- Timestep API: Added
timestepgetter and setter toRapierWorld, allowing users to control the simulation's integration step size (dt). - FFI Naming Refactor: Standardized all FFI function names to the
rapier_[component]_[action]convention (e.g.,rapier_rigid_body_create,rapier_collider_get_position_x) for better consistency across Native and Web platforms. - API Refinement: Updated
ColliderDescconstructors forcylinder,cone, andcapsuleto follow a more intuitive parameter order:(radius, halfHeight)instead of(halfHeight, radius). - Platform Sync: Updated iOS/macOS Swift plugins and Web/WASM bridge to support the new timestep FFI symbols and improve symbol visibility.
0.3.0 #
2026-05-03
- Unified Collider API: Introduced
ColliderDescarchitecture for more robust and extensible collider creation. - Native Local Transform Support:
- Added
localPositionandlocalRotationsupport directly in the native FFI layer. - Colliders can now be positioned and rotated relative to their parent rigid body at creation time, improving physical stability.
- Added
- API Cleanup:
- Removed redundant specialized collider creation methods (
createBoxCollider,createSphereCollider, etc.) in favor of the unifiedcreateColliderAPI. - Updated
addBox,addSphere, and other convenience methods to use the unifiedRigidBodyDescsystem for better extensibility.
- Removed redundant specialized collider creation methods (
- FFI Memory Optimization: Standardized the
ColliderDescmemory layout (64 bytes) across Rust, Dart, and Swift for efficient zero-copy cross-boundary communication. - Platform Sync: Updated iOS/macOS Swift plugins and Web/WASM interop to support the expanded native collider transformation data.
0.2.0 #
2026-04-23
- Force & Impulse API: Added
addForce,addTorque,applyImpulse,applyTorqueImpulse, and theirAtPointvariants toRigidBody. - Velocity Controls: Added
setLinearVelocityandsetAngularVelocityfor fine-grained rigid body motion control. - Entity Removal API:
- Added
removeRigidBody,removeCollider, andremoveJointtoRapierWorld. - Implemented automatic cleanup of internal tracking (e.g., removing a body also cleans up its associated colliders and joints from Dart state).
- Added
- Relationship Tracking:
- Added
collidersandjointsgetters toRigidBodyfor bidirectional navigation between entities. - Improved internal
_bodyCollidersand_bodyJointsmapping for robust state management.
- Added
- CCD Support: Added
setCCD(bool enabled)toRigidBodyto prevent tunneling for high-speed objects. - Heightfield Colliders: Added support for terrain-based collisions using height maps (
addHeightfield). - Apple Platforms Refinement:
- Improved symbol export and linking for iOS/macOS via Swift plugin bridge.
- Added explicit
@_silgen_namedeclarations for all FFI symbols to ensure stability in Release builds.
- Joints Support: Added comprehensive joint system including:
FixedJoint,SphericalJoint,RevoluteJoint,PrismaticJoint,GenericJoint, andRopeJoint.- Helper methods to attach bodies directly to the world (
*ToWorld).
- Motors & Constraints:
- Added joint motor support for Revolute and Prismatic joints.
- Added
lockJointAxisandsetJointLimitsfor fine-grained constraint control viaGenericJoint.
- New Colliders: Added
Conecollider support. - World Lifecycle:
- Added
destroy()toRapierWorldfor proper resource cleanup. - Native
groundBodysupport for easier joint anchoring to the static world.
- Added
- Engine Upgrade: Upgraded the underlying native engine dependency to
rapier3d v0.32.0. - Example App enhancements: Added Newton's Cradle demo, debug toggles (helpers, wireframe), shadow controls, and physics restart.
0.1.0 #
2026-04-09
- Cross-Platform Refactoring: Major architectural update to support Native and Web platforms seamlessly using abstract bindings and conditional imports.
- Web Support: Full WebAssembly (WASM) implementation via
dart:js_interop. - Android Fix: Resolved native library loading issues by adopting standard
jniLibsdirectory structure and loading from name. - Improved API:
- Added asynchronous
init()for robust cross-platform initialization. - Component-wise state getters for better WASM compatibility.
- Support for multiple
RigidBodyType(Fixed, Dynamic, Kinematic).
- Added asynchronous
- Automated Tooling: Updated
build.shto automate the distribution of Android, iOS, macOS, and Web binaries.
0.0.1 #
2026-04-03
- Initial release with basic Rapier physics FFI bridge.