Teardown

Teardown

Shards Summoner
Geneosis  [developer] 19 Nov, 2022 @ 10:04am
About quaternions
Just making a separate discussion here about quaternions to avoid flooding the main thread too much :p

So as I was saying in the description and comments, there is a big difference between world axis and local axis whenever you do a rotation (using quaternion or any other rotation method by the way).

What I mean by world axis is a global rotation axis that will all ways be the same, no matter the current rotation of the object itself, a local axis on the other hand is an axis that moves with the object whenever it rotates.

So for exaple lets assume that you sart with an object with all axis aligned with world axis. Then if you consider the up-down axis, if you rotate the object 90deg "forward" on the left-right axis, then the local up-down axis of the object will now be the global front-back axis. Not sure if this example helps, this is quite hard to explain without some drawings XD

Anyway the issue here is that according to my experiments in the game, all quaternion operations are always working with local axis... Which is not what I was looking for in the context of this mod X)
Last edited by Geneosis; 19 Nov, 2022 @ 10:14am
< >
Showing 1-5 of 5 comments
DimasVoxel 20 Nov, 2022 @ 9:25am 
You know, I had to ask some other guys and experiment to find the solution but here is what I came up with.


bt = GetBodyTransform(target)
r = QuatAxisAngle(TransformToParentVec(bt,Vec(0,1,0)),1)
ConstrainOrientation(target,0,bt.rot,QuatRotateQuat(r,bt.rot),1)

Using QuatAxisAngle It will give you a rotation around a specific axis you specify.
In my case this is up Vec(0,1,0) and each tick I rotate it by one degree.

This basically means it wont rotate on a global axis but only around your body you specify
Geneosis  [developer] 20 Nov, 2022 @ 9:41am 
I would need to do more tests in this direction then, not sure if that covers all the cases I was looking for, but it may ^^

Thanks for spending some time on this topic though ;)
DimasVoxel 21 Nov, 2022 @ 12:26am 
if you ever have questions, you can reach out in the teardown discord server in the modding section
Lemon 7 Apr, 2023 @ 2:51pm 
hey,
can you tell me the best combo
Geneosis  [developer] 7 Apr, 2023 @ 3:37pm 
@Lemon: Not sure what you mean, combo of what?
< >
Showing 1-5 of 5 comments
Per page: 1530 50