本文整理汇总了C++中CKinematics::LL_GetData方法的典型用法代码示例。如果您正苦于以下问题:C++ CKinematics::LL_GetData方法的具体用法?C++ CKinematics::LL_GetData怎么用?C++ CKinematics::LL_GetData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CKinematics
的用法示例。
在下文中一共展示了CKinematics::LL_GetData方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Level
//проверка на попадание "осколком" по объекту
ICF static BOOL grenade_hit_callback(collide::rq_result& result, LPVOID params)
{
SExpQParams& ep = *(SExpQParams*)params;
u16 mtl_idx = GAMEMTL_NONE_IDX;
if(result.O){
CKinematics* V = 0;
if (0!=(V=smart_cast<CKinematics*>(result.O->Visual()))){
CBoneData& B= V->LL_GetData((u16)result.element);
mtl_idx = B.game_mtl_idx;
}
}else{
//получить треугольник и узнать его материал
CDB::TRI* T = Level().ObjectSpace.GetStaticTris()+result.element;
mtl_idx = T->material;
}
SGameMtl* mtl = GMLib.GetMaterialByIdx(mtl_idx);
ep.shoot_factor *=mtl->fShootFactor;
#ifdef DEBUG
if(ph_dbg_draw_mask.test(phDbgDrawExplosions))
{
Fvector p;p.set(ep.l_dir);p.mul(result.range);p.add(ep.source_p);
u8 c =u8(mtl->fShootFactor*255.f);
DBG_DrawPoint(p,0.1f,D3DCOLOR_XRGB(255-c,0,c));
}
#endif
return (ep.shoot_factor>0.01f);
}
示例2: Execute
virtual void Execute(LPCSTR arguments)
{
if (!arguments || !*arguments) {
Msg ("! no arguments passed");
return;
}
string_path name;
string_path fn;
if (0==strext(arguments))
strconcat (sizeof(name),name,arguments,".ogf");
else
strcpy_s (name,sizeof(name),arguments);
if (!FS.exist(arguments) && !FS.exist(fn, "$level$", name) && !FS.exist(fn, "$game_meshes$", name)) {
Msg ("! Cannot find visual \"%s\"",arguments);
return;
}
IRender_Visual *visual = Render->model_Create(arguments);
CKinematics *kinematics = smart_cast<CKinematics*>(visual);
if (!kinematics) {
Render->model_Delete(visual);
Msg ("! Invalid visual type \"%s\" (not a CKinematics)",arguments);
return;
}
Msg ("bones for model \"%s\"",arguments);
for (u16 i=0, n=kinematics->LL_BoneCount(); i<n; ++i)
Msg ("%s",*kinematics->LL_GetData(i).name);
Render->model_Delete (visual);
}
示例3:
CCarWeapon::CCarWeapon(CPhysicsShellHolder* obj)
{
m_bActive = false;
m_bAutoFire = false;
m_object = obj;
m_Ammo = xr_new<CCartridge>();
CKinematics* K = smart_cast<CKinematics*>(m_object->Visual());
CInifile* pUserData = K->LL_UserData();
m_rotate_x_bone = K->LL_BoneID (pUserData->r_string("mounted_weapon_definition","rotate_x_bone"));
m_rotate_y_bone = K->LL_BoneID (pUserData->r_string("mounted_weapon_definition","rotate_y_bone"));
m_fire_bone = K->LL_BoneID (pUserData->r_string("mounted_weapon_definition","fire_bone"));
m_min_gun_speed = pUserData->r_float("mounted_weapon_definition","min_gun_speed");
m_max_gun_speed = pUserData->r_float("mounted_weapon_definition","max_gun_speed");
CBoneData& bdX = K->LL_GetData(m_rotate_x_bone); //VERIFY(bdX.IK_data.type==jtJoint);
m_lim_x_rot.set (bdX.IK_data.limits[0].limit.x,bdX.IK_data.limits[0].limit.y);
CBoneData& bdY = K->LL_GetData(m_rotate_y_bone); //VERIFY(bdY.IK_data.type==jtJoint);
m_lim_y_rot.set (bdY.IK_data.limits[1].limit.x,bdY.IK_data.limits[1].limit.y);
xr_vector<Fmatrix> matrices;
K->LL_GetBindTransform (matrices);
m_i_bind_x_xform.invert (matrices[m_rotate_x_bone]);
m_i_bind_y_xform.invert (matrices[m_rotate_y_bone]);
m_bind_x_rot = matrices[m_rotate_x_bone].k.getP();
m_bind_y_rot = matrices[m_rotate_y_bone].k.getH();
m_bind_x.set (matrices[m_rotate_x_bone].c);
m_bind_y.set (matrices[m_rotate_y_bone].c);
m_cur_x_rot = m_bind_x_rot;
m_cur_y_rot = m_bind_y_rot;
m_destEnemyDir.setHP (m_bind_y_rot,m_bind_x_rot);
m_object->XFORM().transform_dir (m_destEnemyDir);
inheritedShooting::Light_Create ();
Load (pUserData->r_string("mounted_weapon_definition","wpn_section"));
SetBoneCallbacks ();
m_object->processing_activate ();
m_weapon_h = matrices[m_rotate_y_bone].c.y;
m_fire_norm.set (0,1,0);
m_fire_dir.set (0,0,1);
m_fire_pos.set (0,0,0);
}
示例4: 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());
}
}