You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.
In clean(), the local matrix is updated as follows: (lines 218-229)
//translate to originlocal.matrix.makeTranslation( origin.x, origin.y, origin.z );
//scale up relative to originlocal.matrix.scale(local.scale);
//rotation relative to originlocal.matrix.multiply(_rotation_matrix);
//apply positionlocal.matrix.setPosition( local.pos );
//undo origin translationlocal.matrix.multiply(_origin_undo_matrix);
matrix.setPosition() sets or overwrites the position in the matrix, which means there is no need to undo the origin translation in the next line. Since the undo origin translation is present, this causes some unusual effects when a Visual's parent has the origin assigned to something other than (0,0,0):
This is the code used:
In my opinion, the expected behavior is the rock should be directly on top of the sprite, since its position is (0,0), but because of this bug, the rocks position is actually (-16, -16) (relative to the player) because the player sprite, the rock's parent, is centered (has an origin of (16, 16)).
When I comment out the undo origin translation locally, the camera and rendering are incorrect, so those probably depend on transform's current broken behavior, and will have to be fixed too.
The text was updated successfully, but these errors were encountered:
In clean(), the local matrix is updated as follows: (lines 218-229)
matrix.setPosition() sets or overwrites the position in the matrix, which means there is no need to undo the origin translation in the next line. Since the undo origin translation is present, this causes some unusual effects when a Visual's parent has the origin assigned to something other than (0,0,0):
This is the code used:
In my opinion, the expected behavior is the rock should be directly on top of the sprite, since its position is (0,0), but because of this bug, the rocks position is actually (-16, -16) (relative to the player) because the player sprite, the rock's parent, is centered (has an origin of (16, 16)).
When I comment out the undo origin translation locally, the camera and rendering are incorrect, so those probably depend on transform's current broken behavior, and will have to be fixed too.
The text was updated successfully, but these errors were encountered: