本文整理汇总了C++中Basis::xform方法的典型用法代码示例。如果您正苦于以下问题:C++ Basis::xform方法的具体用法?C++ Basis::xform怎么用?C++ Basis::xform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Basis
的用法示例。
在下文中一共展示了Basis::xform方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
//constraint between two different rigidbodies
btVehicleJacobianEntry(
const Basis &world2A,
const Basis &world2B,
const Vector3 &rel_pos1,
const Vector3 &rel_pos2,
const Vector3 &jointAxis,
const Vector3 &inertiaInvA,
const real_t massInvA,
const Vector3 &inertiaInvB,
const real_t massInvB) :
m_linearJointAxis(jointAxis) {
m_aJ = world2A.xform(rel_pos1.cross(m_linearJointAxis));
m_bJ = world2B.xform(rel_pos2.cross(-m_linearJointAxis));
m_0MinvJt = inertiaInvA * m_aJ;
m_1MinvJt = inertiaInvB * m_bJ;
m_Adiag = massInvA + m_0MinvJt.dot(m_aJ) + massInvB + m_1MinvJt.dot(m_bJ);
//btAssert(m_Adiag > real_t(0.0));
}
示例2: _duplicate_paste
void GridMapEditor::_duplicate_paste() {
if (!selection.active)
return;
int idx = options->get_popup()->get_item_index(MENU_OPTION_DUPLICATE_SELECTS);
bool reselect = options->get_popup()->is_item_checked( idx );
List< __Item > items;
Basis rot;
rot.set_orthogonal_index(selection.duplicate_rot);
for(int i=selection.begin.x;i<=selection.end.x;i++) {
for(int j=selection.begin.y;j<=selection.end.y;j++) {
for(int k=selection.begin.z;k<=selection.end.z;k++) {
int itm = node->get_cell_item(i,j,k);
if (itm==GridMap::INVALID_CELL_ITEM)
continue;
int orientation = node->get_cell_item_orientation(i,j,k);
__Item item;
Vector3 rel=Vector3(i,j,k)-selection.begin;
rel = rot.xform(rel);
Basis orm;
orm.set_orthogonal_index(orientation);
orm = rot * orm;
item.pos=selection.begin+rel;
item.item=itm;
item.rot=orm.get_orthogonal_index();
items.push_back(item);
}
}
}
Vector3 ofs=selection.current-selection.click;
if (items.size()) {
undo_redo->create_action("GridMap Duplicate Selection");
for(List< __Item >::Element *E=items.front();E;E=E->next()) {
__Item &it=E->get();
Vector3 pos = it.pos+ofs;
undo_redo->add_do_method(node,"set_cell_item",pos.x,pos.y,pos.z,it.item,it.rot);
undo_redo->add_undo_method(node,"set_cell_item",pos.x,pos.y,pos.z,node->get_cell_item(pos.x,pos.y,pos.z),node->get_cell_item_orientation(pos.x,pos.y,pos.z));
}
undo_redo->commit_action();
}
if (reselect) {
selection.begin+=ofs;
selection.end+=ofs;
selection.click=selection.begin;
selection.current=selection.end;
_validate_selection();
}
}