How would you avoid exposing the components as subproperties – and why would you want to?
Would the “pos” property just be completely “opaque” to JavaScript / QML code? If so, then it becomes useless in bindings. If not, then it would need to be exposed as a value-type (so that binding expressions and signal handlers can do pos.x if they wish) – and as soon as you’re using value-types you’re incurring a fairly large amount of overhead for absolutely every position-related call. I’d be interested in seeing benchmarks of two animations, one which animates an int property to which another int property is bound, and one which animates an int property to which a value-type subproperty (eg, the x component of a vector3d) is bound. I actually haven’t benchmarked this, as far as I can remember, but I would imagine that the second one would take significantly more CPU.
Cheers,
Chris.
↧