Where in the class hierarchy of TargetCamera is 'rotation`

I have a base of source code, going back to the beginning, of changing where a camera is “pointed” by assigning the x/y/z of rotation.

Neither of my sources were “vetted” by typescript though:

  • a Blender python addon to generate JS source code
  • a component of my animation system to move/rot/scale BABYLON.Node objects. Lights use direction, so <BABYLON.Vector3> this._node[this._rotationProperty] is what is lerped.

I now have a need to rotate a TargetCamera, but rotation is not a valid property according to Typescript. I searched source hierarchy, TargetCamera/Camera/Node, and have not found either.

Along the way I tried to set cameraDirection, but not working & has side effects.

Just to clarify, I just did a camera["rotation"].y = x. It works, so I do not have a performance issue

Here is it: Babylon.js/targetCamera.ts at master · BabylonJS/Babylon.js · GitHub

1 Like

Maybe you have a type issue? is your camera object of TargetCamera type?

Ok, but I swear it was not in the source. Problem there was probably having too many things open at once.

Typescript (via the editor) did give an error. I was casting from a Camera, but still using the Camera property when trying to set rotation.