public static Offset <RotatorPartial> ToFlatBuffer(this ObjectRotation rotation, FlatBufferBuilder builder) { RotatorPartial.StartRotatorPartial(builder); RotatorPartial.AddPitch(builder, Float.CreateFloat(builder, rotation.Pitch)); RotatorPartial.AddYaw(builder, Float.CreateFloat(builder, rotation.Yaw)); RotatorPartial.AddRoll(builder, Float.CreateFloat(builder, rotation.Roll)); return(RotatorPartial.EndRotatorPartial(builder)); }
public Offset <RotatorPartial> ToFlatBuffer(FlatBufferBuilder builder) { RotatorPartial.StartRotatorPartial(builder); if (Pitch.HasValue) { RotatorPartial.AddPitch(builder, Float.CreateFloat(builder, Pitch.Value)); } if (Yaw.HasValue) { RotatorPartial.AddYaw(builder, Float.CreateFloat(builder, Yaw.Value)); } if (Roll.HasValue) { RotatorPartial.AddRoll(builder, Float.CreateFloat(builder, Roll.Value)); } return(RotatorPartial.EndRotatorPartial(builder)); }