| 2775 | } |
| 2776 | |
| 2777 | int CScriptObjectEntity::GetBBox(IFunctionHandler *pH) |
| 2778 | { |
| 2779 | int phys=0; |
| 2780 | pH->GetParam(1,phys); |
| 2781 | Vec3 mins,maxs; |
| 2782 | |
| 2783 | CScriptObjectVector minVec(m_pScriptSystem,false); |
| 2784 | CScriptObjectVector maxVec(m_pScriptSystem,false); |
| 2785 | _SmartScriptObject res(m_pScriptSystem,false); |
| 2786 | |
| 2787 | if (m_pEntity) |
| 2788 | { |
| 2789 | Vec3 min,max; |
| 2790 | if(phys) |
| 2791 | { |
| 2792 | IPhysicalEntity *pPhysEnt = m_pEntity->GetPhysics(); |
| 2793 | if(m_pEntity->GetPhysics()) |
| 2794 | { |
| 2795 | pe_status_pos spos; |
| 2796 | pPhysEnt->GetStatus( &spos ); |
| 2797 | min=spos.BBox[0]; |
| 2798 | max=spos.BBox[1]; |
| 2799 | } |
| 2800 | } |
| 2801 | else |
| 2802 | { |
| 2803 | m_pEntity->GetBBox(min,max); |
| 2804 | } |
| 2805 | minVec=min; |
| 2806 | maxVec=max; |
| 2807 | res->SetValue("min",minVec); |
| 2808 | res->SetValue("max",maxVec); |
| 2809 | } |
| 2810 | |
| 2811 | return pH->EndFunction(res); |
| 2812 | } |
| 2813 | |
| 2814 | int CScriptObjectEntity::GetLocalBBox(IFunctionHandler *pH) |
| 2815 | { |
no test coverage detected