本文整理汇总了C++中CKinematics::LL_BoneID方法的典型用法代码示例。如果您正苦于以下问题:C++ CKinematics::LL_BoneID方法的具体用法?C++ CKinematics::LL_BoneID怎么用?C++ CKinematics::LL_BoneID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CKinematics
的用法示例。
在下文中一共展示了CKinematics::LL_BoneID方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void CAI_Trader::g_WeaponBones (int &L, int &R1, int &R2)
{
CKinematics *V = smart_cast<CKinematics*>(Visual());
R1 = V->LL_BoneID("bip01_r_hand");
R2 = V->LL_BoneID("bip01_r_finger2");
L = V->LL_BoneID("bip01_l_finger1");
}
示例2:
void CObjectHandler::reinit (CAI_Stalker *object)
{
inherited::reinit ();
m_hammer_is_clutched = false;
planner().setup (object);
CKinematics *kinematics = smart_cast<CKinematics*>(planner().m_object->Visual());
m_r_hand = kinematics->LL_BoneID(pSettings->r_string(*planner().m_object->cNameSect(),"weapon_bone0"));
m_l_finger1 = kinematics->LL_BoneID(pSettings->r_string(*planner().m_object->cNameSect(),"weapon_bone1"));
m_r_finger2 = kinematics->LL_BoneID(pSettings->r_string(*planner().m_object->cNameSect(),"weapon_bone2"));
m_strap_object_id = ALife::_OBJECT_ID(-1);
m_strap_bone0 = -1;
m_strap_bone1 = -1;
m_clutched_hammer_enabled = false;
}
示例3:
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());
}
示例4: 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);
}
}
}
}
示例5:
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);
}
示例6:
CPhysicsShell* P_build_Shell (CGameObject* obj,bool not_active_state,LPCSTR fixed_bones)
{
U16Vec f_bones;
if(fixed_bones){
CKinematics* K = smart_cast<CKinematics*>(obj->Visual());
int count = _GetItemCount(fixed_bones);
for (int i=0 ;i<count; ++i){
string64 fixed_bone;
_GetItem (fixed_bones,i,fixed_bone);
f_bones.push_back(K->LL_BoneID(fixed_bone));
R_ASSERT2(BI_NONE!=f_bones.back(),"wrong fixed bone") ;
}
}
return P_build_Shell (obj,not_active_state,f_bones);
}
示例7: DieHelicopter
void CHelicopter::DieHelicopter()
{
if ( state() == CHelicopter::eDead )
return;
CEntity::Die(NULL);
m_engineSound.stop ();
m_brokenSound.create (pSettings->r_string(*cNameSect(), "broken_snd"),st_Effect,sg_SourceType);
m_brokenSound.play_at_pos (0,XFORM().c,sm_Looped);
CKinematics* K = smart_cast<CKinematics*>(Visual());
if(true /*!PPhysicsShell()*/){
string256 I;
LPCSTR bone;
u16 bone_id;
for (u32 i=0, n=_GetItemCount(*m_death_bones_to_hide); i<n; ++i){
bone = _GetItem(*m_death_bones_to_hide,i,I);
bone_id = K->LL_BoneID (bone);
K->LL_SetBoneVisible(bone_id,FALSE,TRUE);
}
///PPhysicsShell()=P_build_Shell (this,false);
PPhysicsShell()->EnabledCallbacks(TRUE);
PPhysicsShell()->set_ObjectContactCallback(CollisionCallbackDead);
PPhysicsShell()->set_ContactCallback(ContactShotMark);
}
Fvector lin_vel;
Fvector prev_pos = PositionStack.front().vPosition;
lin_vel.sub (XFORM().c,prev_pos);
if(Device.dwTimeGlobal != PositionStack.front().dwTime)
lin_vel.div((Device.dwTimeGlobal-PositionStack.front().dwTime)/1000.0f);
lin_vel.mul (m_death_lin_vel_k);
PPhysicsShell()->set_LinearVel (lin_vel);
PPhysicsShell()->set_AngularVel (m_death_ang_vel);
PPhysicsShell()->Enable ();
K->CalculateBones_Invalidate ();
K->CalculateBones ();
setState (CHelicopter::eDead);
m_engineSound.stop ();
processing_deactivate ();
m_dead = true;
}
示例8: OnH_A_Chield
void CArtefact::OnH_A_Chield()
{
inherited::OnH_A_Chield ();
StopLights();
if (GameID() == GAME_SINGLE)
{
if (*m_sParticlesName)
{
CParticlesPlayer::StopParticles(m_sParticlesName, BI_NONE, true);
}
}
else
{
CKinematics* K = smart_cast<CKinematics*>(H_Parent()->Visual());
if (K)
m_CarringBoneID = K->LL_BoneID("bip01_head");
else
m_CarringBoneID = u16(-1);
}
}
示例9: Hit
void CScriptGameObject::Hit(CScriptHit *tpLuaHit)
{
CScriptHit &tLuaHit = *tpLuaHit;
NET_Packet P;
SHit HS;
HS.GenHeader(GE_HIT,object().ID()); // object().u_EventGen(P,GE_HIT,object().ID());
THROW2 (tLuaHit.m_tpDraftsman,"Where is hit initiator??!"); // THROW2 (tLuaHit.m_tpDraftsman,"Where is hit initiator??!");
HS.whoID = u16(tLuaHit.m_tpDraftsman->ID()); // P.w_u16 (u16(tLuaHit.m_tpDraftsman->ID()));
HS.weaponID = 0; // P.w_u16 (0);
HS.dir = tLuaHit.m_tDirection; // P.w_dir (tLuaHit.m_tDirection);
HS.power = tLuaHit.m_fPower; // P.w_float (tLuaHit.m_fPower);
CKinematics *V = smart_cast<CKinematics*>(object().Visual()); // CKinematics *V = smart_cast<CKinematics*>(object().Visual());
VERIFY (V); // VERIFY (V);
if (xr_strlen (tLuaHit.m_caBoneName)) // if (xr_strlen (tLuaHit.m_caBoneName))
HS.boneID = (V->LL_BoneID(tLuaHit.m_caBoneName)); // P.w_s16 (V->LL_BoneID(tLuaHit.m_caBoneName));
else // else
HS.boneID = (s16(0)); // P.w_s16 (s16(0));
HS.p_in_bone_space = Fvector().set(0,0,0); // P.w_vec3 (Fvector().set(0,0,0));
HS.impulse = tLuaHit.m_fImpulse; // P.w_float (tLuaHit.m_fImpulse);
HS.hit_type = (ALife::EHitType)(tLuaHit.m_tHitType); // P.w_u16 (u16(tLuaHit.m_tHitType));
HS.Write_Packet(P);
object().u_EventSend(P);
}
示例10: net_Spawn
BOOL CHangingLamp::net_Spawn(CSE_Abstract* DC)
{
CSE_Abstract *e = (CSE_Abstract*)(DC);
CSE_ALifeObjectHangingLamp *lamp = smart_cast<CSE_ALifeObjectHangingLamp*>(e);
R_ASSERT (lamp);
inherited::net_Spawn (DC);
Fcolor clr;
// set bone id
// CInifile* pUserData = K->LL_UserData();
// R_ASSERT3 (pUserData,"Empty HangingLamp user data!",lamp->get_visual());
xr_delete(collidable.model);
if (Visual()){
CKinematics* K = smart_cast<CKinematics*>(Visual());
R_ASSERT (Visual()&&smart_cast<CKinematics*>(Visual()));
light_bone = K->LL_BoneID (*lamp->light_main_bone); VERIFY(light_bone!=BI_NONE);
ambient_bone = K->LL_BoneID (*lamp->light_ambient_bone);VERIFY(ambient_bone!=BI_NONE);
collidable.model = xr_new<CCF_Skeleton> (this);
// alpet: загрузка иммунитетов из спавн-конфига
CInifile* ini=K->LL_UserData();
if(ini && ini->section_exist("immunities")) CHitImmunity::LoadImmunities("immunities",ini);
}
fBrightness = lamp->brightness;
clr.set (lamp->color); clr.a = 1.f;
clr.mul_rgb (fBrightness);
light_render = ::Render->light_create();
light_render->set_shadow(!!lamp->flags.is(CSE_ALifeObjectHangingLamp::flCastShadow));
light_render->set_type (lamp->flags.is(CSE_ALifeObjectHangingLamp::flTypeSpot)?IRender_Light::SPOT:IRender_Light::POINT);
light_render->set_range (lamp->range);
light_render->set_color (clr);
light_render->set_cone (lamp->spot_cone_angle);
light_render->set_texture(*lamp->light_texture);
light_render->set_virtual_size(lamp->m_virtual_size);
if (lamp->glow_texture.size()) {
glow_render = ::Render->glow_create();
glow_render->set_texture(*lamp->glow_texture);
glow_render->set_color (clr);
glow_render->set_radius (lamp->glow_radius);
}
if (lamp->flags.is(CSE_ALifeObjectHangingLamp::flPointAmbient)){
ambient_power = lamp->m_ambient_power;
light_ambient = ::Render->light_create();
light_ambient->set_type (IRender_Light::POINT);
light_ambient->set_shadow(false);
clr.mul_rgb (ambient_power);
light_ambient->set_range(lamp->m_ambient_radius);
light_ambient->set_color(clr);
light_ambient->set_texture(*lamp->m_ambient_texture);
light_ambient->set_virtual_size(lamp->m_virtual_size);
}
fHealth = lamp->m_health;
lanim = LALib.FindItem(*lamp->color_animator);
CPHSkeleton::Spawn(e);
if (smart_cast<CKinematicsAnimated*>(Visual())) smart_cast<CKinematicsAnimated*> (Visual())->PlayCycle("idle");
if (smart_cast<CKinematics*>(Visual())){
smart_cast<CKinematics*> (Visual())->CalculateBones_Invalidate ();
smart_cast<CKinematics*> (Visual())->CalculateBones();
//.intepolate_pos
}
if (lamp->flags.is(CSE_ALifeObjectHangingLamp::flPhysic)&&!Visual())
Msg("! WARNING: lamp, obj name [%s],flag physics set, but has no visual",*cName());
//. if (lamp->flags.is(CSE_ALifeObjectHangingLamp::flPhysic)&&Visual()&&!guid_physic_bone) fHealth=0.f;
if (Alive()) TurnOn ();
else{
processing_activate (); // temporal enable
TurnOff (); // -> and here is disable :)
}
setVisible ((BOOL)!!Visual());
setEnabled ((BOOL)!!collidable.model);
return (TRUE);
}