Skip to content

Instantly share code, notes, and snippets.

MeshRenderBoneComposition comp =
creatureAsset.creature_manager.target_creature.render_composition;
List<MeshRenderRegion> regions = comp.getRegions();
foreach (MeshRenderRegion region in regions) {
Rect r = new Rect();
int uvIndex = region.getUVsIndex();
for (int i = 0; i < region.getNumPts(); i++) {
Vector2 p = new Vector2(region.store_uvs[uvIndex], region.store_uvs[uvIndex + 1]);
if (i == 0) {
r.xMax = r.xMin = (float)p.x;
@zaneclaes
zaneclaes / UVBoxes.cs
Last active November 6, 2017 14:43
UV Boxes for creature
MeshRenderBoneComposition comp =
creatureAsset.creature_manager.target_creature.render_composition;
List<MeshRenderRegion> regions = comp.getRegions();
foreach (MeshRenderRegion region in regions) {
Rect r = new Rect();
int uvIndex = region.getUVsIndex();
for (int i = 0; i < region.getNumPts(); i++) {
Vector2 p = new Vector2(region.store_uvs[uvIndex], region.store_uvs[uvIndex + 1]);
if (i == 0) {
r.xMax = r.xMin = (float)p.x;
// I created a shared base-class for both CreatureRenderer and CreatureCanvasRenderer, which removes tons and tons of copy/pasted code...
// Here's how I transform the vertices...
public void UpdateRenderingData() {
CreatureRenderModule.UpdateRenderingData(
creature_manager,
counter_clockwise,
ref vertices,
ref normals,
ref tangents,
# MIT License
#
# Copyright (c) 2018, Zane Claes
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# MIT License
#
# Copyright (c) 2018, Zane Claes
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# MIT License
#
# Copyright (c) 2018, Zane Claes
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
[CLEAN] Cleaning build directories.
[MAKE] Generating /work/libs/opt/pkgconfig/grpc.pc
[MAKE] Generating /work/libs/opt/pkgconfig/grpc_unsecure.pc
[MAKE] Generating cache.mk
[CXX] Compiling src/core/lib/gpr/alloc.cc
[CXX] Compiling src/core/lib/gpr/arena.cc
[CXX] Compiling src/core/lib/gpr/atm.cc
[CXX] Compiling src/core/lib/gpr/avl.cc
[CXX] Compiling src/core/lib/gpr/cmdline.cc
[CXX] Compiling src/core/lib/gpr/cpu_iphone.cc
#!/bin/bash
#
# ARG_HELP([Configure a mobile device as an external screen:])
# ARG_POSITIONAL_SINGLE([width],[Width of the external screen])
# ARG_POSITIONAL_SINGLE([height],[Height of the external screen])
# ARG_POSITIONAL_SINGLE([position],[Position of the external screen: top, right, bottom, or left],[position - right])
# ARGBASH_GO()
# needed because of Argbash --> m4_ignore([
### START OF CODE GENERATED BY Argbash v2.6.1 one line above ###
# Argbash is a bash code generator used to get arguments parsing right.
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="powerlevel9k/powerlevel9k"
ZSH_DISABLE_COMPFIX=false
POWERLEVEL9K_MODE='nerdfont-complete'
@zaneclaes
zaneclaes / certbot_jks.sh
Created April 23, 2019 16:11
Converts a letsencrypt certificate into a JKS file.
#!/bin/bash
# Converts a letsencrypt certificate into a JKS file.
# Usage:
# ./certbot_jks.sh [domain_name] [email]
le_dir="/etc/letsencrypt"
domain=${1}
email=${2}
OUT_DIR=${le_dir}/live/${domain}
GATE_EXPORT_PASSWORD=test1234