| 199 | } |
| 200 | |
| 201 | void 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 | } |
| 225 | void CPHSimpleCharacter::Create(dVector3 sizes) |
| 226 | { |
| 227 | if (b_exist) |
no test coverage detected