eulerToQuat is public in scene-core.ts, but is not promoted to the barrel file. In my code I copied the function so that I could create TRS matrices. Can it be added to the barrel, or is there some other mechanism I should be using for this purpose?
Do you want to make a PR for it ?
Even after perusing the docs and similar code, I wasn’t able to ascertain:
- The order of imports and exports.
- What exports belong in the subdirectory barrels in addition to the root barrel.
I took a stab. Feedback welcome.
This is good! I validated it, it will go through ![]()
As I use lite more, it’s feels like rotation and rotationQuaternion run afoul of lite’s convenience/performance goals. EulerProxy is basically modular functionality and could be peeled off easily. Just eliminate rotation as a property and make createEulerProxy an explict API.
Even the proxy feels heavyweight if one uses the angles minimally. For example, I only set euler angles at initialization, and only read them in debugging contexts. A decomposed math API could be:
function getEuler(rotatable: { rotationQuaternion: Quat }): Vec3;
function setEuler(rotatable: { rotationQuaternion: Quat }, trs: Vec3): Vec3;
function updateEuler(rotatable: { rotationQuaternion: Quat }, mutator: (trs: Vec3) => Partial): Vec3;
These functions are actually similar enough that I’d probably just make them overloads of a single function based on the type of the second parameter.
I’m sure you’ve considered all of this. Why does rotation warrant inclusion in the base objects?
That was a very long debate but we decided to keep it in because a lot of people struggle with quaternion