Skip to content

Commit

Permalink
Use Vec3 for billboard vertices
Browse files Browse the repository at this point in the history
OSG's intersector apparently doesn't like hitting objects with Vec2 vertex
storage.
  • Loading branch information
kcat committed Jul 18, 2015
1 parent 8447bbf commit 8681bd9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions components/resource/meshmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,11 @@ osg::ref_ptr<osg::Node> MeshManager::loadFlat(size_t texid, size_t *num_frames,
base->setAxis(osg::Vec3(0.0f, 1.0f, 0.0f));
base->setNormal(osg::Vec3(0.0f, 0.0f, -1.0f));

osg::ref_ptr<osg::Vec2Array> vtxs(new osg::Vec2Array(4));
(*vtxs)[0] = osg::Vec2(width* 0.5f, height*-0.5f);
(*vtxs)[1] = osg::Vec2(width*-0.5f, height*-0.5f);
(*vtxs)[2] = osg::Vec2(width*-0.5f, height* 0.5f);
(*vtxs)[3] = osg::Vec2(width* 0.5f, height* 0.5f);
osg::ref_ptr<osg::Vec3Array> vtxs(new osg::Vec3Array(4));
(*vtxs)[0] = osg::Vec3(width* 0.5f, height*-0.5f, 0.0f);
(*vtxs)[1] = osg::Vec3(width*-0.5f, height*-0.5f, 0.0f);
(*vtxs)[2] = osg::Vec3(width*-0.5f, height* 0.5f, 0.0f);
(*vtxs)[3] = osg::Vec3(width* 0.5f, height* 0.5f, 0.0f);
osg::ref_ptr<osg::Vec2Array> texcrds(new osg::Vec2Array(4));
(*texcrds)[0] = osg::Vec2(1.0f, 0.0f);
(*texcrds)[1] = osg::Vec2(0.0f, 0.0f);
Expand Down

0 comments on commit 8681bd9

Please sign in to comment.