本文整理汇总了C++中osg::Matrix::ptr方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix::ptr方法的具体用法?C++ Matrix::ptr怎么用?C++ Matrix::ptr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osg::Matrix
的用法示例。
在下文中一共展示了Matrix::ptr方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: copyOsgMatrixToLib3dsMatrix
void copyOsgMatrixToLib3dsMatrix(Lib3dsMatrix lib3ds_matrix, const osg::Matrix& osg_matrix)
{
for(int row=0; row<4; ++row)
{
lib3ds_matrix[row][0] = osg_matrix.ptr()[row*4+0];
lib3ds_matrix[row][1] = osg_matrix.ptr()[row*4+1];
lib3ds_matrix[row][2] = osg_matrix.ptr()[row*4+2];
lib3ds_matrix[row][3] = osg_matrix.ptr()[row*4+3];
}
}
示例2: setMatrix
void PhysXInterface::setMatrix( int id, const osg::Matrix& matrix )
{
PxReal d[16];
for ( int i=0; i<16; ++i ) d[i] = *(matrix.ptr() + i);
PxRigidActor* actor = _actors[id];
if ( actor ) actor->setGlobalPose( PxTransform(PxMat44(d)) );
}
示例3: normalize
Property::Property( const std::string& _name, const osg::Matrix& _v )
{
name = normalize( _name );
std::stringstream ss;
const osg::Matrix::value_type* p = _v.ptr();
for( int i=0; i<15; i++ ) ss << *p++ << " ";
ss << *p;
value = ss.str();
valid = true;
}
示例4: convertOSGMatrixToMPVMatrix
// ================================================
// convertOSGMatrixToMPVMatrix
// vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
MPVCMNOSG_SPEC mpv::Mtx4 convertOSGMatrixToMPVMatrix( const osg::Matrix &osgMtx )
{
mpv::Mtx4 result;
// OSG matrices are stored "sideways", like OpenGL.
// MPV matrices are stored like you learned in math class (except the subscript is
// backwards; math class convention for refering to an element is Mcol,row).
// They need to be transposed to convert between the two.
result.pcset( osgMtx.ptr() );
return result;
}
示例5:
btTransform
osgbCollision::asBtTransform( const osg::Matrix& m )
{
const osg::Matrix::value_type* oPtr = m.ptr();
btScalar bPtr[ 16 ];
int idx;
for (idx=0; idx<16; idx++)
bPtr[ idx ] = oPtr[ idx ];
btTransform t;
t.setFromOpenGLMatrix( bPtr );
return t;
}
示例6: toPhysicsMatrix
PxMat44 toPhysicsMatrix( const osg::Matrix& matrix )
{
PxReal d[16];
for ( int i=0; i<16; ++i ) d[i] = *(matrix.ptr() + i);
return PxMat44(d);
}