本文整理汇总了C++中CKinematics::LL_GetBoneInstance方法的典型用法代码示例。如果您正苦于以下问题:C++ CKinematics::LL_GetBoneInstance方法的具体用法?C++ CKinematics::LL_GetBoneInstance怎么用?C++ CKinematics::LL_GetBoneInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CKinematics
的用法示例。
在下文中一共展示了CKinematics::LL_GetBoneInstance方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void CDamageManager::HitScale (const int element, float& hit_scale, float& wound_scale, bool aim_bullet)
{
if(BI_NONE == u16(element))
{
//считаем что параметры для BI_NONE заданы как 1.f
hit_scale = 1.f * m_default_hit_factor;
wound_scale = 1.f * m_default_wound_factor;
return;
}
CKinematics* V = smart_cast<CKinematics*>(m_object->Visual()); VERIFY(V);
// get hit scale
float scale;
if (aim_bullet)
{
scale = V->LL_GetBoneInstance(u16(element)).get_param(3);
}
else
{
scale = V->LL_GetBoneInstance(u16(element)).get_param(0);
}
hit_scale = scale;
// get wound scale
scale = V->LL_GetBoneInstance(u16(element)).get_param(2);
wound_scale = scale;
}
示例2:
void CStalkerAnimationManager::assign_bone_callbacks ()
{
CKinematics *kinematics = smart_cast<CKinematicsAnimated*>(m_visual);
VERIFY (kinematics);
LPCSTR section = *object().cNameSect();
int head_bone = kinematics->LL_BoneID(pSettings->r_string(section,"bone_head"));
kinematics->LL_GetBoneInstance (u16(head_bone)).set_callback(bctCustom,&head::callback,&object());
int shoulder_bone = kinematics->LL_BoneID(pSettings->r_string(section,"bone_shoulder"));
kinematics->LL_GetBoneInstance (u16(shoulder_bone)).set_callback(bctCustom,&shoulder::callback,&object());
int spin_bone = kinematics->LL_BoneID(pSettings->r_string(section,"bone_spin"));
kinematics->LL_GetBoneInstance (u16(spin_bone)).set_callback(bctCustom,&spine::callback,&object());
}
示例3: load_section
void CDamageManager::load_section(LPCSTR section,CInifile* ini)
{
string32 buffer;
CKinematics *kinematics = smart_cast<CKinematics*>(m_object->Visual());
CInifile::Sect &damages = ini->r_section(section);
for (CInifile::SectCIt i=damages.Data.begin(); damages.Data.end() != i; ++i) {
if (xr_strcmp(*(*i).first,"default")) { // read all except default line
VERIFY (m_object);
int bone = kinematics->LL_BoneID(i->first);
R_ASSERT2 (BI_NONE != bone, *(*i).first);
CBoneInstance &bone_instance = kinematics->LL_GetBoneInstance(u16(bone));
bone_instance.set_param (0,(float)atof(_GetItem(*(*i).second,0,buffer)));
bone_instance.set_param (1,(float)atoi(_GetItem(*(*i).second,1,buffer)));
bone_instance.set_param (2,(float)atof(_GetItem(*(*i).second,2,buffer)));
if (_GetItemCount(*(*i).second) < 4)
{
bone_instance.set_param (3,(float)atof(_GetItem(*(*i).second,0,buffer)));
}
else
{
bone_instance.set_param (3,(float)atof(_GetItem(*(*i).second,3,buffer)));
}
if(0==bone && (fis_zero(bone_instance.get_param(0)) || fis_zero(bone_instance.get_param(2)) ) ){
string256 error_str;
sprintf_s(error_str,"hit_scale and wound_scale for root bone cannot be zero. see section [%s]",section);
R_ASSERT2(0,error_str);
}
}
}
}
示例4: VERIFY
void CParticlesPlayer::GetBonePos (CObject* pObject, u16 bone_id, const Fvector& offset, Fvector& result)
{
VERIFY(pObject);
CKinematics* pKinematics = smart_cast<CKinematics*>(pObject->Visual());
VERIFY(pKinematics);
CBoneInstance& l_tBoneInstance = pKinematics->LL_GetBoneInstance(bone_id);
result = offset;
l_tBoneInstance.mTransform.transform_tiny(result);
pObject->XFORM().transform_tiny(result);
}
示例5: init_bones
void CDamageManager::init_bones(LPCSTR section,CInifile* ini)
{
CKinematics *kinematics = smart_cast<CKinematics*>(m_object->Visual());
VERIFY (kinematics);
for(u16 i = 0; i<kinematics->LL_BoneCount(); i++)
{
CBoneInstance &bone_instance = kinematics->LL_GetBoneInstance(i);
bone_instance.set_param (0,m_default_hit_factor);
bone_instance.set_param (1,1.f);
bone_instance.set_param (2,m_default_wound_factor);
}
}
示例6: AddElement
void CPhysicObject::AddElement(CPhysicsElement* root_e, int id)
{
CKinematics* K = smart_cast<CKinematics*>(Visual());
CPhysicsElement* E = P_create_Element();
CBoneInstance& B = K->LL_GetBoneInstance(u16(id));
E->mXFORM.set (K->LL_GetTransform(u16(id)));
Fobb bb = K->LL_GetBox(u16(id));
if(bb.m_halfsize.magnitude()<0.05f)
{
bb.m_halfsize.add(0.05f);
}
E->add_Box (bb);
E->setMass (10.f);
E->set_ParentElement(root_e);
B.set_callback (bctPhysics,m_pPhysicsShell->GetBonesCallback(),E);
m_pPhysicsShell->add_Element (E);
if( !(m_type==epotFreeChain && root_e==0) )
{
CPhysicsJoint* J= P_create_Joint(CPhysicsJoint::full_control,root_e,E);
J->SetAnchorVsSecondElement (0,0,0);
J->SetAxisDirVsSecondElement (1,0,0,0);
J->SetAxisDirVsSecondElement (0,1,0,2);
J->SetLimits (-M_PI/2,M_PI/2,0);
J->SetLimits (-M_PI/2,M_PI/2,1);
J->SetLimits (-M_PI/2,M_PI/2,2);
m_pPhysicsShell->add_Joint (J);
}
CBoneData& BD = K->LL_GetData(u16(id));
for (vecBonesIt it=BD.children.begin(); BD.children.end() != it; ++it){
AddElement (E,(*it)->GetSelfID());
}
}