I have a number of gyroscopes(in real life) attached to my body on my arms, legs, head and spine. Each gyroscope has a unique id, which I map to a body part on the 3d model.
The gyroscope data for each sensor is a quaternion.
I basically just want to animate my 3d model based on this data.
So if I rotate my head to the right, the 3d model should rotate its head similarly. If I stand on one leg, the 3d model should do the same.
When using 2d physics engines like Box2d, this is as simple as applying a transform. What is the equivalent way to do this in Unity ?
EDIT: In Godot its really simple.
https://docs.godotengine.org/en/3.0/tutorials/3d/working_with_3d_skeletons.html
extends Spatial
var skel
var id
func _ready():
skel = get_node("skel")
id = skel.find_bone("upperarm")
print("bone id:", id)
var parent = skel.get_bone_parent(id)
print("bone parent id:", id)
var t = skel.get_bone_pose(id)
print("bone transform: ", t)
set_process(true)
func _process(delta):
var t = skel.get_bone_pose(id)
t = t.rotated(Vector3(0.0, 1.0, 0.0), 0.1 * delta)
skel.set_bone_pose(id, t)