methods: {
setCameraPostion: (()=>{
let _eye = new Vector3();
let eyeDirection = new Vector3();
let target = new Vector3();
let distance, newDistance;
return function setCameraPostion(args) {
_eye.copy(args.pos).sub(target);
eyeDirection.copy(_eye).normalize();
distance = _eye.length();
newDistance = ...();
eyeDirection.setLength(newDistance).add(target);
return eyeDirection;
}
})(),
}
the above method of writing is enforceable. What I want to ask is whether it is advisable to write in this way. Does it need to be optimized?
personally, I feel that this kind of auxiliary variable is very awkward to be written in data. Obsessive-compulsive disorder is fast
, but the disadvantage is that I can"t use this--. I don"t know how to use
. Thank you