Ok, hi friends. 'Bout sick-of me and my physics challenges? Bet so. But I’m “hot into physics” right now, and I could use all the help I can beg-up.
https://playground.babylonjs.com/#7YV8E0#22
‘Bout sick-of seeing the leg-lifter, too, I bet. ME, TOO! Anyway, motor running, consistent… lookin’ good. Now I need on-the-fly current hinge angle… in positive degrees, ideally. Can ya help?
First, look at the mess in lines 117-125. As best I can tell, I am continuously grabbing the worldspace positions… of the hinge’s main and connected pivots… converting the Cannon Vec3 into Babylon Vector3, and then doing a subtraction in line 125… to ATTEMPT to get a direction vector. So, it is my theory… that diff is a direction… possibly useful to smarter people than I. diff is being displayed at-console… un-normalized… constantly.
The OTHER line of continuous console-barf… is joint1.physicsJoint.equationY.jacobianElementB.rotational
It was a value I saw changing… while the motor was running (powering an X-axis hinge). So, I thought I would puke it to console… show you guys. You can change to equationX or equationZ… they produce output, too… just slightly different. You can also switch to jacobianElementA, too, but that is boring.
Does ANYONE have any ideas how I could get angle-in-degrees from these numbers? (Or from ANY OTHER “live-updated” hinge-sniffed properties)
There is another way, using leg1.rotationQuaternion (non-physics) or leg1.physicsImpostor.physicsBody.quaternion (physics)… but that is a bit of a work-around, because we would be using the leg-mesh instead of the hinge joint. But, I WILL GLADLY accept/love any ideas… using those solutions, too. Gladly! tutorial? Another recent asker?
And yeah, I’d love precision to at least 2 decimal spots (if possible). HELP! (thx). All hand-holding… quite welcome. Directions, and Quaternions, and me… have never gotten along well. thx agn!