Skip to content

Instantly share code, notes, and snippets.

View noppefoxwolf's full-sized avatar
🦊
きつねかわいい!!!

noppe noppefoxwolf

🦊
きつねかわいい!!!
View GitHub Profile
using (var blendShapes = subsystem.GetBlendShapeCoefficients(face.trackableId, Allocator.Temp)) {
foreach (var blendShape in blendShapes) {
var location = blendShape.blendShapeLocation.ToString();
var key = new BlendShapeKey(location);
blendShapeProxy.AccumulateValue(key, blendShape.coefficient);
}
}
@noppefoxwolf
noppefoxwolf / gist:77ab570018beee87efc03084b019313b
Created October 12, 2020 17:03
draw to CALayer directory.
import UIKit
import AVFoundation
class ViewController: UIViewController, AVCaptureVideoDataOutputSampleBufferDelegate {
lazy var session: AVCaptureSession = .init()
lazy var input: AVCaptureDeviceInput = try! AVCaptureDeviceInput(device: device)
lazy var device: AVCaptureDevice = AVCaptureDevice.default(for: .video)!
lazy var output: AVCaptureVideoDataOutput = .init()
override func viewDidLoad() {
@noppefoxwolf
noppefoxwolf / project.yml
Created October 22, 2020 16:48
project.yml
name: Broadcast
configs:
Debug: debug
Release: release
targetTemplates:
Project:
platform: iOS
deploymentTarget: "14.0"
settings:
base:
import SwiftUI
struct ContentView: View {
@ObservedObject var vm: VM = .init()
var body: some View {
NavigationView {
List(vm.items, rowContent: { (item) in
NavigationLink(
destination: DestinationView(vm: vm),
struct State {
var title: String
init(hash: Int) {
// speacialTextが二箇所で使われてしまい、改修時に漏れそう
// またreducer以外の場所でロジックが実行されているので気持ち悪い
title = specialText(hash: hash)
}
}
class ViewController: UIViewController {
static let dispatchQueue = DispatchQueue(label: "test")
override func viewDidLoad() {
super.viewDidLoad()
ViewController.dispatchQueue.async {
Thread.current.name = "test thread"
print("done")
}
}
//
// ViewController.swift
// a
//
// Created by Tomoya Hirano on 2021/06/15.
//
import UIKit
class ViewController: UIViewController {
@noppefoxwolf
noppefoxwolf / perfectsync.cs
Created June 21, 2021 08:20
perfectsync.cs
if (arFaceManager.subsystem is ARKitFaceSubsystem subsystem) {
using(var blendShapes = subsystem.GetBlendShapeCoefficients(face.trackableId, Allocator.Temp)) {
view.SetBlendShapes(blendShapes);
}
}
private void SetBlendShapes(NativeArray < ARKitBlendShapeCoefficient > blendShapes) {
foreach(var blendShape in blendShapes) {
float x = 0.0 f;
float fixedCoefficient = 0.0 f;
//
// TCAModule.swift
//
//
// Created Tomoya Hirano on 2021/07/04.
// Copyright © 2021 ___ORGANIZATIONNAME___. All rights reserved.
//
//
import SwiftUI
@noppefoxwolf
noppefoxwolf / Package.swift
Created January 4, 2022 13:48
EditormodeのPackage.swift
// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "AppPackage",
platforms: [.iOS(.v15)],
products: [
.library(name: "AppModule", targets: ["AppModule", "DebugMenuModule"]),