Id[s] made more consistent by capitalizing to ID[s]

Cinematic camera fields renamed and documented
This commit is contained in:
thedaneeffect committed 2023-01-01 13:59:10 -05:00
1 parent 2ed0f2a04d
commit c696ab13ff
14 files changed
+1387 -1201

No files matched your search

+82 -79
View File
@@ -4,103 +4,106 @@
public class ProjectileEntity extends Entity {
public final int anInt1571;
public final int anInt1572;
public final int anInt1580;
public final int anInt1581;
public final int anInt1582;
public final int anInt1583;
public final int anInt1588;
public final int anInt1589;
public final int anInt1590;
public final SpotAnimType aType_1592;
public final int anInt1597;
public double aDouble1574;
public double aDouble1575;
public double aDouble1576;
public double aDouble1577;
public double aDouble1578;
public boolean aBoolean1579 = false;
public double aDouble1585;
public double aDouble1586;
public double aDouble1587;
public int anInt1593;
public int anInt1594;
public int anInt1595;
public int anInt1596;
public final int startCycle;
public final int lastCycle;
public final int srcX;
public final int srcZ;
public final int srcY;
public final int offsetY;
public final int peakPitch;
public final int arc;
public final int target;
public final SpotAnimType spotanim;
public final int plane;
public double velocityX;
public double velocityZ;
public double velocity;
public double velocityY;
public double accelerationY;
public boolean mobile = false;
public double x;
public double z;
public double y;
public int seqFrame;
public int seqCycle;
public int yaw;
public int pitch;
public ProjectileEntity(int i, int j, int l, int i1, int j1, int k1, int l1, int i2, int j2, int k2, int l2) {
aType_1592 = SpotAnimType.instances[l2];
anInt1597 = k1;
anInt1580 = j2;
anInt1581 = i2;
anInt1582 = l1;
anInt1571 = l;
anInt1572 = i1;
anInt1588 = i;
anInt1589 = j1;
anInt1590 = k2;
anInt1583 = j;
public ProjectileEntity(int peakPitch, int offsetY, int startCycle, int lastCycle, int arc, int plane, int srcY, int srcZ, int srcX, int target, int spotanim) {
this.spotanim = SpotAnimType.instances[spotanim];
this.plane = plane;
this.srcX = srcX;
this.srcZ = srcZ;
this.srcY = srcY;
this.startCycle = startCycle;
this.lastCycle = lastCycle;
this.peakPitch = peakPitch;
this.arc = arc;
this.target = target;
this.offsetY = offsetY;
}
public void method455(int i, int j, int k, int l) {
if (!aBoolean1579) {
double d = l - anInt1580;
double d2 = j - anInt1581;
double d3 = Math.sqrt((d * d) + (d2 * d2));
aDouble1585 = (double) anInt1580 + ((d * (double) anInt1589) / d3);
aDouble1586 = (double) anInt1581 + ((d2 * (double) anInt1589) / d3);
aDouble1587 = anInt1582;
public void updateVelocity(int cycle, int dstZ, int dstY, int dstX) {
if (!mobile) {
double dx = dstX - srcX;
double dz = dstZ - srcZ;
double d = Math.sqrt((dx * dx) + (dz * dz));
x = (double) srcX + ((dx * (double) arc) / d);
z = (double) srcZ + ((dz * (double) arc) / d);
y = srcY;
}
double d1 = (anInt1572 + 1) - i;
aDouble1574 = ((double) l - aDouble1585) / d1;
aDouble1575 = ((double) j - aDouble1586) / d1;
aDouble1576 = Math.sqrt((aDouble1574 * aDouble1574) + (aDouble1575 * aDouble1575));
if (!aBoolean1579) {
aDouble1577 = -aDouble1576 * Math.tan((double) anInt1588 * 0.02454369D);
double dt = (lastCycle + 1) - cycle;
velocityX = ((double) dstX - x) / dt;
velocityZ = ((double) dstZ - z) / dt;
velocity = Math.sqrt((velocityX * velocityX) + (velocityZ * velocityZ));
if (!mobile) {
velocityY = -velocity * Math.tan((double) peakPitch * 0.02454369D);
}
aDouble1578 = (2D * ((double) k - aDouble1587 - (aDouble1577 * d1))) / (d1 * d1);
accelerationY = (2D * ((double) dstY - y - (velocityY * dt))) / (dt * dt);
}
@Override
public Model getModel() {
Model model = aType_1592.getModel();
if (model == null) {
Model tmp = spotanim.getModel();
if (tmp == null) {
return null;
}
int transformID = -1;
if (aType_1592.seq != null) {
transformID = aType_1592.seq.transformIndices[anInt1593];
if (spotanim.seq != null) {
transformID = spotanim.seq.transformIndices[seqFrame];
}
Model model_1 = new Model(true, SeqTransform.isNull(transformID), false, model);
Model model = new Model(true, SeqTransform.isNull(transformID), false, tmp);
if (transformID != -1) {
model_1.createLabelReferences();
model_1.applyTransform(transformID);
model_1.labelFaces = null;
model_1.labelVertices = null;
model.createLabelReferences();
model.applyTransform(transformID);
model.labelFaces = null;
model.labelVertices = null;
}
if ((aType_1592.scaleXY != 128) || (aType_1592.scaleZ != 128)) {
model_1.scale(aType_1592.scaleXY, aType_1592.scaleXY, aType_1592.scaleZ);
if ((spotanim.scaleXY != 128) || (spotanim.scaleZ != 128)) {
model.scale(spotanim.scaleXY, spotanim.scaleXY, spotanim.scaleZ);
}
model_1.rotateX(anInt1596);
model_1.calculateNormals(64 + aType_1592.lightAmbient, 850 + aType_1592.lightAttenuation, -30, -50, -30, true);
return model_1;
model.rotateX(pitch);
model.calculateNormals(64 + spotanim.lightAmbient, 850 + spotanim.lightAttenuation, -30, -50, -30, true);
return model;
}
public void method456(int i) {
aBoolean1579 = true;
aDouble1585 += aDouble1574 * (double) i;
aDouble1586 += aDouble1575 * (double) i;
aDouble1587 += (aDouble1577 * (double) i) + (0.5D * aDouble1578 * (double) i * (double) i);
aDouble1577 += aDouble1578 * (double) i;
anInt1595 = ((int) (Math.atan2(aDouble1574, aDouble1575) * 325.94900000000001D) + 1024) & 0x7ff;
anInt1596 = (int) (Math.atan2(aDouble1577, aDouble1576) * 325.94900000000001D) & 0x7ff;
if (aType_1592.seq != null) {
for (anInt1594 += i; anInt1594 > aType_1592.seq.getFrameDuration(anInt1593); ) {
anInt1594 -= aType_1592.seq.getFrameDuration(anInt1593) + 1;
anInt1593++;
if (anInt1593 >= aType_1592.seq.frameCount) {
anInt1593 = 0;
public void update(int delta) {
mobile = true;
x += velocityX * (double) delta;
z += velocityZ * (double) delta;
y += (velocityY * (double) delta) + (0.5D * accelerationY * (double) delta * (double) delta);
velocityY += accelerationY * (double) delta;
yaw = ((int) (Math.atan2(velocityX, velocityZ) * 325.94900000000001D) + 1024) & 0x7ff;
pitch = (int) (Math.atan2(velocityY, velocity) * 325.94900000000001D) & 0x7ff;
if (spotanim.seq != null) {
for (seqCycle += delta; seqCycle > spotanim.seq.getFrameDuration(seqFrame); ) {
seqCycle -= spotanim.seq.getFrameDuration(seqFrame) + 1;
seqFrame++;
if (seqFrame >= spotanim.seq.frameCount) {
seqFrame = 0;
}
}
}