mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Save list of sprite physics joints
This commit is contained in:
parent
13ade2c732
commit
2d2b4a8a58
@ -25,6 +25,7 @@ abstract class PhysicsJoint {
|
||||
if (_joint == null) {
|
||||
_physicsNode = physicsNode;
|
||||
_joint = _createB2Joint(physicsNode);
|
||||
_physicsNode._joints.add(this);
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,6 +33,7 @@ abstract class PhysicsJoint {
|
||||
if (_joint != null && _active) {
|
||||
_physicsNode.b2World.destroyJoint(_joint);
|
||||
_joint = null;
|
||||
_physicsNode._joints.remove(this);
|
||||
}
|
||||
_active = false;
|
||||
}
|
||||
|
||||
@ -31,6 +31,8 @@ class PhysicsNode extends Node {
|
||||
|
||||
_ContactHandler _contactHandler;
|
||||
|
||||
List<PhysicsJoint> _joints = [];
|
||||
|
||||
List<box2d.Body> _bodiesScheduledForDestruction = [];
|
||||
|
||||
double b2WorldToNodeConversionFactor = 10.0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user