www.pudn.com > 3dtennis.rar > C3DObj.java


// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov. 
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html 
// Decompiler options: packimports(3) fieldsfirst ansi  
 
import com.mascotcapsule.micro3d.v3.*; 
 
class C3DObj 
{ 
 
    protected static FigureLayout Layout; 
    protected static CMat PutMat; 
    protected static Effect3D Effect[] = new Effect3D[3]; 
    protected static Light gLight; 
    protected static int Pers; 
    protected Figure gFigure; 
    protected Vector3D Pos; 
    protected Vector3D Ang; 
    protected CMat Mat; 
    protected CMat ShadowMat; 
 
    static void SetCamMat() 
    { 
        PutMat.Base(); 
        PutMat.mul(C3D.gCam); 
    } 
 
    C3DObj() 
    { 
        Pos = new Vector3D(); 
        Ang = new Vector3D(); 
        Mat = new CMat(); 
        ShadowMat = new CMat(); 
        Vector3D vector3d = new Vector3D(-100, 100, 100); 
        vector3d.unit(); 
        gLight = new Light(vector3d, 4096, 2000); 
        Effect[1] = new Effect3D(null, 0, false, null); 
        Effect[0] = new Effect3D(gLight, 0, false, null); 
        Effect[2] = new Effect3D(null, 0, true, null); 
    } 
 
    void Draw(Graphics3D graphics3d) 
    { 
        Draw(graphics3d, 1); 
    } 
 
    void Draw(Graphics3D graphics3d, int i) 
    { 
        PutMat.mul(C3D.gCam, Mat); 
        graphics3d.drawFigure(gFigure, 0, 0, Layout, Effect[i]); 
    } 
 
    void Render(Graphics3D graphics3d, int i) 
    { 
        PutMat.mul(C3D.gCam, Mat); 
        graphics3d.renderFigure(gFigure, 0, 0, Layout, Effect[i]); 
    } 
 
    void SetGeo(int i, int j, int k, int l) 
    { 
        Pos.x = i; 
        Pos.y = j; 
        Pos.z = k; 
        Ang.y = l; 
        Mat.Base(); 
        Mat.SetTrans(Pos.x, Pos.y, Pos.z); 
        Mat.Yrot(l); 
    } 
 
    void SetMdl(Figure figure) 
    { 
        gFigure = figure; 
    } 
 
    static  
    { 
        Layout = new FigureLayout(); 
        PutMat = new CMat(); 
        Layout.setAffineTrans(PutMat); 
    } 
}