Remove the procedural stuff more completely
This commit is contained in:
parent
ff890fe7b6
commit
07a986d39d
3 changed files with 0 additions and 125 deletions
src/main/java/StevenDimDoors
|
@ -68,7 +68,6 @@ import StevenDimDoors.mod_pocketDim.tileentities.TileEntityDimDoor;
|
|||
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityDimDoorGold;
|
||||
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityRift;
|
||||
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityTransTrapdoor;
|
||||
import StevenDimDoors.mod_pocketDim.util.l_systems.LSystem;
|
||||
import StevenDimDoors.mod_pocketDim.world.BiomeGenLimbo;
|
||||
import StevenDimDoors.mod_pocketDim.world.BiomeGenPocket;
|
||||
import StevenDimDoors.mod_pocketDim.world.DDBiomeGenBase;
|
||||
|
|
|
@ -21,8 +21,6 @@ import StevenDimDoors.mod_pocketDim.core.DimLink;
|
|||
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
import StevenDimDoors.mod_pocketDim.util.Point4D;
|
||||
import StevenDimDoors.mod_pocketDim.util.l_systems.LSystem;
|
||||
import StevenDimDoors.mod_pocketDim.util.l_systems.LSystem.PolygonStorage;
|
||||
import StevenDimDoors.mod_pocketDim.watcher.ClientLinkData;
|
||||
|
||||
public class TileEntityRift extends DDTileEntityBase
|
||||
|
|
|
@ -8,8 +8,6 @@ import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityRift;
|
||||
import StevenDimDoors.mod_pocketDim.util.l_systems.LSystem;
|
||||
import StevenDimDoors.mod_pocketDim.util.l_systems.LSystem.PolygonStorage;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
|
@ -44,124 +42,4 @@ public class RenderRift extends TileEntitySpecialRenderer
|
|||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
/**
|
||||
* method that draws the fractal and applies animations/effects
|
||||
*
|
||||
* f
|
||||
*
|
||||
* @param riftRotation
|
||||
* @param poly
|
||||
* @param size
|
||||
* @param xWorld
|
||||
* @param yWorld
|
||||
* @param zWorld
|
||||
*/
|
||||
public void drawCrack(int riftRotation, PolygonStorage poly, double size, double xWorld, double yWorld, double zWorld)
|
||||
{
|
||||
// calculate the proper size for the rift render
|
||||
double scale = size / (poly.maxX - poly.minX);
|
||||
|
||||
// calculate the midpoint of the fractal bounding box
|
||||
double offsetX = ((poly.maxX + poly.minX)) / 2;
|
||||
double offsetY = ((poly.maxY + poly.minY)) / 2;
|
||||
double offsetZ = 0;
|
||||
|
||||
// changes how far the triangles move
|
||||
float motionMagnitude = 3.0F;
|
||||
|
||||
// changes how quickly the triangles move
|
||||
float motionSpeed = 2000.0F;
|
||||
|
||||
// number of individual jitter waveforms to generate
|
||||
// changes how "together" the overall motions are
|
||||
int jCount = 5;
|
||||
|
||||
// Calculate jitter like for monoliths
|
||||
float time = (float) (((Minecraft.getSystemTime() + 0xF1234568 * this.hashCode()) % 2000000) / motionSpeed);
|
||||
double[] jitters = new double[jCount];
|
||||
|
||||
// generate a series of waveforms
|
||||
for (int i = 0; i < jCount - 1; i += 1)
|
||||
{
|
||||
jitters[i] = Math.sin((1F + i / 10F) * time) * Math.cos(1F - (i / 10F) * time) / motionMagnitude;
|
||||
jitters[i + 1] = Math.cos((1F + i / 10F) * time) * Math.sin(1F - (i / 10F) * time) / motionMagnitude;
|
||||
|
||||
}
|
||||
|
||||
// determines which jitter waveform we select. Modulo so the same point
|
||||
// gets the same jitter waveform over multiple frames
|
||||
int jIndex = 0;
|
||||
// set the color for the render
|
||||
GL11.glColor4f(.1F, .1F, .1F, 1F);
|
||||
|
||||
// set the blending mode
|
||||
GL11.glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_ONE_MINUS_SRC_COLOR, GL_ONE);
|
||||
GL11.glBegin(GL11.GL_TRIANGLES);
|
||||
for (Point p : poly.points)
|
||||
{
|
||||
jIndex = Math.abs(((p.x + p.y) * (p.x + p.y + 1) / 2) + p.y);
|
||||
// jIndex++;
|
||||
// calculate the rotation for the fractal, apply offset, and apply
|
||||
// jitter
|
||||
double x = (((p.x + jitters[(jIndex + 1) % jCount]) - offsetX) * Math.cos(Math.toRadians(riftRotation)) - (jitters[(jIndex + 2) % jCount])
|
||||
* Math.sin(Math.toRadians(riftRotation)));
|
||||
double y = p.y + (jitters[jIndex % jCount]) - offsetY;
|
||||
double z = (((p.x + jitters[(jIndex + 2) % jCount]) - offsetX) * Math.sin(Math.toRadians(riftRotation)) + (jitters[(jIndex + 2) % jCount])
|
||||
* Math.cos(Math.toRadians(riftRotation)));
|
||||
|
||||
// apply scaling
|
||||
x *= scale;
|
||||
y *= scale;
|
||||
z *= scale;
|
||||
|
||||
// apply transform to center the offset origin into the middle of a
|
||||
// block
|
||||
x += .5;
|
||||
y += .5;
|
||||
z += .5;
|
||||
|
||||
// draw the vertex and apply the world (screenspace) relative
|
||||
// coordinates
|
||||
GL11.glVertex3d(xWorld + x, yWorld + y, zWorld + z);
|
||||
}
|
||||
GL11.glEnd();
|
||||
|
||||
GL11.glColor4f(.3F, .3F, .3F, .2F);
|
||||
|
||||
glBlendFunc(GL_ONE_MINUS_DST_COLOR, GL_ZERO);
|
||||
|
||||
// draw the next set of triangles to form a background and change their
|
||||
// color slightly over time
|
||||
GL11.glBegin(GL11.GL_TRIANGLES);
|
||||
for (Point p : poly.points)
|
||||
{
|
||||
jIndex++;
|
||||
|
||||
double x = (((p.x) - offsetX) * Math.cos(Math.toRadians(riftRotation)) - 0 * Math.sin(Math.toRadians(riftRotation)));
|
||||
double y = p.y - offsetY;
|
||||
double z = (((p.x) - offsetX) * Math.sin(Math.toRadians(riftRotation)) + 0 * Math.cos(Math.toRadians(riftRotation)));
|
||||
|
||||
x *= scale;
|
||||
y *= scale;
|
||||
z *= scale;
|
||||
|
||||
x += .5;
|
||||
y += .5;
|
||||
z += .5;
|
||||
|
||||
if (jIndex % 3 == 0)
|
||||
{
|
||||
// GL11.glColor4d(1-jitters[(jIndex + 5) % jCount] / 11,1-
|
||||
// jitters[(jIndex + 4) % jCount] / 8, 1-jitters[(jIndex+3) %
|
||||
// jCount] / 8, 1);
|
||||
}
|
||||
GL11.glVertex3d(xWorld + x, yWorld + y, zWorld + z);
|
||||
}
|
||||
|
||||
// stop drawing triangles
|
||||
GL11.glEnd();
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue