本文整理汇总了C++中CKinematics::LL_UserData方法的典型用法代码示例。如果您正苦于以下问题:C++ CKinematics::LL_UserData方法的具体用法?C++ CKinematics::LL_UserData怎么用?C++ CKinematics::LL_UserData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CKinematics
的用法示例。
在下文中一共展示了CKinematics::LL_UserData方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void CCar::SWheelBreak::Load(LPCSTR section)
{
CKinematics *K =PKinematics(pwheel->car->Visual()) ;
CInifile *ini =K->LL_UserData() ;
VERIFY (ini) ;
break_torque = ini->r_float("car_definition","break_torque") ;
hand_break_torque = READ_IF_EXISTS(ini,r_float,"car_definition","hand_break_torque",break_torque) ;
if(ini->section_exist(section))
{
break_torque =READ_IF_EXISTS(ini,r_float,section,"break_torque",break_torque);
hand_break_torque =READ_IF_EXISTS(ini,r_float,section,"hand_break_torque",hand_break_torque);
}
}
示例2:
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);
}
示例3: if
void CCar::SWheel::Load(LPCSTR section)
{
CKinematics *K =PKinematics(car->Visual()) ;
CInifile *ini =K->LL_UserData() ;
VERIFY (ini) ;
if(ini->section_exist(section))
{
collision_params.damping_factor =READ_IF_EXISTS(ini,r_float,section,"damping_factor",collision_params.damping_factor);
collision_params.spring_factor =READ_IF_EXISTS(ini,r_float,section,"spring_factor",collision_params.spring_factor);
collision_params.mu_factor =READ_IF_EXISTS(ini,r_float,section,"friction_factor",collision_params.mu_factor);
}
else if(ini->section_exist("wheels_params"))
{
collision_params.damping_factor =ini->r_float("wheels_params","damping_factor") ;
collision_params.spring_factor =ini->r_float("wheels_params","spring_factor") ;
collision_params.mu_factor =ini->r_float("wheels_params","friction_factor") ;
}
}
示例4: 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);
}