这篇教程C++ D3DXVec3Length函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中D3DXVec3Length函数的典型用法代码示例。如果您正苦于以下问题:C++ D3DXVec3Length函数的具体用法?C++ D3DXVec3Length怎么用?C++ D3DXVec3Length使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了D3DXVec3Length函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: D3DXVec3Length//****************************************************************// attackvoid Finger::attack( const D3DXVECTOR3& pos ){ float thre = 2.0f; D3DXVECTOR3 v = pos - coarse_->get_current_center(); float l = D3DXVec3Length( &v ); if( waiting_ && 1.0f < l ) { D3DXVec3Normalize( &v, &v ); v *= -0.5f; D3DXVECTOR3 t = pos + v; coarse_->kill_inertia(); coarse_->teleport( t - coarse_->get_current_center() ); } else { px::tetrahedralmesh_type::points_type& points = mesh_->get_points(); size_t n = points.size(); for( size_t i = 0 ; i < n ; i++ ) { if( 0.2f < points[i].source_position.y ) { D3DXVECTOR3 d = pos - points[i].new_position; if( thre < D3DXVec3Length( &d ) ) { d /= thre; D3DXVec3Normalize( &d, &d ); d *= thre; } points[i].forces += d * 50.0f; } } } coarse_->set_positive( true ); waiting_ = false;}
开发者ID:jonigata,项目名称:partix,代码行数:35,
|