MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / net_Spawn

Method net_Spawn

ogsr_engine/xrGame/ClimableObject.cpp:66–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64CClimableObject::~CClimableObject() {}
65void CClimableObject::Load(LPCSTR section) { inherited::Load(section); }
66BOOL 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}
114void CClimableObject::net_Destroy()
115{
116 inherited::net_Destroy();

Callers

nothing calls this directly

Calls 11

XFORMFunction · 0.85
P_BuildStaticGeomShellFunction · 0.85
xform_setMethod · 0.80
_maxFunction · 0.50
setMethod · 0.45
mulMethod · 0.45
transform_dirMethod · 0.45
subMethod · 0.45
SetMaterialMethod · 0.45
invertMethod · 0.45

Tested by

no test coverage detected