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

Method SetBox

ogsr_engine/xrGame/PHSimpleCharacter.cpp:201–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199}
200
201void CPHSimpleCharacter::SetBox(const dVector3& sizes)
202{
203 m_radius = _min(sizes[0], sizes[2]) / 2.f;
204 m_cyl_hight = sizes[1] - 2.f * m_radius;
205 if (m_cyl_hight < 0.f)
206 m_cyl_hight = 0.01f;
207 const dReal k = 1.20f;
208 dReal doun = m_radius * _sqrt(1.f - 1.f / k / k) / 2.f;
209 // m_geom_shell=dCreateCylinder(0,m_radius/k,m_cyl_hight+doun);
210 dGeomCylinderSetParams(m_geom_shell, m_radius / k, m_cyl_hight + doun);
211 // m_wheel=dCreateSphere(0,m_radius);
212 dGeomSphereSetRadius(m_wheel, m_radius);
213 // m_hat=dCreateSphere(0,m_radius/k);
214 dGeomSphereSetRadius(m_hat, m_radius / k);
215
216 dGeomSetPosition(m_hat, 0.f, m_cyl_hight, 0.f);
217 dGeomSetPosition(m_geom_shell, 0.f, m_cyl_hight / 2.f - doun, 0.f);
218
219 float test_radius = m_radius * 2.f;
220 float test_height = test_radius + m_radius / 2.f;
221 // m_cap=dCreateSphere(0,test_radius);
222 dGeomSphereSetRadius(m_cap, test_radius);
223 dGeomSetPosition(m_cap, 0.f, test_height, 0.f);
224}
225void CPHSimpleCharacter::Create(dVector3 sizes)
226{
227 if (b_exist)

Callers 3

LoadMethod · 0.45
ActivateBoxMethod · 0.45
InterpolateBoxMethod · 0.45

Calls 5

_sqrtFunction · 0.85
dGeomCylinderSetParamsFunction · 0.85
dGeomSphereSetRadiusFunction · 0.85
dGeomSetPositionFunction · 0.85
_minFunction · 0.50

Tested by

no test coverage detected