Skip to content

Commit

Permalink
add sprite.center check
Browse files Browse the repository at this point in the history
  • Loading branch information
sunag committed Sep 25, 2024
1 parent 62ec311 commit 6c32aa2
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/materials/nodes/manager/NodeMaterialObserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ class NodeMaterialObserver {
worldMatrix: renderObject.object.matrixWorld.clone()
};

if ( renderObject.object.center ) {

data.center = renderObject.object.center.clone();

}

if ( renderObject.object.morphTargetInfluences ) {

data.morphTargetInfluences = renderObject.object.morphTargetInfluences.slice();
Expand Down Expand Up @@ -160,7 +166,6 @@ class NodeMaterialObserver {

return data;


}

equals( renderObject ) {
Expand Down Expand Up @@ -239,6 +244,20 @@ class NodeMaterialObserver {

}

// center

if ( renderObjectData.center ) {

if ( renderObjectData.center.equals( object.center ) === false ) {

renderObjectData.center.copy( object.center );

return true;

}

}

// bundle

if ( renderObject.bundle !== null ) {
Expand Down

0 comments on commit 6c32aa2

Please sign in to comment.