本文整理汇总了C++中osg::Matrix::multLeft方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix::multLeft方法的具体用法?C++ Matrix::multLeft怎么用?C++ Matrix::multLeft使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osg::Matrix
的用法示例。
在下文中一共展示了Matrix::multLeft方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getConvexShape
btCollisionShape* VRPhysics::getConvexShape() {
btConvexHullShape* shape = new btConvexHullShape();
OSG::Matrix m;
OSG::Matrix M = vr_obj->getWorldMatrix();
M.invert();
vector<OSG::VRObject*> geos = vr_obj->getObjectListByType("Geometry");
for (auto g : geos) {
OSG::VRGeometry* geo = (OSG::VRGeometry*)g;
if (geo == 0) continue;
if (geo->getMesh() == 0) continue;
OSG::GeoVectorPropertyRecPtr pos = geo->getMesh()->getPositions();
if (pos == 0) continue;
if (geo != vr_obj) {
m = geo->getWorldMatrix();
m.multLeft(M);
}
for (unsigned int i = 0; i<pos->size(); i++) {
OSG::Pnt3f p;
pos->getValue(p,i);
if (geo != vr_obj) m.mult(p,p);
for (int i=0; i<3; i++) p[i] *= scale[i];
shape->addPoint(btVector3(p[0], p[1], p[2]));
}
}
shape->setMargin(collisionMargin);
//cout << "\nConstruct Convex shape for " << vr_obj->getName() << endl;
return shape;
}
示例2: makeMatrix
// create the motion matrix for a light source at time t
void makeMatrix(OSG::Real32 t, OSG::Matrix &result)
{
OSG::Matrix m;
result.setTransform(OSG::Quaternion(OSG::Vec3f(0,0,1), -OSG::Pi / 2));
m.setTransform(OSG::Vec3f(1, 0, 0));
result.multLeft(m);
m.setTransform(OSG::Quaternion(OSG::Vec3f(0,1,0), t / 1000.f));
result.multLeft(m);
m.setTransform(OSG::Vec3f(2, 0, 0));
result.multLeft(m);
m.setTransform(OSG::Quaternion(OSG::Vec3f(0,0,1), t / 3000.f));
result.multLeft(m);
}
示例3: updateClipPlanes
//
// In case the clip plane data change this function is called
//
void updateClipPlanes(const VecClipPlaneData& vec)
{
int sz = vec.size();
for(int i = 0; i < iNumClipPlanes; ++i)
{
OSG::ClipPlaneChunk *clipPlaneChunk =
vecClipPlaneDetails[i]._clipPlaneChunk;
clipPlaneChunk->setEnable(false);
if(i < sz)
{
const ClipPlaneData& data = vec[i];
//
// Update the clip plane chunk
//
clipPlaneChunk->setEquation(data._equation);
clipPlaneChunk->setEnable (data._enabled );
//
// and the plane transform core
//
OSG::Matrix rotMat;
OSG::Vec4f v1(0.f, 0.f, -1.f, 0.f);
OSG::Quaternion q(OSG::Vec3f(v1), OSG::Vec3f(data._equation));
rotMat.setTransform(q);
OSG::Matrix mat;
OSG::Vec3f v2(0.0f, 0.0f, data._equation[3]);
mat.setTranslate(v2);
mat.multLeft(rotMat);
vecClipPlaneDetails[i]._planeTrafoCore->setMatrix(mat);
}
}
}