int BombObject::Display(TimeValue t, INode* inode, ViewExp *vpt, int flags) { if ( ! vpt || ! vpt->IsAlive() ) { // why are we here DbgAssert(!_T("Invalid viewport!")); return FALSE; } GraphicsWindow *gw = vpt->getGW(); Material *mtl = &swMtl; Matrix3 mat = inode->GetObjectTM(t); DWORD rlim = gw->getRndLimits(); gw->setRndLimits(GW_WIREFRAME|GW_EDGES_ONLY|/*GW_BACKCULL|*/ (rlim&GW_Z_BUFFER?GW_Z_BUFFER:0) );//removed BC 2/16/99 DB gw->setTransform(mat); if (inode->Selected()) gw->setColor( LINE_COLOR, GetSelColor()); else if(!inode->IsFrozen()) //gw->setColor( LINE_COLOR, swMtl.Kd[0], swMtl.Kd[1], swMtl.Kd[2]); gw->setColor(LINE_COLOR,GetUIColor(COLOR_SPACE_WARPS)); mesh.render(gw, mtl, NULL, COMP_ALL); if (hParam && GetWindowLongPtr(hParam,GWLP_USERDATA)==(LONG_PTR)this && GetFalloffOn(t)) { DrawLineProc lp(gw); DrawFalloffSphere(GetFalloff(t),lp); } gw->setRndLimits(rlim); return(0); }
int PBombObject::Display(TimeValue t, INode* inode, ViewExp *vpt, int flags) { GraphicsWindow *gw = vpt->getGW(); Material *mtl = &swMtl; Matrix3 mat = inode->GetObjectTM(t); // UpdateMesh(t); DWORD rlim = gw->getRndLimits(); gw->setRndLimits(GW_WIREFRAME|GW_EDGES_ONLY|/*GW_BACKCULL|*/ (rlim&GW_Z_BUFFER?GW_Z_BUFFER:0) );//removed BC 2/16/99 DB gw->setTransform(mat); if (inode->Selected()) gw->setColor( LINE_COLOR, GetSelColor()); else if(!inode->IsFrozen()) gw->setColor(LINE_COLOR,GetUIColor(COLOR_SPACE_WARPS)); mesh.render(gw, mtl, NULL, COMP_ALL); int dorange,hoopson; pblock->GetValue(PB_RANGEON,0,hoopson,FOREVER); pblock->GetValue(PB_DECAYTYPE,0,dorange,FOREVER); float length; if (hoopson && dorange) { pblock->GetValue(PB_DECAY,t,length,FOREVER); float range; range=length; BombDrawLineProc lp(gw); DrawFalloffSphere(range,lp); } gw->setRndLimits(rlim); return(0); }
void BombObject::GetWorldBoundBox(TimeValue t, INode* inode, ViewExp* vpt, Box3& box ) { if ( ! vpt || ! vpt->IsAlive() ) { box.Init(); return; } Box3 meshBox; Matrix3 mat = inode->GetObjectTM(t); box.Init(); if (hParam && GetWindowLongPtr(hParam,GWLP_USERDATA)==(LONG_PTR)this && GetFalloffOn(t)) { BoxLineProc bproc(&mat); DrawFalloffSphere(GetFalloff(t),bproc); box = bproc.Box(); } GetLocalBoundBox(t,inode,vpt,meshBox); for(int i = 0; i < 8; i++) box += mat * meshBox[i]; }
int WindObject::Display(TimeValue t, INode* inode, ViewExp *vpt, int flags) { if ( ! vpt || ! vpt->IsAlive() ) { // why are we here DbgAssert(!_T("Invalid viewport!")); return FALSE; } GraphicsWindow *gw = vpt->getGW(); Material *mtl = &swMtl; Matrix3 mat = inode->GetObjectTM(t); DWORD rlim = gw->getRndLimits(); gw->setRndLimits(GW_WIREFRAME|GW_EDGES_ONLY|/*GW_BACKCULL|*/ (rlim&GW_Z_BUFFER?GW_Z_BUFFER:0) );//removed BC 2/16/99 DB gw->setTransform(mat); if (inode->Selected()) gw->setColor( LINE_COLOR, GetSelColor()); else if(!inode->IsFrozen()) gw->setColor(LINE_COLOR,GetUIColor(COLOR_SPACE_WARPS)); mesh.render(gw, mtl, NULL, COMP_ALL); int hoopson;float decay; pblock2->GetValue(PB_HOOPSON,t,hoopson,FOREVER); pblock2->GetValue(PB_DECAY,t,decay,FOREVER); if (hoopson && (decay > 0.0f)) { int type;pblock2->GetValue(PB_TYPE,t,type,FOREVER); float range; range=(decay > 0.0f?0.6931472f / decay:0.0f); ModDrawLineProc lp(gw); if (type==FORCE_PLANAR) { float length; pblock2->GetValue(PB_DISPLENGTH,t,length,FOREVER); DrawPlaneRangeHoops(range,3.0f*length,lp); } else DrawFalloffSphere(range,lp); } gw->setRndLimits(rlim); return(0); }