<commit_before>/*
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

/*
 * Defines a planet. Planets in this simulation have infinite mass so they will
 * stay put.
 */
package celestial;

import com.jme3.asset.AssetManager;
import com.jme3.bullet.BulletAppState;
import com.jme3.bullet.collision.PhysicsCollisionObject;
import com.jme3.bullet.collision.shapes.SphereCollisionShape;
import com.jme3.bullet.control.RigidBodyControl;
import com.jme3.material.Material;
import com.jme3.material.RenderState.BlendMode;
import com.jme3.math.ColorRGBA;
import com.jme3.math.FastMath;
import com.jme3.scene.Geometry;
import com.jme3.scene.Node;
import com.jme3.scene.shape.Sphere;
import com.jme3.texture.Image;
import com.jme3.texture.Texture2D;
import com.jme3.texture.plugins.AWTLoader;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.util.Random;
import jmeplanet.FractalDataSource;
import jmeplanet.PlanetAppState;
import jmeplanet.Utility;
import lib.astral.Parser.Term;
import universe.Universe;

/**
 *
 * @author nwiehoff
 */
public class Planet extends Celestial {

    private transient Texture2D tex;
    transient jmeplanet.Planet fractalPlanet;
    transient jmeplanet.Planet atmosphereShell;
    protected transient RigidBodyControl atmospherePhysics;
    private Term type;
    private int seed = 0;
    protected float radius;
    private float atmosphereScaler;

    public Planet(Universe universe, String name, Term type, float radius) {
        super(Float.POSITIVE_INFINITY, universe);
        setName(name);
        this.type = type;
        this.radius = radius;
    }

    public void construct(AssetManager assets) {
        generateProceduralPlanet(assets);
        if (spatial != null) {
            //initializes the physics as a sphere
            SphereCollisionShape sphereShape = new SphereCollisionShape(radius);
            //setup dynamic physics<commit_msg>* planets are discovered by default<commit_after>/*
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

/*
 * Defines a planet. Planets in this simulation have infinite mass so they will
 * stay put.
 */
package celestial;

import com.jme3.asset.AssetManager;
import com.jme3.bullet.BulletAppState;
import com.jme3.bullet.collision.PhysicsCollisionObject;
import com.jme3.bullet.collision.shapes.SphereCollisionShape;
import com.jme3.bullet.control.RigidBodyControl;
import com.jme3.material.Material;
import com.jme3.material.RenderState.BlendMode;
import com.jme3.math.ColorRGBA;
import com.jme3.math.FastMath;
import com.jme3.scene.Geometry;
import com.jme3.scene.Node;
import com.jme3.scene.shape.Sphere;
import com.jme3.texture.Image;
import com.jme3.texture.Texture2D;
import com.jme3.texture.plugins.AWTLoader;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.util.Random;
import jmeplanet.FractalDataSource;
import jmeplanet.PlanetAppState;
import jmeplanet.Utility;
import lib.astral.Parser.Term;
import universe.Universe;

/**
 *
 * @author nwiehoff
 */
public class Planet extends Celestial {

    private transient Texture2D tex;
    transient jmeplanet.Planet fractalPlanet;
    transient jmeplanet.Planet atmosphereShell;
    protected transient RigidBodyControl atmospherePhysics;
    private Term type;
    private int seed = 0;
    protected float radius;
    private float atmosphereScaler;

    public Planet(Universe universe, String name, Term type, float radius) {
        super(Float.POSITIVE_INFINITY, universe);
        setName(name);
        this.type = type;
        this.radius = radius;
        //planets are automatically discovered
        discover();
    }

    public void construct(AssetManager assets) {
        generateProceduralPlanet(assets);
        if (spatial != null) {
            //initializes the physics as a sphere
            SphereCollisionShape sphereShape = new SphereCollisionShape(radius);
            //setup dynamic physics
{'fraction_non_alphanumeric': 0.07979856672477242, 'fraction_numerical': 0.007747433662599264, 'mean_word_length': 3.867106503298775, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4496810', 'n_tokens_mistral': 1518, 'n_tokens_neox': 1492, 'n_words': 481}