Closed valen214 closed 4 years ago
recommend to add incomplete doc
label if necessary
Well I would not like to complicate things here. The target property is inherited from TargetCamera where only vector3 is supported
And furthermore the set target will be different than the get as the getter only returns vector3
I'll add a note though :)
"Please note that you can set the target to a mesh and thus the target will be copied from mesh.position"
Quick problem
the two lines below are the implementation
arcRotateCamera.ts (line 975): setTarget(target: AbstractMesh | Vector3, ...)
takesVector3 | AbstractMesh
as first argumentarcRotateCamera.ts (line 63): set target(value: Vector3)
takes onlyVector3
as the first argumentvalue
while the implementation is literally{ this.setTarget(value); }
corresponding typedoc line 42664 for
set target()
so it is actually possible to do
camera.target = mesh as any
I suggest
set target()
should include some guidance to notify viewers thatcamera.target = mesh
is possible, or something like "set target() is just an alias to
setTarget()
"set target()
comes first in the documentation (typedoc), it's reasonable for people skim through and thinkset target()
andsetTarget()
take the same type then omit the featuresetTarget
offers. (I think? at least it happened on me :( It took me a day to discover that feature, seeing some PG actually usedcamera.target = mesh
, I was shocked because I thought it can only beVector3
)edit: oddly setTarget(Vector3) in UniversalCamera has it mentioned, even the parameter type is still the same