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

Method attach_Actor

ogsr_engine/xrGame/WeaponMounted.cpp:246–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

244
245bool CWeaponMounted::Use(const Fvector& pos, const Fvector& dir, const Fvector& foot_pos) { return !Owner(); }
246bool CWeaponMounted::attach_Actor(CGameObject* actor)
247{
248 m_dAngle.set(0.0f, 0.0f);
249 CHolderCustom::attach_Actor(actor);
250 IKinematics* K = smart_cast<IKinematics*>(Visual());
251 // убрать оружие из рук
252 // disable shell callback
253 m_pPhysicsShell->EnabledCallbacks(FALSE);
254 // enable actor rotate callback
255 CBoneInstance& biX = smart_cast<IKinematics*>(Visual())->LL_GetBoneInstance(rotate_x_bone);
256 biX.set_callback(bctCustom, BoneCallbackX, this);
257 CBoneInstance& biY = smart_cast<IKinematics*>(Visual())->LL_GetBoneInstance(rotate_y_bone);
258 biY.set_callback(bctCustom, BoneCallbackY, this);
259 // set actor to mounted position
260 const Fmatrix& A = K->LL_GetTransform(actor_bone);
261 Fvector ap;
262 XFORM().transform_tiny(ap, A.c);
263 Fmatrix AP;
264 AP.translate(ap);
265 if (OwnerActor())
266 OwnerActor()->SetPhPosition(AP);
267 processing_activate();
268 return true;
269}
270void CWeaponMounted::detach_Actor()
271{
272 CHolderCustom::detach_Actor();

Callers

nothing calls this directly

Calls 9

VisualFunction · 0.85
XFORMFunction · 0.85
OwnerActorFunction · 0.85
EnabledCallbacksMethod · 0.80
set_callbackMethod · 0.80
transform_tinyMethod · 0.80
SetPhPositionMethod · 0.80
setMethod · 0.45
translateMethod · 0.45

Tested by

no test coverage detected