Browse Source

fix interactions bounding sphere

Alexander Rose 4 years ago
parent
commit
f9aaabc1f7

+ 1 - 1
src/mol-model-props/computed/representations/interactions-inter-unit-cylinder.ts

@@ -86,7 +86,7 @@ function createInterUnitInteractionCylinderMesh(ctx: VisualContext, structure: S
 
     const m = createLinkCylinderMesh(ctx, builderProps, props, mesh);
 
-    const sphere = Sphere3D.expand(Sphere3D(), structure.boundary.sphere, 1 * sizeFactor);
+    const sphere = Sphere3D.expand(Sphere3D(), (child ?? structure).boundary.sphere, 1 * sizeFactor);
     m.setBoundingSphere(sphere);
 
     return m;

+ 1 - 1
src/mol-model-props/computed/representations/interactions-intra-unit-cylinder.ts

@@ -64,7 +64,7 @@ async function createIntraUnitInteractionsCylinderMesh(ctx: VisualContext, unit:
 
     const m = createLinkCylinderMesh(ctx, builderProps, props, mesh);
 
-    const sphere = Sphere3D.expand(Sphere3D(), unit.boundary.sphere, 1 * sizeFactor);
+    const sphere = Sphere3D.expand(Sphere3D(), (childUnit ?? unit).boundary.sphere, 1 * sizeFactor);
     m.setBoundingSphere(sphere);
 
     return m;