add ToMessage() for VmcExtLight

This commit is contained in:
Cassandra de la Cruz-Munoz 2023-08-16 19:52:56 -04:00
parent 5f8fd2d6a7
commit 1066ba4935

View File

@ -106,5 +106,24 @@ namespace godotVmcSharp
transform = _transform; transform = _transform;
color = _color; color = _color;
} }
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'),
new godotOscSharp.OscArgument(color.R, 'f'),
new godotOscSharp.OscArgument(color.G, 'f'),
new godotOscSharp.OscArgument(color.B, 'f'),
new godotOscSharp.OscArgument(color.A, 'f')
});
}
} }
} }