Problem with boundingBoxGizmo fixedDragMeshScreenSize when using a nested camera

So in Frame we have a third person camera that is the child of our first person camera. The first person camera is responsible for moving around the scene while the third person acts as an orbit camera that like mentioned prior is a child of the fpc.

We have a situation where the scale boxes are doing very unpredictable scaling when a user has an object being dragged and moved with the player.

After doing some digging I noticed in the method for setting their size the gizmoLayer uses the activeCamera.position which in our setup would always be a localized position instead of the global position. Would there be a way to work around this? Im thinking just changing the code here:

to say

scaleBoxes[index].absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.globalPosition, this._tmpVector);

would fix the problem or am I mistaken in thinking that?

I guess this makes sense !!! Can you “monkeypatch” in Frame and validates that it works there before creating a PR ?

1 Like

“monkeypatch” :smirk: I see what you did there.

It does look like that fixed the problem when I polyfilled over the method with the fix.

Ill submit a PR here.

@sebavan

ahah did not even noticed primate monkey patching… this goes way too deep for me :slight_smile: