本文整理汇总了C++中CKinematics::LL_BoneCount方法的典型用法代码示例。如果您正苦于以下问题:C++ CKinematics::LL_BoneCount方法的具体用法?C++ CKinematics::LL_BoneCount怎么用?C++ CKinematics::LL_BoneCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CKinematics
的用法示例。
在下文中一共展示了CKinematics::LL_BoneCount方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: 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);
}
}
示例3: if
//.........这里部分代码省略.........
RCache.set_xform_project (mProject);
// calculate view-matrix
Fmatrix mView;
Fvector v_C, v_Cs, v_N;
v_C.set (R.C);
v_Cs = v_C;
v_C.y += P_cam_dist;
v_N.set (0,0,1);
VERIFY (_valid(v_C) && _valid(v_Cs) && _valid(v_N));
// validate
Fvector v;
v.sub (v_Cs,v_C);;
#ifdef DEBUG
if ((v.x*v.x+v.y*v.y+v.z*v.z)<=flt_zero) {
CObject* OO = dynamic_cast<CObject*>(R.O);
Msg("Object[%s] Visual[%s] has invalid position. ",*OO->cName(),*OO->cNameVisual());
Fvector cc;
OO->Center(cc);
Log("center=",cc);
Log("visual_center=",OO->Visual()->getVisData().sphere.P);
Log("full_matrix=",OO->XFORM());
Log ("v_N",v_N);
Log ("v_C",v_C);
Log ("v_Cs",v_Cs);
Log("all bones transform:--------");
CKinematics* K = dynamic_cast<CKinematics*>(OO->Visual());
for(u16 ii=0; ii<K->LL_BoneCount();++ii){
Fmatrix tr;
tr = K->LL_GetTransform(ii);
Log("bone ",K->LL_BoneName_dbg(ii));
Log("bone_matrix",tr);
}
Log("end-------");
}
#endif
// handle invalid object-bug
if ((v.x*v.x+v.y*v.y+v.z*v.z)<=flt_zero) {
// invalidate record, so that object will be unshadowed, but doesn't crash
R.dwTimeValid = Device.dwTimeGlobal;
LT->shadow_recv_frame = Device.dwFrame-1;
LT->shadow_recv_slot = -1;
continue ;
}
mView.build_camera (v_C,v_Cs,v_N);
RCache.set_xform_view (mView);
// Select slot, set viewport
int s_x = c_it%P_o_line;
int s_y = c_it/P_o_line;
D3DVIEWPORT9 VP = {s_x*P_o_size,s_y*P_o_size,P_o_size,P_o_size,0,1 };
CHK_DX (HW.pDevice->SetViewport(&VP));
// Clear color to ambience
Fvector& cap = LT->get_approximate();
CHK_DX (HW.pDevice->Clear(0,0, D3DCLEAR_TARGET, color_rgba_f(cap.x,cap.y,cap.z, (cap.x+cap.y+cap.z)/4.f), 1, 0 ));
// calculate uv-gen matrix and clamper