저는 세계 실체 (WorldObject)의 새로운 인스턴스를 생성하기 위해 작은 기능을 가지고 있습니다.osg :: 쿼트가 회전하지 않습니다.
나는 번역 및 회전을위한
OSG :: ref_ptr < OSG :: PositionAttitudeTransform>
을 사용하고 싶지만 내가 파악하지 못할 문제가있다.
저는 Vec3 마녀와 함께 setTranslation을 사용합니다. 하지만 Quat with make Rotation은 아무것도하지 않습니다.
는 코드가있다 :
osg::ref_ptr <osg::PositionAttitudeTransform> getWorldObjectClone(const char* name, osg::Vec3 position = osg::Vec3(0, 0, 0), osg::Vec3 rotation = osg::Vec3(0, 0, 0))
{
osg::ref_ptr <osg::PositionAttitudeTransform> tmp = new osg::PositionAttitudeTransform;
osg::Quat q(0, osg::Vec3(0, 0, 0));
tmp = dynamic_cast<osg::PositionAttitudeTransform*>(WorldObjects[name]->clone(osg::CopyOp::DEEP_COPY_ALL));
tmp->setPosition(position);
q.makeRotate(rotation.x(), 1, 0, 0);
q.makeRotate(rotation.y(), 0, 1, 0);
q.makeRotate(rotation.z(), 0, 0, 1);
tmp->setAttitude(q);
return tmp;
}
내가 노력 회전 = {90,0,0} (DEG) 및 회전 = {1,0,0} (RAD)하지만 모두 영향을주지 않습니다.
Quat를 사용하는 데 실수가 있습니까?
Dropye