Convert vec3 AngularVelocity to vec4?
Posted: Thu Nov 26, 2020 4:31 am
Prior to using Bullet, I was using SceneKit's built-in physics engine for my iOS projects. SceneKit expresses a rigid body's angular velocity as a 4D vector, where the x,y,z components describe the axis the body is currently rotating around, and the fourth w component specifies the speed the body is rotating around this axis (in radians/s I believe, but that's irrelevant to my question).
From what I understand, Bullet expresses a rigid body's angular velocity as a 3D vector, where the x, y and z components represent a rotation around the body's local x, y and z axis (a yaw, pitch, roll rotation).
I've been building a bullet physics wrapper for Swift, with support for wiring the simulation up to SceneKit, and I would like to consolidate the bridge between these 2 values (I would like users to be able to specify a 4D vector as they are used to with SceneKit, and have that get converted to the 3D vector Bullet expects).
I'm having a hard time visualizing this, and can't find much online. Are there any existing solutions out there for working with 4D vectors for angular velocities in bullet?
Thanks,
- Adam
From what I understand, Bullet expresses a rigid body's angular velocity as a 3D vector, where the x, y and z components represent a rotation around the body's local x, y and z axis (a yaw, pitch, roll rotation).
I've been building a bullet physics wrapper for Swift, with support for wiring the simulation up to SceneKit, and I would like to consolidate the bridge between these 2 values (I would like users to be able to specify a 4D vector as they are used to with SceneKit, and have that get converted to the 3D vector Bullet expects).
I'm having a hard time visualizing this, and can't find much online. Are there any existing solutions out there for working with 4D vectors for angular velocities in bullet?
Thanks,
- Adam