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
/* | |
* Copyright 2020 damios | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at: | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software | |
* distributed under the License is distributed on an "AS IS" BASIS, |
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 SquidLib.SquidMath; | |
namespace Maps | |
{ | |
/** | |
* An experimental way of speeding up {@link FastNoise} by using a large buffer of random bytes, and choosing a byte | |
* from the buffer purely by the current seed and position (a simpler calculation than a hash). This currently gives a | |
* modest speed boost to {@link #SIMPLEX}, {@link #PERLIN}, {@link #CUBIC}, and {@link #HONEY}, a smaller speed boost to | |
* {@link #FOAM}, and no change for {@link #VALUE} or {@link #WHITE_NOISE}. This class only uses the least-significant |
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
float evalCurve(float x, float tx, float ty, float sa, float sb) | |
{ | |
const float EPS = 1e-6f; | |
if (x < tx) { | |
return (ty * x) / (x + sa * (tx - x) + EPS); | |
} else { | |
return ((1-ty) * (x-1)) / ((1-x) - sb * (tx - x) + EPS) + 1.0f; | |
} | |
} |
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
/** | |
* Provides a {@link #probit(double)} method to convert from the (0.0,1.0) domain to a Gaussian range. | |
* Uses an algorithm by Peter John Acklam, as implemented by Sherali Karimov. | |
* Free to use, but you should credit Acklam and Karimov appropriately. | |
*/ | |
public final class Probit { | |
private static final double LOW = 0.02425; | |
private static final double HIGH = 1.0 - LOW; | |
// Coefficients in rational approximations. |
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 com.badlogic.gdx.Game; | |
import com.badlogic.gdx.Gdx; | |
import com.badlogic.gdx.graphics.Color; | |
import com.badlogic.gdx.graphics.GL20; | |
import com.badlogic.gdx.graphics.PerspectiveCamera; | |
import com.badlogic.gdx.graphics.Texture; | |
import com.badlogic.gdx.graphics.VertexAttributes.Usage; | |
import com.badlogic.gdx.graphics.g3d.Environment; | |
import com.badlogic.gdx.graphics.g3d.Material; | |
import com.badlogic.gdx.graphics.g3d.Model; |
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
This includes JDK8 and Guava 28 data structures, with the analysis done by https://github.com/DimitrisAndreou/memory-measurer . | |
========================================== 64-bit architecture ========================================== | |
========================================== Basic Lists, Sets, Maps ========================================== | |
ArrayList :: Bytes = 4.71, Objects = 0.00 Refs = 1.18 Primitives = {} | |
ImmutableList :: Bytes = 4.00, Objects = 0.00 Refs = 1.00 Primitives = {} | |
HashSet :: Bytes = 40.24, Objects = 1.00 Refs = 5.06 Primitives = {int=1.0} |
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
_hashCode java/lang/Object.hashCode()I | |
_getClass java/lang/Object.getClass()Ljava/lang/Class; | |
_clone java/lang/Object.clone()Ljava/lang/Object; | |
_notify java/lang/Object.notify()V | |
_notifyAll java/lang/Object.notifyAll()V | |
_dabs java/lang/Math.abs(D)D | |
_dsin java/lang/Math.sin(D)D | |
_dcos java/lang/Math.cos(D)D | |
_dtan java/lang/Math.tan(D)D | |
_datan2 java/lang/Math.atan2(DD)D |
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
┌─────────────┬─────┬───────────────┐ ┌─────┬───────────┐ ┌─────┐ ┌───────┐ ┌─────────┐ ┌─────┬───────────┐ ┌─────────┐ | |
│ . . . . . . │ . . │ . . . . . . . └───┘ . . │ . . . . . │ │ . . │ ┌─┘ . . . ├───────────────┘ . . . . └───┘ . . │ . . . . . │ │ . . . . │ | |
│ . . . . . . │ . . │ . . ────. . . . . . . . │ . . . . . ├───────┘ . . └─┐ │ . . . . │ . . . . . . . . . . . . . . . . . │ . . . . . │ ┌─┘ . . . ┌─┘ | |
│ . . │ . ┌───┘ . . │ . . . . . . . . . . . . │ . . . . . │ . . . . . . . │ │ . . . ┌─┤ . . . . . . . . . . . . . . . . . │ . . . . . └─┘ . . . . └───┐ | |
│ . . │ . │ . . . . . . . ──┬───────┬───┐ . . └─+ ──┐ . . . . . . . . . . │ │ . . ┌─┘ │ . . │ . . ┌───+ ┬─┐ . . ┌───┐ . . │ . . │ . . . . . . . . . . └─┐ | |
│ . . │ . │ . . . . . . . . │ . . . │ │ . . . . . │ . . . . . . ┌─┐ . . └─────┘ . . └───┘ . . │ . . │ . . │ │ . . │ │ . . . . . │ . . . . . . . . . . . └─┐ | |
│ . . . . │ . . . . │ . . . │ . . . │ │ . . . . . │ . . |
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
_hashCode java/lang/Object.hashCode()I | |
_getClass java/lang/Object.getClass()Ljava/lang/Class; | |
_clone java/lang/Object.clone()Ljava/lang/Object; | |
_dabs java/lang/Math.abs(D)D | |
_dsin java/lang/Math.sin(D)D | |
_dcos java/lang/Math.cos(D)D | |
_dtan java/lang/Math.tan(D)D | |
_datan2 java/lang/Math.atan2(DD)D | |
_dsqrt java/lang/Math.sqrt(D)D | |
_dlog java/lang/Math.log(D)D |
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
package com.mobidevelop.files; | |
import java.io.InputStream; | |
import java.io.OutputStream; | |
import com.badlogic.gdx.files.FileHandle; | |
public class EncryptedFileHandle extends FileHandleWrapper { | |
public EncryptedFileHandle(FileHandle file) { |
NewerOlder