Skip to content

Instantly share code, notes, and snippets.

View Batname's full-sized avatar

Batname Batname

  • BatGames
  • Amsterdam
View GitHub Profile
@Batname
Batname / Matrix.hlsl
Created October 10, 2022 12:44 — forked from mattatz/Matrix.hlsl
Matrix operations for HLSL
#ifndef __MATRIX_INCLUDED__
#define __MATRIX_INCLUDED__
#define IDENTITY_MATRIX float4x4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)
float4x4 inverse(float4x4 m) {
float n11 = m[0][0], n12 = m[1][0], n13 = m[2][0], n14 = m[3][0];
float n21 = m[0][1], n22 = m[1][1], n23 = m[2][1], n24 = m[3][1];
float n31 = m[0][2], n32 = m[1][2], n33 = m[2][2], n34 = m[3][2];
float n41 = m[0][3], n42 = m[1][3], n43 = m[2][3], n44 = m[3][3];
@Batname
Batname / Matrix.hlsl
Created October 10, 2022 12:44 — forked from mattatz/Matrix.hlsl
Matrix operations for HLSL
#ifndef __MATRIX_INCLUDED__
#define __MATRIX_INCLUDED__
#define IDENTITY_MATRIX float4x4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)
float4x4 inverse(float4x4 m) {
float n11 = m[0][0], n12 = m[1][0], n13 = m[2][0], n14 = m[3][0];
float n21 = m[0][1], n22 = m[1][1], n23 = m[2][1], n24 = m[3][1];
float n31 = m[0][2], n32 = m[1][2], n33 = m[2][2], n34 = m[3][2];
float n41 = m[0][3], n42 = m[1][3], n43 = m[2][3], n44 = m[3][3];
// Copyright Epic Games, Inc. All Rights Reserved.
#include "IAvaPackerModule.h"
#include "AssetRegistryModule.h"
#include "IAssetTools.h"
#include "AssetToolsModule.h"
#include "GenericPlatform/GenericPlatformFile.h"
#include "Algo/Accumulate.h"
// check the example in bool FRemoteControlModule::SetObjectProperties
bool FRemoteControlModule::SetPresetController(const FRCControllerReference& ControllerRef, IStructDeserializerBackend& Backend, ERCPayloadType InPayloadType, const TArray<uint8>& InPayload, ERCModifyOperation Operation)
{
// Logic
// Check the Interceptor, it shoudl be implmented in Remote Control and nDisplay, but you can for first Prof of concept go without Interceptor
// But keep this in mind for the future
// Build interception command
// Determine the resolution of the clients desktop screen.
screenWidth = GetSystemMetrics(SM_CXSCREEN);
screenHeight = GetSystemMetrics(SM_CYSCREEN);
// Setup the screen settings depending on whether it is running in full screen or in windowed mode.
if(FULL_SCREEN)
{
// If full screen set the screen to maximum size of the users desktop and 32bit.
memset(&dmScreenSettings, 0, sizeof(dmScreenSettings));
dmScreenSettings.dmSize = sizeof(dmScreenSettings);
// Copyright 1998-2018 Epic Games, Inc. All Rights Reserved.
#include "Engine/GameViewportClient.h"
#include "HAL/FileManager.h"
#include "Misc/CommandLine.h"
#include "Misc/FileHelper.h"
#include "Misc/Paths.h"
#include "Misc/CoreDelegates.h"
#include "Misc/App.h"
#include "GameMapsSettings.h"
/*
Simple UDP Server
*/
#include<stdio.h>
#include<winsock2.h>
#pragma warning(disable:4996)
#pragma comment(lib,"ws2_32.lib") //Winsock Library
#define BUFLEN 512 //Max length of buffer
/*
analog1.cpp
g++ -o Binaries/polulu1 polulu1.cpp -lpigpio -lrt -lpthread
sudo ./Binaries/polulu1
gpioWrite(18, 0); // high
gpioWrite(18, 1); // low
@Batname
Batname / tb6612fng.py
Created January 12, 2018 19:58
tb6612fng + Pi
#!user/bin/python
import time
import RPi.GPIO as GPIO
#Declare the GPIO settings
#print "Set GPIO Board numbers"
# to use Raspberry pi board pin numbers
GPIO.setmode(GPIO.BOARD)
#include <string.h>
#define BRAKE 0
#define CW 1
#define CCW 2
#define CS_THRESHOLD 15 // Definition of safety current (Check: "1.3 Monster Shield Example").
//MOTOR 1
#define MOTOR_A1_PIN 7
#define MOTOR_B1_PIN 8