⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cubemodel.java

📁 一个java写的魔方游戏
💻 JAVA
字号:
// FrontEnd Plus GUI for JAD
// DeCompiled : CubeModel.class

import java.awt.Graphics;
import java.util.Vector;

class CubeModel extends Model3D
{

    CubeModel(Vertex vertex)
    {
        super(vertex);
    }

    public Vertex Unproject(float f, float f1)
    {
        Matrix3D matrix3d = ViewMat.Inverse();
        for(int i = 3; i < 6; i++)
        {
            Vertex vertex = new Vertex();
            Vertex vertex1 = new Vertex(f, f1, ((CubeFace)Faces.elementAt(i)).Unproject(f, f1));
            matrix3d.Transform(vertex1, vertex);
            float f2 = vertex.x;
            float f3 = vertex.y;
            float f4 = vertex.z;
            float f5 = f2 <= 0.0F ? f2 >= -3F ? f2 + 3F : -3F - f2 : f2 <= 3F ? 3F - f2 : f2 - 3F;
            if((double)f5 < 0.0001D && f3 >= -3F && f3 <= 3F && f4 >= -3F && f4 <= 3F)
            {
                vertex.x = f2 <= 0.0F ? -3 : 3;
                return vertex;
            }
            float f6 = f3 <= 0.0F ? f3 >= -3F ? f3 + 3F : -3F - f3 : f3 <= 3F ? 3F - f3 : f3 - 3F;
            if((double)f6 < 0.0001D && f2 >= -3F && f2 <= 3F && f4 >= -3F && f4 <= 3F)
            {
                vertex.y = f3 <= 0.0F ? -3 : 3;
                return vertex;
            }
            float f7 = f4 <= 0.0F ? f4 >= -3F ? f4 + 3F : -3F - f4 : f4 <= 3F ? 3F - f4 : f4 - 3F;
            if((double)f7 < 0.0001D && f2 >= -3F && f2 <= 3F && f3 >= -3F && f3 <= 3F)
            {
                vertex.z = f4 <= 0.0F ? -3 : 3;
                return vertex;
            }
        }

        return null;
    }

    public synchronized void Paint(Graphics g, int i, int j)
    {
        Sort();
        for(int k = 3; k < 6; k++)
        {
            Face face = (Face)Faces.elementAt(k);
            face.Paint(g, i, j);
        }

    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -