This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class DOMUtils { | |
static value<T>(selector: string, value?: any) { | |
const element = DOMUtils.get<HTMLInputElement>(selector); | |
if (value && element) element!.value = value; | |
return element ? element.value as T : null; | |
} | |
static get<T extends HTMLElement>(selector: string, parent?: Element | DocumentFragment | null): T | null { // Allow null | |
if (!parent) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { GreenScreenStream, GreenScreenMethod } from "../../src/GreenScreenStream"; | |
document.addEventListener("DOMContentLoaded", () => { | |
const bgfile = location.hash.length > 0 ? location.hash.replace("#", "") : "beach.jpg" | |
navigator.getUserMedia({ video: { width: 640, height: 360 }, audio: false }, (ms: MediaStream) => { | |
let instance = GreenScreenStream.getInstance(true, `../assets/${bgfile}`, undefined, 640, 360); | |
instance.onReady = () => { | |
const fps = 60; | |
instance.initialize().then(result => { | |
instance.start(GreenScreenMethod.VirtualBackground); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let pp = | |
[[0,4],[0,3],[0,2],[0,1],[0,0],[1,0],[2,0],[3,0],[4,0],[4,1],[4,2],[4,3],[4,4],[3,4],[3,3],[3,2],[3,1],[2,1],[1,1],[1,2],[1,3],[1,4],[2,4],[2,3],[2,2]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ClientFactory, WebRTCFactory, BinaryMessage, TextMessage, Controller } from 'thor-io.client-vnext' | |
export class TestClient{ | |
factory: ClientFactory; | |
controller: Controller; | |
constructor(){ | |
this.factory = new ClientFactory("ws://localhost:1337",["example"],{}); | |
this.factory.onOpen = (controller: Controller) => { | |
this.controller = controller; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import path from "path"; | |
import fs from "fs"; | |
import http from "http"; | |
import https from "https"; | |
import express from "express"; | |
import webSocket from "ws"; | |
import { ExampleController } from "./controllers/ExampleController"; | |
import { BrokerController } from "../src/Controllers/BrokerController/Broker"; | |
import { ThorIO } from ".."; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { CanSet } from '../../src/Decorators/CanSet'; | |
import { CanInvoke } from '../../src/Decorators/CanInvoke'; | |
import { ControllerProperties } from '../../src/Decorators/ControllerProperties'; | |
import { ControllerBase } from "../../src/Controller/ControllerBase"; | |
import { BinaryMessage } from 'thor-io.client-vnext'; | |
import { Connection } from '../../src/Connection/Connection'; | |
interface IMyModel{ | |
age:number; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uniform float time; | |
uniform vec2 mouse; | |
uniform vec2 resolution; | |
uniform sampler2D iChannel0; | |
vec3 mcol=vec3(0.); | |
float randSeed; | |
void randomize(vec2 c){randSeed=fract(sin(dot(c,vec2(113.421,17.329)))*3134.1234);} | |
float rand(){return fract(sin(randSeed++)*3143.45345);} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
precision highp float; | |
uniform sampler2D S; | |
uniform sampler2D R; | |
uniform vec2 X; | |
// Combines 2 buffers, blurred in directions [0,1] and [sin(120°), cos(120°)] to create hexagon | |
// bokeh pattern. Technique I got from DICE that they used in Frostbyte engine. | |
void main() { | |
gl_FragColor = vec4(0); | |
for (int i = 0; i < 10; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef GL_ES | |
precision mediump float; | |
#endif | |
#extension GL_OES_standard_derivatives : enable | |
uniform float time; | |
uniform vec2 mouse; | |
uniform vec2 resolution; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef GL_ES | |
precision mediump float; | |
#endif | |
#extension GL_OES_standard_derivatives : enable | |
uniform float time; | |
uniform vec2 mouse; | |
uniform vec2 resolution; |
NewerOlder