create ToMessage() for VmcExtBonePos

This commit is contained in:
Cassandra de la Cruz-Munoz 2023-08-16 19:17:22 -04:00
parent 49a1fa88c9
commit 747aeeb6ad

View File

@ -83,5 +83,20 @@ namespace godotVmcSharp
name = _name;
transform = _transform;
}
public godotOscSharp.OscMessage ToMessage()
{
var quat = transform.Basis.GetRotationQuaternion();
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{
new godotOscSharp.OscArgument(name, 's'),
new godotOscSharp.OscArgument(transform.Origin.X, 'f'),
new godotOscSharp.OscArgument(transform.Origin.Y, 'f'),
new godotOscSharp.OscArgument(transform.Origin.Z, 'f'),
new godotOscSharp.OscArgument(quat.X, 'f'),
new godotOscSharp.OscArgument(quat.Y, 'f'),
new godotOscSharp.OscArgument(quat.Z, 'f'),
new godotOscSharp.OscArgument(quat.W, 'f'),
});
}
}
}