| 64 | CClimableObject::~CClimableObject() {} |
| 65 | void CClimableObject::Load(LPCSTR section) { inherited::Load(section); } |
| 66 | BOOL CClimableObject::net_Spawn(CSE_Abstract* DC) |
| 67 | { |
| 68 | CSE_Abstract* e = (CSE_Abstract*)(DC); |
| 69 | CSE_ALifeObjectClimable* CLB = smart_cast<CSE_ALifeObjectClimable*>(e); |
| 70 | const Fmatrix& b = CLB->shapes[0].data.box; |
| 71 | m_box.m_halfsize.set(b._11, b._22, b._33); |
| 72 | m_radius = _max(_max(m_box.m_halfsize.x, m_box.m_halfsize.y), m_box.m_halfsize.z); |
| 73 | |
| 74 | // m_box.m_halfsize.set(1.f,1.f,1.f); |
| 75 | BOOL ret = inherited::net_Spawn(DC); |
| 76 | const float f_min_width = 0.2f; |
| 77 | Fvector shift; |
| 78 | shift.set(0.f, 0.f, 0.f); |
| 79 | SORT( |
| 80 | b._11, m_axis.set(XFORM().i); m_axis.mul(m_box.m_halfsize.x), m_side.set(XFORM().i); m_side.mul(m_box.m_halfsize.x), m_norm.set(XFORM().i); |
| 81 | if (m_box.m_halfsize.x < f_min_width) { |
| 82 | m_box.m_halfsize.x = f_min_width; |
| 83 | shift.set(1.f, 0.f, 0.f); |
| 84 | }; |
| 85 | m_norm.mul(m_box.m_halfsize.x), b._22, m_axis.set(XFORM().j); m_axis.mul(m_box.m_halfsize.y), m_side.set(XFORM().j); m_side.mul(m_box.m_halfsize.y), m_norm.set(XFORM().j); |
| 86 | if (m_box.m_halfsize.y < f_min_width) { |
| 87 | m_box.m_halfsize.y = f_min_width; |
| 88 | shift.set(0.f, 1.f, 0.f); |
| 89 | }; |
| 90 | m_norm.mul(m_box.m_halfsize.y), b._33, m_axis.set(XFORM().k); m_axis.mul(m_box.m_halfsize.z), m_side.set(XFORM().k); m_side.mul(m_box.m_halfsize.z), m_norm.set(XFORM().k); |
| 91 | if (m_box.m_halfsize.z < f_min_width) { |
| 92 | m_box.m_halfsize.z = f_min_width; |
| 93 | shift.set(0.f, 0.f, 1.f); |
| 94 | }; |
| 95 | m_norm.mul(m_box.m_halfsize.z)); |
| 96 | shift.mul(f_min_width); |
| 97 | |
| 98 | XFORM().transform_dir(shift); |
| 99 | CObject::Position().sub(shift); |
| 100 | m_box.xform_set(Fidentity); |
| 101 | m_pStaticShell = xr_new<CPHLeaderGeomShell>(this); |
| 102 | P_BuildStaticGeomShell(smart_cast<CPHStaticGeomShell*>(m_pStaticShell), smart_cast<CGameObject*>(this), 0, m_box); |
| 103 | m_pStaticShell->SetMaterial("materials\\fake_ladders"); |
| 104 | |
| 105 | if (m_axis.y < 0.f) |
| 106 | { |
| 107 | m_axis.invert(); |
| 108 | m_side.invert(); |
| 109 | } |
| 110 | processing_deactivate(); |
| 111 | m_pStaticShell->set_ObjectContactCallback(ObjectContactCallback); |
| 112 | return ret; |
| 113 | } |
| 114 | void CClimableObject::net_Destroy() |
| 115 | { |
| 116 | inherited::net_Destroy(); |
nothing calls this directly
no test coverage detected