rapier_physics 0.3.0
rapier_physics: ^0.3.0 copied to clipboard
A high-performance 3D physics engine for Flutter, powered by Rapier (Rust/WASM).
Changelog #
0.3.0 #
- 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 #
- 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 #
- 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 #
- Initial release with basic Rapier physics FFI bridge.