Worked on chem element enum some more
Added room phase state to each as well classification to each. Generally will not be used as much though i might handle how each work as a fluid.
This commit is contained in:
parent
4457d96b97
commit
d793d51288
5 changed files with 336 additions and 130 deletions
179
APIs/universalelectricity/core/vector/Quaternion.java
Normal file
179
APIs/universalelectricity/core/vector/Quaternion.java
Normal file
|
@ -0,0 +1,179 @@
|
|||
package universalelectricity.core.vector;
|
||||
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
|
||||
/** Simple quaternion class designed to be used for rotation of objects.
|
||||
*
|
||||
* @author DarkGuardsman */
|
||||
public class Quaternion
|
||||
{
|
||||
public static final float TOLERANCE = 0.00001f;
|
||||
float x, y, z, w;
|
||||
|
||||
public Quaternion()
|
||||
{
|
||||
this(0, 0, 0, 1);
|
||||
}
|
||||
|
||||
public Quaternion(float x, float y, float z, float w)
|
||||
{
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
this.w = w;
|
||||
}
|
||||
|
||||
public Quaternion(Vector3 vec, float w)
|
||||
{
|
||||
this((float) vec.x, (float) vec.y, (float) vec.z, w);
|
||||
}
|
||||
|
||||
public void set(Quaternion quaternion)
|
||||
{
|
||||
w = quaternion.w;
|
||||
x = quaternion.x;
|
||||
y = quaternion.y;
|
||||
z = quaternion.z;
|
||||
}
|
||||
|
||||
public void set(float x, float y, float z, float w)
|
||||
{
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
this.w = w;
|
||||
}
|
||||
|
||||
/** Normalizes the Quaternion only if its outside the min errors range */
|
||||
public void normalise()
|
||||
{
|
||||
// Don't normalize if we don't have to
|
||||
double mag2 = w * w + x * x + y * y + z * z;
|
||||
if (Math.abs(mag2) > TOLERANCE && Math.abs(mag2 - 1.0f) > TOLERANCE)
|
||||
{
|
||||
float mag = (float) Math.sqrt(mag2);
|
||||
w /= mag;
|
||||
x /= mag;
|
||||
y /= mag;
|
||||
z /= mag;
|
||||
}
|
||||
}
|
||||
|
||||
/** Gets the inverse of this Quaternion */
|
||||
public Quaternion getConj()
|
||||
{
|
||||
return new Quaternion(-x, -y, -z, w);
|
||||
}
|
||||
|
||||
public void conj()
|
||||
{
|
||||
x = -x;
|
||||
y = -y;
|
||||
z = -z;
|
||||
}
|
||||
|
||||
/** Multiplying q1 with q2 applies the rotation q2 to q1 */
|
||||
public Quaternion multi(Quaternion rq)
|
||||
{
|
||||
return new Quaternion(w * rq.x + x * rq.w + y * rq.z - z * rq.y, w * rq.y + y * rq.w + z * rq.x - x * rq.z, w * rq.z + z * rq.w + x * rq.y - y * rq.x, w * rq.w - x * rq.x - y * rq.y - z * rq.z);
|
||||
}
|
||||
|
||||
public void multLocal(Quaternion q)
|
||||
{
|
||||
Quaternion temp = this.multi(q);
|
||||
this.set(temp);
|
||||
}
|
||||
|
||||
/** Multi a vector against this in other words applying rotation */
|
||||
public Vector3 multi(Vector3 vec)
|
||||
{
|
||||
Vector3 vn = vec.clone();
|
||||
|
||||
Quaternion vecQuat = new Quaternion(0, 0, 0, 1), resQuat;
|
||||
vecQuat.x = (float) vn.x;
|
||||
vecQuat.y = (float) vn.y;
|
||||
vecQuat.z = (float) vn.z;
|
||||
vecQuat.w = 0.0f;
|
||||
|
||||
resQuat = vecQuat.multi(this.getConj());
|
||||
resQuat = this.multi(resQuat);
|
||||
|
||||
return new Vector3(resQuat.x, resQuat.y, resQuat.z);
|
||||
}
|
||||
|
||||
public void FromAxis(Vector3 v, float angle)
|
||||
{
|
||||
angle *= 0.5f;
|
||||
Vector3 vn = v.clone();
|
||||
vn.normalize();
|
||||
|
||||
float sinAngle = (float) Math.sin(angle);
|
||||
|
||||
x = (float) (vn.x * sinAngle);
|
||||
y = (float) (vn.y * sinAngle);
|
||||
z = (float) (vn.z * sinAngle);
|
||||
w = (float) Math.cos(angle);
|
||||
}
|
||||
|
||||
// Convert from Euler Angles
|
||||
public void FromEuler(float pitch, float yaw, float roll)
|
||||
{
|
||||
// Basically we create 3 Quaternions, one for pitch, one for yaw, one for roll
|
||||
// and multiply those together.
|
||||
// the calculation below does the same, just shorter
|
||||
|
||||
float p = (float) (pitch * (Math.PI / 180) / 2.0);
|
||||
float y = (float) (yaw * (Math.PI / 180) / 2.0);
|
||||
float r = (float) (roll * (Math.PI / 180) / 2.0);
|
||||
|
||||
float sinp = (float) Math.sin(p);
|
||||
float siny = (float) Math.sin(y);
|
||||
float sinr = (float) Math.sin(r);
|
||||
float cosp = (float) Math.cos(p);
|
||||
float cosy = (float) Math.cos(y);
|
||||
float cosr = (float) Math.cos(r);
|
||||
|
||||
x = sinr * cosp * cosy - cosr * sinp * siny;
|
||||
y = cosr * sinp * cosy + sinr * cosp * siny;
|
||||
z = cosr * cosp * siny - sinr * sinp * cosy;
|
||||
w = cosr * cosp * cosy + sinr * sinp * siny;
|
||||
|
||||
normalise();
|
||||
}
|
||||
|
||||
/* Convert to Matrix
|
||||
public Matrix4 getMatrix()
|
||||
{
|
||||
float x2 = (float) (x * x);
|
||||
float y2 = (float) (y * y);
|
||||
float z2 = (float) (z * z);
|
||||
float xy = (float) (x * y);
|
||||
float xz = (float) (x * z);
|
||||
float yz = (float) (y * z);
|
||||
float wx = (float) (w * x);
|
||||
float wy = (float) (w * y);
|
||||
float wz = (float) (w * z);
|
||||
|
||||
// This calculation would be a lot more complicated for non-unit length quaternions
|
||||
// Note: The constructor of Matrix4 expects the Matrix in column-major format like expected
|
||||
// by
|
||||
// OpenGL
|
||||
return new Matrix4(1.0f - 2.0f * (y2 + z2), 2.0f * (xy - wz), 2.0f * (xz + wy), 0.0f, 2.0f * (xy + wz), 1.0f - 2.0f * (x2 + z2), 2.0f * (yz - wx), 0.0f, 2.0f * (xz - wy), 2.0f * (yz + wx), 1.0f - 2.0f * (x2 + y2), 0.0f, 0.0f, 0.0f, 0.0f, 1.0f);
|
||||
}*/
|
||||
|
||||
// Convert to Axis/Angles
|
||||
public void getAxisAngle(Vector3 axis, float angle)
|
||||
{
|
||||
float scale = (float) Math.sqrt(x * x + y * y + z * z);
|
||||
x = x / scale;
|
||||
y = y / scale;
|
||||
z = z / scale;
|
||||
angle = (float) (Math.acos(w) * 2.0f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "<" + x + "x " + y + "y " + z + "z @" + w + ">";
|
||||
}
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package com.builtbroken.common;
|
||||
|
||||
|
||||
/** List of element from the periodic table of elements for any kind of use. Is not complete for all
|
||||
* parts but each element should have a listed names, symbol, and atomic mass. Atomic number should
|
||||
* be the placement # in the list. Var ZERO should not be used as its designed to offset the
|
||||
|
@ -12,123 +13,123 @@ package com.builtbroken.common;
|
|||
public enum ChemElement
|
||||
{
|
||||
/** Placeholder so that hydrogen starts as number one */
|
||||
ZERO("ZERO", "ZERO", 0, 0),
|
||||
Hydrogen("Hydrogen", "H", 1.00794f, 0.08988f),
|
||||
Helium("Helium", "He", 4.002602f, 0.1785f),
|
||||
Lithium("Lithium", "Li", 6.941f, 0.53f),
|
||||
Beryllium("Beryllium", "Be", 9.012182f, 1.8477f),
|
||||
Boron("Boron", "B", 10.811f),
|
||||
Carbon("Carbon", "C", 12.0107f),
|
||||
Nitrogen("Nitrogen", "N", 14.0067f),
|
||||
Oxygen("Oxygen", "O", 15.9994f),
|
||||
Fluorine("Fluorine", "F", 18.9994f),
|
||||
Neon("Neon", "Ne", 20.1797f),
|
||||
Sodium("Sodium", "Na", 22.98976928f),
|
||||
Magnesium("Magnesium", "Mg", 24.305f),
|
||||
aluminium("aluminium", "Al", 26.9815386f),
|
||||
Silicon("Silicon", "Si", 28.0855f),
|
||||
Phosphorus("Phosphorus", "P", 30.973762f),
|
||||
Sulphur("Sulphur", "S", 32.065f),
|
||||
Chlorine("Chlorine", "Cl", 35.453f),
|
||||
Argon("Argon", "Ar", 39.948f),
|
||||
Potassium("Potassium", "K", 39.0983f),
|
||||
Calcium("Calcium", "Ca", 40.078f),
|
||||
Scandium("Scandium", "Sc", 44.955912f),
|
||||
Titanium("Titanium", "Ti", 47.867f),
|
||||
Vanadium("Vanadium", "V", 50.9415f),
|
||||
Chromium("Chromium", "Cr", 51.9961f),
|
||||
Manganese("Manganese", "Mn", 54.938045f),
|
||||
Iron("Iron", "Fe", 55.845f),
|
||||
Cobalt("Cobalt", "Co", 58.933195f),
|
||||
Nickel("Nickel", "Ni", 58.6934f),
|
||||
Copper("Copper", "Cu", 63.546f),
|
||||
Zinc("Zinc", "Zn", 65.38f),
|
||||
Gallium("Gallium", "Ga", 69.723f),
|
||||
Germanium("Germanium", "Ge", 72.64f),
|
||||
Arsenic("Arsenic", "As", 74.9216f),
|
||||
Selenium("Selenium", "Se", 78.96f),
|
||||
Bromine("Bromine", "Br", 79.904f),
|
||||
Krypton("Krypton", "Kr", 83.798f),
|
||||
Rubidium("Rubidium", "Rb", 85.4678f),
|
||||
Strontium("Strontium", "Sr", 87.62f),
|
||||
Yttrium("Yttrium", "Y", 88.90585f),
|
||||
Zirkonium("Zirkonium", "Zr", 91.224f),
|
||||
Niobium("Niobium", "Nb", 92.90638f),
|
||||
Molybdaenum("Molybdaenum", "Mo", 95.96f),
|
||||
Technetium("Technetium", "Tc", 98f),
|
||||
Ruthenium("Ruthenium", "Ru", 101.07f),
|
||||
Rhodium("Rhodium", "Rh", 102.9055f),
|
||||
Palladium("Palladium", "Pd", 106.42f),
|
||||
Silver("Silver", "Ag", 107.8682f),
|
||||
Cadmium("Cadmium", "Cd", 112.411f),
|
||||
Indium("Indium", "In", 114.818f),
|
||||
Tin("Tin", "Sn", 118.71f),
|
||||
Antimony("Antimony", "Sb", 121.76f),
|
||||
Tellurium("Tellurium", "Te", 127.6f),
|
||||
Iodine("Iodine", "I", 126.90447f),
|
||||
Xenon("Xenon", "Xe", 131.293f),
|
||||
Cesium("Cesium", "Cs", 132.9054519f),
|
||||
Barium("Barium", "Ba", 137.327f),
|
||||
Lanthanum("Lanthanum", "La", 138.90547f),
|
||||
Cerium("Cerium", "Ce", 140.116f),
|
||||
Praseodymium("Praseodymium", "Pr", 140.90765f),
|
||||
Neodymium("Neodymium", "Nd", 144.242f),
|
||||
Promethium("Promethium", "Pm", 145f),
|
||||
Samarium("Samarium", "Sm", 150.36f),
|
||||
Europium("Europium", "Eu", 151.964f),
|
||||
Gadolinium("Gadolinium", "Gd", 157.25f),
|
||||
Terbium("Terbium", "Tb", 158.92535f),
|
||||
Dysprosium("Dysprosium", "Dy", 162.5001f),
|
||||
Holmium("Holmium", "Ho", 164.93032f),
|
||||
Erbium("Erbium", "Er", 167.259f),
|
||||
Thulium("Thulium", "Tm", 168.93421f),
|
||||
Ytterbium("Ytterbium", "Yb", 173.054f),
|
||||
Lutetium("Lutetium", "Lu", 174.9668f),
|
||||
Hafnium("Hafnium", "Hf", 178.49f),
|
||||
Tantalum("Tantalum", "Ta", 180.94788f),
|
||||
Tungsten("Tungsten", "W", 183.84f),
|
||||
Rhenium("Rhenium", "Re", 186.207f),
|
||||
Osmium("Osmium", "Os", 190.23f),
|
||||
Iridium("Iridium", "Ir", 192.217f),
|
||||
Platinum("Platinum", "Pt", 192.084f),
|
||||
Gold("Gold", "Au", 196.966569f),
|
||||
Hydrargyrum("Hydrargyrum", "Hg", 200.59f),
|
||||
Thallium("Thallium", "Tl", 204.3833f),
|
||||
Lead("Lead", "Pb", 207.2f),
|
||||
Bismuth("Bismuth", "Bi", 208.980401f),
|
||||
Polonium("Polonium", "Po", 210f),
|
||||
Astatine("Astatine", "At", 210f),
|
||||
Radon("Radon", "Rn", 220f),
|
||||
Francium("Francium", "Fr", 223f),
|
||||
Radium("Radium", "Ra", 226f),
|
||||
Actinium("Actinium", "Ac", 227f),
|
||||
Thorium("Thorium", "Th", 232.03806f),
|
||||
Protactinium("Protactinium", "Pa", 231.03588f),
|
||||
Uranium("Uranium", "U", 238.02891f),
|
||||
Neptunium("Neptunium", "Np", 237f),
|
||||
Plutonium("Plutonium", "Pu", 244f),
|
||||
Americium("Americium", "Am", 243f),
|
||||
Curium("Curium", "Cm", 247f),
|
||||
Berkelium("Berkelium", "Bk", 247f),
|
||||
Californium("Californium", "Cf", 251f),
|
||||
Einsteinium("Einsteinium", "Es", 252f),
|
||||
Fermium("Fermium", "Fm", 257f),
|
||||
Mendelevium("Mendelevium", "Md", 258f),
|
||||
Nobelium("Nobelium", "No", 259f),
|
||||
Lawrencium("Lawrencium", "Lr", 262f),
|
||||
Rutherfordium("Rutherfordium", "Rf", 261f),
|
||||
Dubnium("Dubnium", "Db", 262f),
|
||||
Seaborgium("Seaborgium", "Sg", 266f),
|
||||
Bohrium("Bohrium", "Bh", 264f),
|
||||
Hassium("Hassium", "Hs", 277f),
|
||||
Meitnerium("Meitnerium", "Mt", 268f),
|
||||
Ununnilium("Ununnilium", "Ds", 271f),
|
||||
Unununium("Unununium", "Rg", 272f),
|
||||
Ununbium("Ununbium", "Uub", 285f),
|
||||
Ununtrium("Ununtrium", "Uut", 284f),
|
||||
Ununquadium("Ununquadium", "Uuq", 289f),
|
||||
Ununpentium("Ununpentium", "Uup", 288f),
|
||||
Ununhexium("Ununhexium", "Uuh", 292f);
|
||||
ZERO("ZERO", "ZERO", 0, 0, null, null),
|
||||
Hydrogen("Hydrogen", "H", 1.00794f, 0.08988f, ElementClassifications.nonmetal, MatterPhase.gas),
|
||||
Helium("Helium", "He", 4.002602f, 0.1785f, ElementClassifications.inertGas, MatterPhase.gas),
|
||||
Lithium("Lithium", "Li", 6.941f, 0.53f, ElementClassifications.inertGas, MatterPhase.gas),
|
||||
Beryllium("Beryllium", "Be", 9.012182f, 1.8477f, ElementClassifications.inertGas, MatterPhase.gas),
|
||||
Boron("Boron", "B", 10.811f, ElementClassifications.inertGas, MatterPhase.gas),
|
||||
Carbon("Carbon", "C", 12.0107f, ElementClassifications.inertGas, MatterPhase.gas),
|
||||
Nitrogen("Nitrogen", "N", 14.0067f, ElementClassifications.inertGas, MatterPhase.gas),
|
||||
Oxygen("Oxygen", "O", 15.9994f, ElementClassifications.inertGas, MatterPhase.gas),
|
||||
Fluorine("Fluorine", "F", 18.9994f, ElementClassifications.inertGas, MatterPhase.gas),
|
||||
Neon("Neon", "Ne", 20.1797f, ElementClassifications.inertGas, MatterPhase.gas),
|
||||
Sodium("Sodium", "Na", 22.98976928f, ElementClassifications.alkaliMetal, MatterPhase.solid),
|
||||
Magnesium("Magnesium", "Mg", 24.305f, ElementClassifications.alkalineEarthMetal, MatterPhase.solid),
|
||||
aluminium("aluminium", "Al", 26.9815386f, ElementClassifications.otherMetal, MatterPhase.solid),
|
||||
Silicon("Silicon", "Si", 28.0855f, ElementClassifications.otherMetal, MatterPhase.solid),
|
||||
Phosphorus("Phosphorus", "P", 30.973762f, ElementClassifications.nonmetal, MatterPhase.solid),
|
||||
Sulphur("Sulphur", "S", 32.065f, ElementClassifications.nonmetal, MatterPhase.solid),
|
||||
Chlorine("Chlorine", "Cl", 35.453f, ElementClassifications.halogen, MatterPhase.gas),
|
||||
Argon("Argon", "Ar", 39.948f, ElementClassifications.inertGas, MatterPhase.gas),
|
||||
Potassium("Potassium", "K", 39.0983f, ElementClassifications.alkaliMetal, MatterPhase.solid),
|
||||
Calcium("Calcium", "Ca", 40.078f, ElementClassifications.alkalineEarthMetal, MatterPhase.solid),
|
||||
Scandium("Scandium", "Sc", 44.955912f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Titanium("Titanium", "Ti", 47.867f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Vanadium("Vanadium", "V", 50.9415f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Chromium("Chromium", "Cr", 51.9961f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Manganese("Manganese", "Mn", 54.938045f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Iron("Iron", "Fe", 55.845f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Cobalt("Cobalt", "Co", 58.933195f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Nickel("Nickel", "Ni", 58.6934f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Copper("Copper", "Cu", 63.546f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Zinc("Zinc", "Zn", 65.38f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Gallium("Gallium", "Ga", 69.723f, ElementClassifications.otherMetal, MatterPhase.solid),
|
||||
Germanium("Germanium", "Ge", 72.64f, ElementClassifications.semimetallic, MatterPhase.solid),
|
||||
Arsenic("Arsenic", "As", 74.9216f, ElementClassifications.semimetallic, MatterPhase.solid),
|
||||
Selenium("Selenium", "Se", 78.96f, ElementClassifications.nonmetal, MatterPhase.solid),
|
||||
Bromine("Bromine", "Br", 79.904f, ElementClassifications.halogen, MatterPhase.liquid),
|
||||
Krypton("Krypton", "Kr", 83.798f, ElementClassifications.inertGas, MatterPhase.gas),
|
||||
Rubidium("Rubidium", "Rb", 85.4678f, ElementClassifications.alkaliMetal, MatterPhase.solid),
|
||||
Strontium("Strontium", "Sr", 87.62f, ElementClassifications.alkalineEarthMetal, MatterPhase.solid),
|
||||
Yttrium("Yttrium", "Y", 88.90585f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Zirkonium("Zirkonium", "Zr", 91.224f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Niobium("Niobium", "Nb", 92.90638f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Molybdaenum("Molybdaenum", "Mo", 95.96f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Technetium("Technetium", "Tc", 98f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Ruthenium("Ruthenium", "Ru", 101.07f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Rhodium("Rhodium", "Rh", 102.9055f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Palladium("Palladium", "Pd", 106.42f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Silver("Silver", "Ag", 107.8682f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Cadmium("Cadmium", "Cd", 112.411f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Indium("Indium", "In", 114.818f, ElementClassifications.otherMetal, MatterPhase.solid),
|
||||
Tin("Tin", "Sn", 118.71f, ElementClassifications.otherMetal, MatterPhase.solid),
|
||||
Antimony("Antimony", "Sb", 121.76f, ElementClassifications.semimetallic, MatterPhase.solid),
|
||||
Tellurium("Tellurium", "Te", 127.6f, ElementClassifications.semimetallic, MatterPhase.solid),
|
||||
Iodine("Iodine", "I", 126.90447f, ElementClassifications.halogen, MatterPhase.solid),
|
||||
Xenon("Xenon", "Xe", 131.293f, ElementClassifications.inertGas, MatterPhase.gas),
|
||||
Cesium("Cesium", "Cs", 132.9054519f, ElementClassifications.alkaliMetal, MatterPhase.solid),
|
||||
Barium("Barium", "Ba", 137.327f, ElementClassifications.alkalineEarthMetal, MatterPhase.solid),
|
||||
Lanthanum("Lanthanum", "La", 138.90547f, ElementClassifications.lanthanide, MatterPhase.solid),
|
||||
Cerium("Cerium", "Ce", 140.116f, ElementClassifications.lanthanide, MatterPhase.solid),
|
||||
Praseodymium("Praseodymium", "Pr", 140.90765f, ElementClassifications.lanthanide, MatterPhase.solid),
|
||||
Neodymium("Neodymium", "Nd", 144.242f, ElementClassifications.lanthanide, MatterPhase.solid),
|
||||
Promethium("Promethium", "Pm", 145f, ElementClassifications.lanthanide, MatterPhase.solid),
|
||||
Samarium("Samarium", "Sm", 150.36f, ElementClassifications.lanthanide, MatterPhase.solid),
|
||||
Europium("Europium", "Eu", 151.964f, ElementClassifications.lanthanide, MatterPhase.solid),
|
||||
Gadolinium("Gadolinium", "Gd", 157.25f, ElementClassifications.lanthanide, MatterPhase.solid),
|
||||
Terbium("Terbium", "Tb", 158.92535f, ElementClassifications.lanthanide, MatterPhase.solid),
|
||||
Dysprosium("Dysprosium", "Dy", 162.5001f, ElementClassifications.lanthanide, MatterPhase.solid),
|
||||
Holmium("Holmium", "Ho", 164.93032f, ElementClassifications.lanthanide, MatterPhase.solid),
|
||||
Erbium("Erbium", "Er", 167.259f, ElementClassifications.lanthanide, MatterPhase.solid),
|
||||
Thulium("Thulium", "Tm", 168.93421f, ElementClassifications.lanthanide, MatterPhase.solid),
|
||||
Ytterbium("Ytterbium", "Yb", 173.054f, ElementClassifications.lanthanide, MatterPhase.solid),
|
||||
Lutetium("Lutetium", "Lu", 174.9668f, ElementClassifications.lanthanide, MatterPhase.solid),
|
||||
Hafnium("Hafnium", "Hf", 178.49f, ElementClassifications.lanthanide, MatterPhase.solid),
|
||||
Tantalum("Tantalum", "Ta", 180.94788f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Tungsten("Tungsten", "W", 183.84f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Rhenium("Rhenium", "Re", 186.207f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Osmium("Osmium", "Os", 190.23f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Iridium("Iridium", "Ir", 192.217f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Platinum("Platinum", "Pt", 192.084f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Gold("Gold", "Au", 196.966569f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Hydrargyrum("Hydrargyrum", "Hg", 200.59f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Thallium("Thallium", "Tl", 204.3833f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Lead("Lead", "Pb", 207.2f, ElementClassifications.otherMetal, MatterPhase.solid),
|
||||
Bismuth("Bismuth", "Bi", 208.980401f, ElementClassifications.otherMetal, MatterPhase.solid),
|
||||
Polonium("Polonium", "Po", 210f, ElementClassifications.semimetallic, MatterPhase.solid),
|
||||
Astatine("Astatine", "At", 210f, ElementClassifications.halogen, MatterPhase.solid),
|
||||
Radon("Radon", "Rn", 220f, ElementClassifications.inertGas, MatterPhase.gas),
|
||||
Francium("Francium", "Fr", 223f, ElementClassifications.alkaliMetal, MatterPhase.solid),
|
||||
Radium("Radium", "Ra", 226f, ElementClassifications.alkalineEarthMetal, MatterPhase.solid),
|
||||
Actinium("Actinium", "Ac", 227f, ElementClassifications.actinide, MatterPhase.solid),
|
||||
Thorium("Thorium", "Th", 232.03806f, ElementClassifications.actinide, MatterPhase.solid),
|
||||
Protactinium("Protactinium", "Pa", 231.03588f, ElementClassifications.actinide, MatterPhase.solid),
|
||||
Uranium("Uranium", "U", 238.02891f, ElementClassifications.actinide, MatterPhase.solid),
|
||||
Neptunium("Neptunium", "Np", 237f, ElementClassifications.actinide, MatterPhase.solid),
|
||||
Plutonium("Plutonium", "Pu", 244f, ElementClassifications.actinide, MatterPhase.solid),
|
||||
Americium("Americium", "Am", 243f, ElementClassifications.actinide, MatterPhase.solid),
|
||||
Curium("Curium", "Cm", 247f, ElementClassifications.actinide, MatterPhase.solid),
|
||||
Berkelium("Berkelium", "Bk", 247f, ElementClassifications.actinide, MatterPhase.solid),
|
||||
Californium("Californium", "Cf", 251f, ElementClassifications.actinide, MatterPhase.solid),
|
||||
Einsteinium("Einsteinium", "Es", 252f, ElementClassifications.actinide, MatterPhase.solid),
|
||||
Fermium("Fermium", "Fm", 257f, ElementClassifications.actinide, MatterPhase.solid),
|
||||
Mendelevium("Mendelevium", "Md", 258f, ElementClassifications.actinide, MatterPhase.solid),
|
||||
Nobelium("Nobelium", "No", 259f, ElementClassifications.actinide, MatterPhase.solid),
|
||||
Lawrencium("Lawrencium", "Lr", 262f, ElementClassifications.actinide, MatterPhase.solid),
|
||||
Rutherfordium("Rutherfordium", "Rf", 261f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Dubnium("Dubnium", "Db", 262f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Seaborgium("Seaborgium", "Sg", 266f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Bohrium("Bohrium", "Bh", 264f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Hassium("Hassium", "Hs", 277f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Meitnerium("Meitnerium", "Mt", 268f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Ununnilium("Ununnilium", "Ds", 271f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Unununium("Unununium", "Rg", 272f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Ununbium("Ununbium", "Uub", 285f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Ununtrium("Ununtrium", "Uut", 284f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Ununquadium("Ununquadium", "Uuq", 289f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Ununpentium("Ununpentium", "Uup", 288f, ElementClassifications.transitionMetal, MatterPhase.solid),
|
||||
Ununhexium("Ununhexium", "Uuh", 292f, ElementClassifications.transitionMetal, MatterPhase.solid);
|
||||
|
||||
/** g/cm^3 */
|
||||
public float density;
|
||||
|
@ -138,16 +139,16 @@ public enum ChemElement
|
|||
public String elementName = "element";
|
||||
public String elementSymbol = "element";
|
||||
|
||||
private ChemElement(String name, String symbol, float atomicMass)
|
||||
private ChemElement(String name, String symbol, float atomicMass, ElementClassifications type, MatterPhase defaultPhase)
|
||||
{
|
||||
this.elementName = name;
|
||||
this.elementSymbol = symbol;
|
||||
this.atomicMass = atomicMass;
|
||||
}
|
||||
|
||||
private ChemElement(String name, String symbol, float atomicMass, float density)
|
||||
private ChemElement(String name, String symbol, float atomicMass, float density, ElementClassifications type, MatterPhase defaultPhase)
|
||||
{
|
||||
this(name, symbol, atomicMass);
|
||||
this(name, symbol, atomicMass, type, defaultPhase);
|
||||
this.density = density;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,16 +10,15 @@ public enum ChemThermal
|
|||
{
|
||||
/** Placeholder so that hydrogen starts as number one */
|
||||
ZERO(),
|
||||
Hydrogen(MatterPhase.Gas, 14.01f, 20.28f, 0.558f, 0.558f, 14300f),
|
||||
Helium(MatterPhase.Gas, 0, 4.22f, 0.02f, 0.083f, 5193.1f),
|
||||
Lithium(MatterPhase.Solid, 543.69f, 1615f, 3f, 147f, 3570f),
|
||||
Hydrogen(14.01f, 20.28f, 0.558f, 0.558f, 14300f),
|
||||
Helium(0, 4.22f, 0.02f, 0.083f, 5193.1f),
|
||||
Lithium(543.69f, 1615f, 3f, 147f, 3570f),
|
||||
Beryllium(),
|
||||
Boron(),
|
||||
Carbon(),
|
||||
Nitrogen(),
|
||||
Oxygen();
|
||||
|
||||
public MatterPhase phase = MatterPhase.Solid;
|
||||
public float meltingPointKelvin;
|
||||
public float boilingPointKelvin;
|
||||
/** kJ/mol */
|
||||
|
@ -37,9 +36,8 @@ public enum ChemThermal
|
|||
|
||||
}
|
||||
|
||||
private ChemThermal(MatterPhase phase, float meltingPoint, float boilingPoint, float fisionHeat, float vaporHeat, float specificHeat)
|
||||
private ChemThermal(float meltingPoint, float boilingPoint, float fisionHeat, float vaporHeat, float specificHeat)
|
||||
{
|
||||
this.phase = phase;
|
||||
this.meltingPointKelvin = meltingPoint;
|
||||
this.boilingPointKelvin = boilingPoint;
|
||||
this.heatOfFusion = fisionHeat;
|
||||
|
|
28
src/com/builtbroken/common/ElementClassifications.java
Normal file
28
src/com/builtbroken/common/ElementClassifications.java
Normal file
|
@ -0,0 +1,28 @@
|
|||
package com.builtbroken.common;
|
||||
|
||||
public enum ElementClassifications
|
||||
{
|
||||
nonmetal("Non-metal"),
|
||||
inertGas("Inert gas"),
|
||||
halogen("Halogen"),
|
||||
alkaliMetal("Alkali metal"),
|
||||
alkalineEarthMetal("Alkaline earth metal"),
|
||||
semimetallic("Metalloid"),
|
||||
otherMetal("Other metal"),
|
||||
transitionMetal("Transition metal"),
|
||||
lanthanide("Lanthanide"),
|
||||
actinide("Actinide");
|
||||
|
||||
final String name;
|
||||
|
||||
private ElementClassifications(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
}
|
|
@ -2,8 +2,8 @@ package com.builtbroken.common;
|
|||
|
||||
public enum MatterPhase
|
||||
{
|
||||
Solid(),
|
||||
Liquid(),
|
||||
Gas(),
|
||||
Plasma();
|
||||
solid(),
|
||||
liquid(),
|
||||
gas(),
|
||||
plasma();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue