but not quite
π
Story of all vs addons, but you know, some addons work less than others
:clueless:
image0.jpg
π€
βοΈum acktually, I happen to see an issue with this. The ship gains momentum when itβs first attached since it sags a bit
That sort of language isnβt appreciated around here :3drevenge:
if even java code looks better than your kotlin code, you are doing something extremly wrong
Finally, all that was needed was to tighten the screw acting as a hinge
:3dsmile:
It just took 299792458 iterations
:clueless:
If you end up doing something like that just to create a constraint, then you are probably going the wrong way
so basically we take in the rotations of both bodies, and we multiply them by the hinge quaternions
and then the constraint aligns axis 0 of both of them to point the same direction
function getQuatAxis0(q) {
let x2 = q.x * 2.0;
let w2 = q.w * 2.0;
return new THREE.Vector3(
(q.w * w2) - 1.0 + q.x * x2,
(q.z * w2) + q.y * x2,
(-q.y * w2) + q.z * x2);
}
If I understand correctly, this is supposed to make the +X axis of each of the hinges part aligned, where a hinge is defined as a local rotation from its target body/ship
So basically to create such constraint, you need to make a quat that transforms the axis of the hinge/normal of the surface you clicked back to the +X axis (1,0,0) in local ship space.
One way to do that is to get the direction/normal of where you clicked in local ship space, then compute a quaternion that gives this value when we multiply it with (1,0,0) then invert it
Im actually quite tired, and I donβt have anything to test this so I might say shit right now
This conversation is on Discord Β· Reply there
:clueless:
:3dsmile: