本文整理汇总了C++中Transform3f::transform方法的典型用法代码示例。如果您正苦于以下问题:C++ Transform3f::transform方法的具体用法?C++ Transform3f::transform怎么用?C++ Transform3f::transform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transform3f
的用法示例。
在下文中一共展示了Transform3f::transform方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: intersect_Triangle
bool Intersect::intersect_Triangle(const Vec3f& P1, const Vec3f& P2, const Vec3f& P3,
const Vec3f& Q1, const Vec3f& Q2, const Vec3f& Q3,
const Transform3f& tf,
Vec3f* contact_points,
unsigned int* num_contact_points,
FCL_REAL* penetration_depth,
Vec3f* normal)
{
Vec3f Q1_ = tf.transform(Q1);
Vec3f Q2_ = tf.transform(Q2);
Vec3f Q3_ = tf.transform(Q3);
return intersect_Triangle(P1, P2, P3, Q1_, Q2_, Q3_, contact_points, num_contact_points, penetration_depth, normal);
}
示例2: collide_front_list_Test
bool collide_front_list_Test(const Transform3f& tf1, const Transform3f& tf2,
const std::vector<Vec3f>& vertices1, const std::vector<Triangle>& triangles1,
const std::vector<Vec3f>& vertices2, const std::vector<Triangle>& triangles2,
SplitMethodType split_method,
bool refit_bottomup, bool verbose)
{
BVHModel<BV> m1;
BVHModel<BV> m2;
m1.bv_splitter.reset(new BVSplitter<BV>(split_method));
m2.bv_splitter.reset(new BVSplitter<BV>(split_method));
BVHFrontList front_list;
std::vector<Vec3f> vertices1_new(vertices1.size());
for(std::size_t i = 0; i < vertices1_new.size(); ++i)
{
vertices1_new[i] = tf1.transform(vertices1[i]);
}
m1.beginModel();
m1.addSubModel(vertices1_new, triangles1);
m1.endModel();
m2.beginModel();
m2.addSubModel(vertices2, triangles2);
m2.endModel();
Transform3f pose1, pose2;
CollisionResult local_result;
MeshCollisionTraversalNode<BV> node;
if(!initialize<BV>(node, m1, pose1, m2, pose2,
CollisionRequest(std::numeric_limits<int>::max(), false), local_result))
std::cout << "initialize error" << std::endl;
node.enable_statistics = verbose;
collide(&node, &front_list);
if(verbose) std::cout << "front list size " << front_list.size() << std::endl;
// update the mesh
for(std::size_t i = 0; i < vertices1.size(); ++i)
{
vertices1_new[i] = tf2.transform(vertices1[i]);
}
m1.beginReplaceModel();
m1.replaceSubModel(vertices1_new);
m1.endReplaceModel(true, refit_bottomup);
m2.beginReplaceModel();
m2.replaceSubModel(vertices2);
m2.endReplaceModel(true, refit_bottomup);
local_result.clear();
collide(&node, &front_list);
if(local_result.numContacts() > 0)
return true;
else
return false;
}