This file contains 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
extern crate rand; | |
extern crate ndarray; | |
use criterion::{black_box, criterion_group, criterion_main, Criterion}; | |
use ndarray::{ArrayView3, array, s, Axis, Ix3, Array3}; | |
use nalgebra::{zero, Vector3}; | |
use rand::Rng; | |
struct Octree { | |
side_length: i32, |
This file contains 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
public static class HERO | |
{ | |
public static bool Intersects(Ray ray, Octree octree) | |
{ | |
var (sumin, slmax) = CalculateBounds(ray, octree); | |
return slmax < sumin; | |
} | |
public static int? Raytrace(Ray ray, Octree octree) |
This file contains 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
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Runtime.InteropServices; | |
using System.Text; | |
using NUnit.Framework.Internal; | |
using Unity.Collections.LowLevel.Unsafe; | |
using Unity.Mathematics; |
This file contains 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
public sealed class Octree | |
{ | |
public Vector3 Origin { get; } | |
public OctreeNode Root { get; } | |
public Octree(Vector3 origin, int sideLength, ReadOnlySpan<int> span) | |
{ | |
Origin = origin; | |
Root = new OctreeNode(sideLength, span); | |
} |
This file contains 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
using Unity.Entities; | |
using Unity.Mathematics; | |
[GenerateAuthoringComponent] | |
public struct Velocity : IComponentData | |
{ | |
public float3 Value; | |
} |
This file contains 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Unity.Collections; | |
using Unity.Entities; | |
using Unity.Mathematics; | |
using static Unity.Mathematics.math; | |
using UnityEngine; | |
using UnityEngine.Rendering; |
This file contains 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 java.awt.event.ActionEvent; | |
import java.awt.event.ActionListener; | |
public class ActionHandler implements ActionListener { | |
@Override | |
public void actionPerformed(ActionEvent e) { |
This file contains 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
using System; | |
namespace Frontend | |
{ | |
public ref struct BitBuffer | |
{ | |
private const int Bitcount = 64; | |
private const int Usedmask = Bitcount - 1; | |
private const int Indexshift = 6; | |
private const ulong Maxvalue = ulong.MaxValue; |
This file contains 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
using System; | |
using System.Buffers; | |
using System.Buffers.Binary; | |
using System.Text; | |
using System.Text.Json; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Connections; | |
using Microsoft.Extensions.Logging; | |
namespace Frontend |
This file contains 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
using System.Linq; | |
public class QuadtreeNode | |
{ | |
public QuadtreeNode Parent { get; } = null; | |
public QuadtreeNode[] Children { get; } = new QuadtreeNode[8]; | |
public byte[,,] Values { get; private set; } | |
public int xMax { get; private set; } | |
public int yMax { get; private set; } | |
public int zMax { get; private set; } |