2
votes

I'm out of ideas... here is my code:

let radians = val * Float.pi / 180

/// object.mEntity = usd Entity.loadModel()
object.mEntity.orientation += simd_quatf(angle: radians, axis: SIMD3<Float>(1,0,0)

object.mEntity.transform.rotation += simd_quatf(angle: radians, axis: SIMD3<Float>(1,0,0)

object.anchorParent.transform.rotation+= simd_quatf(angle: radians, axis: SIMD3<Float>(1,0,0)

the object is a struct that holds my Entity + anchor it was attached to. I have few anchors in general, like the "initial click" position anchor, then shadow anchor on top of it, and then model entity after that. So that I can move the model with shadow/etc.

In any case, I cant rotate it, I always get "weird" rotation as output. Have a look at video > https://www.youtube.com/watch?v=9_WOfLivKvI&ab_channel=DariuszM%C4%85kowski

1

1 Answers

2
votes

Use *= compound multiply operator instead of += compound addition.

Here is the explanation.