|

楼主 |
发表于 2011-3-14 19:24:53
|
显示全部楼层
struct Intersection
{
Intersection():
ratio(-1.0),
primitiveIndex(0) {}
bool operator < (const Intersection& rhs) const { return ratio < rhs.ratio; }
typedef std::vector<unsigned int> IndexList;
typedef std::vector<double> RatioList;
double ratio;
osg::NodePath nodePath;
osg::ref_ptr<osg: rawable> drawable;
osg::ref_ptr<osg::RefMatrix> matrix;
osg::Vec3d localIntersectionPoint;
osg::Vec3 localIntersectionNormal;
IndexList indexList;
RatioList ratioList;
unsigned int primitiveIndex;
const osg::Vec3d& getLocalIntersectPoint() const { return localIntersectionPoint; }
osg::Vec3d getWorldIntersectPoint() const { return matrix.valid() ? localIntersectionPoint * (*matrix) : localIntersectionPoint; }
const osg::Vec3& getLocalIntersectNormal() const { return localIntersectionNormal; }
osg::Vec3 getWorldIntersectNormal() const { return matrix.valid() ? osg::Matrix::transform3x3(osg::Matrix::inverse(*matrix),localIntersectionNormal) : localIntersectionNormal; }
};
我看过了,没发现你说的呀?array,能不能再明确点呀?或者提供了简单的例子呀?谢谢! |
|