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

Method Init

ogsr_engine/xrGame/CarWheels.cpp:51–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49 return false;
50}
51void CCar::SWheel::Init()
52{
53 if (inited)
54 return;
55 BONE_P_PAIR_CIT bone = bone_map.find(bone_id);
56 R_ASSERT2(bone->second.element, "No Element was created for wheel. Check collision is set");
57 bone->second.element->set_DynamicLimits(default_l_limit, default_w_limit * 100.f);
58 CPhysicsElement* e = bone->second.element;
59 CPhysicsJoint* j = bone->second.joint;
60 radius = e->getRadius();
61 R_ASSERT2(j, "No wheel joint was set for a wheel");
62 joint = j;
63 joint->SetBackRef(&joint);
64 R_ASSERT2(dJointGetType(joint->GetDJoint()) == dJointTypeHinge2, "No wheel join was set for a wheel, only wheel-joint valid!!!");
65 ApplyDriveAxisVelTorque(0.f, 0.f);
66 e->add_ObjectContactCallback(WheellCollisionCallback);
67 e->set_CallbackData((void*)&collision_params);
68 e->SetAirResistance(0, 0);
69 inited = true;
70}
71void CCar::SWheel::Load(LPCSTR section)
72{
73 IKinematics* K = PKinematics(car->Visual());

Callers

nothing calls this directly

Calls 15

dJointGetTypeFunction · 0.85
dJointSetHinge2ParamFunction · 0.85
SetBackRefMethod · 0.80
GetDJointMethod · 0.80
VisualMethod · 0.80
GetLimitsMethod · 0.80
LL_UserDataMethod · 0.80
ApplySteerAxisTorqueMethod · 0.80
ApplySteerAxisVelMethod · 0.80
findMethod · 0.45
set_DynamicLimitsMethod · 0.45
getRadiusMethod · 0.45

Tested by

no test coverage detected