Skip to content

Instantly share code, notes, and snippets.

View Nihlus's full-sized avatar

Jarl Gullberg Nihlus

View GitHub Profile
//
// AutoProperty.h
//
// Author:
// Jarl Gullberg <jarl.gullberg@gmail.com>
//
// Copyright (c) 2019 Jarl Gullberg
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
/// <summary>
/// Converts the given MDX model into an Assimp representation.
/// </summary>
/// <param name="model">The model.</param>
/// <returns>The Assimp representation.</returns>
public static Scene FromMDX(MDX model)
{
var scene = new Scene();
var rootNode = new Node();
vec3 ProjectToScreen(mat3 viewportMatrix, vec4 clipSpaceCoordinate)
{
vec3 NDC = clipSpaceCoordinate.xyz / clipSpaceCoordinate.w;
return viewportMatrix * NDC;
}
@Nihlus
Nihlus / NullableTLayoutScanner.cs
Last active December 21, 2018 15:53
Magic internals in ADL.
//
// NullableTLayoutScanner.cs
//
// Copyright (c) 2018 Firwood Software
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
build:
stage: build
only:
- triggers
- web
changes:
- SPECS/**/*.spec
script:
- make
/// <inheritdoc/>
public override void EmitPrologue(ILGenerator il, PipelineWorkUnit<IntrospectiveMethodInfo> workUnit)
{
var definition = workUnit.Definition;
// Create the argument list as an array
var argumentArray = il.DeclareLocal(typeof(object[]));
il.EmitConstantInt(definition.ParameterTypes.Count);
il.EmitNewArray<object>();
string GetLocalNetworkAddress()
{
// Find the IP address we're on, given a configured interface
const string interface = "enx847beb51d7b4";
ifaddrs* adresses { };
getifaddrs(&adresses);
ifaddrs* currentAddress = adresses;
// Find the IP address we're on, given a configured interface
const string interface = "enx847beb51d7b4";
ifaddrs* adresses { };
getifaddrs(&adresses);
while (adresses->ifa_name != interface)
{
if (adresses->ifa_next == nullptr)
{
var functionDocumentations = new List<FunctionDocumentation>();
var namespaceManager = new XmlNamespaceManager(new NameTable());
namespaceManager.AddNamespace("mml", "http://www.w3.org/1998/Math/MathML");
var parserContext = new XmlParserContext(null, namespaceManager, null, XmlSpace.None);
var schemas = new XmlSchemaSet(new NameTable());
var xmlSettings = new XmlReaderSettings
{
DtdProcessing = DtdProcessing.Ignore,
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glBegin">
<refmeta>
<refmetainfo>
<copyright>
<year>1991-2006</year>
<holder>Silicon Graphics, Inc.</holder>
</copyright>