mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Fixes issue in sprite node
This commit is contained in:
parent
5a481ed554
commit
1dbf9bc891
@ -260,12 +260,14 @@ class Node {
|
|||||||
|
|
||||||
void teleportPosition(Point position) {
|
void teleportPosition(Point position) {
|
||||||
assert(position != null);
|
assert(position != null);
|
||||||
|
PhysicsWorld world = _physicsWorld(parent);
|
||||||
|
|
||||||
if (_physicsBody != null && (parent is PhysicsWorld || parent is PhysicsGroup)) {
|
if (_physicsBody != null && (parent is PhysicsWorld || parent is PhysicsGroup)) {
|
||||||
position = _positionToPhysics(position, parent);
|
position = _positionToPhysics(position, parent);
|
||||||
_physicsBody._body.setTransform(
|
_physicsBody._body.setTransform(
|
||||||
new Vector2(
|
new Vector2(
|
||||||
position.x / physicsNode.b2WorldToNodeConversionFactor,
|
position.x / world.b2WorldToNodeConversionFactor,
|
||||||
position.y / physicsNode.b2WorldToNodeConversionFactor
|
position.y / world.b2WorldToNodeConversionFactor
|
||||||
),
|
),
|
||||||
_physicsBody._body.getAngle()
|
_physicsBody._body.getAngle()
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user