예제 #1
0
void FlexDrawable::ConvexManager::add( const osg::Vec3& pos, const osg::Quat& q,
                                       const std::vector<osg::Plane>& faces,
                                       const osg::BoundingBox& bb, bool isStatic )
{
    unsigned int startIndex = starts.size();
    for ( unsigned int i=0; i<faces.size(); ++i )
    {
        const osg::Plane& plane = faces[i];
        planes.push_back( osg::Vec4f(plane[0], plane[1], plane[2], plane[3]) );
    }
    
    starts.push_back( startIndex );
    lengths.push_back( faces.size() );
    flags.push_back( isStatic ? 0 : 1 );
    
    positions.push_back( osg::Vec4(pos, 0.0f) );
    rotations.push_back( q.asVec4() );
    prevPositions.push_back( positions.back() );
    prevRotations.push_back( rotations.back() );
    
    aabbMin.push_back( osg::Vec4(bb._min, 0.0f) );
    aabbMax.push_back( osg::Vec4(bb._max, 0.0f) );
}
예제 #2
0
void osg::av_pushMsg(av::Msg& netMsg, const ::osg::Quat& buf)
{
    ::osg::Vec4d vec = buf.asVec4();
    av_pushMsg(netMsg, vec);
}