| 809 | } |
| 810 | } |
| 811 | void RenderPolyModel(tceffect *tce, float frametime, int xoff, int yoff, bool ok_to_render) { |
| 812 | /* |
| 813 | if(!ok_to_render) |
| 814 | return; |
| 815 | ASSERT(tce->type==EFX_POLYMODEL); |
| 816 | if(tce->polyinfo.handle==-1) |
| 817 | return false; |
| 818 | float k = tce->age; |
| 819 | //setup how much we're gonna rotate |
| 820 | float xrot = k*tce->polyinfo.m_Rot.x + tce->polyinfo.m_Ori.x; |
| 821 | float yrot = k*tce->polyinfo.m_Rot.y + tce->polyinfo.m_Ori.y; |
| 822 | float zrot = k*tce->polyinfo.m_Rot.z + tce->polyinfo.m_Ori.z; |
| 823 | //fade in speed 2.0f |
| 824 | k*=(1.0f/2.0f); |
| 825 | if (k > 1.3) { |
| 826 | k = 1.3f; |
| 827 | } |
| 828 | else |
| 829 | if (k < 0){ |
| 830 | k = 0.0f; |
| 831 | } |
| 832 | poly_model *pm=GetPolymodelPointer(tce->polyinfo.handle); |
| 833 | vector view_vec; |
| 834 | matrix view_orient; |
| 835 | float light_scalar; |
| 836 | //set all animation to default position |
| 837 | float norm_angles[MAX_SUBOBJECTS]; |
| 838 | for (int i=0;i<MAX_SUBOBJECTS;i++){ |
| 839 | norm_angles[i]=0; |
| 840 | } |
| 841 | //viewer at origin |
| 842 | vm_MakeIdentity(&view_orient); |
| 843 | vector pos; |
| 844 | pos.x = - (tce->polyinfo.m_Pos.x + (((float)glitch_dx)/tce->polyinfo.m_Pos.z)); |
| 845 | pos.y = - (tce->polyinfo.m_Pos.y + (((float)glitch_dy)/tce->polyinfo.m_Pos.z)); |
| 846 | pos.z = - tce->polyinfo.m_Pos.z; |
| 847 | |
| 848 | g3_StartFrame (&pos,&view_orient,D3_DEFAULT_ZOOM); |
| 849 | //shed some light on the subject |
| 850 | light_scalar = 0.86f; |
| 851 | //we need to rotate our model about Y 180 degrees so it faces the camera |
| 852 | vm_AnglesToMatrix(&view_orient,xrot,yrot,zrot); |
| 853 | tce->polyinfo.m_mOrient += view_orient; |
| 854 | vm_Orthogonalize(&tce->polyinfo.m_mOrient); |
| 855 | |
| 856 | //draw the polymodel with our little fade in effect |
| 857 | polymodel_effect pe={0}; |
| 858 | pe.type=PEF_ALPHA; |
| 859 | if(k>=0.3) |
| 860 | pe.alpha=k-0.3f; |
| 861 | else |
| 862 | pe.alpha=0.005f; |
| 863 | SetPolymodelEffect(&pe); |
| 864 | vm_MakeZero (&view_vec); |
| 865 | rend_SetZBufferState(1); |
| 866 | DrawPolygonModel(&view_vec,&tce->polyinfo.m_mOrient,tce->polyinfo.handle,norm_angles,0,light_scalar,light_scalar,light_scalar,0xFFFFFFFF,1); |
| 867 | //DrawPolygonModel(&m_Pos,&m_mOrient,m_iHandle,norm_angles,0,light_scalar,0xFFFFFFFF,1); |
| 868 | if(k<1) |