Changed Billboard::g/setPos(..) to g/setPosition(..).

This commit is contained in:
Robert Osfield 2004-06-14 19:34:43 +00:00
parent 9a683e837d
commit 2d35b3cc27
5 changed files with 14 additions and 7 deletions

View File

@ -55,10 +55,17 @@ class SG_EXPORT Billboard : public Geode
inline const Vec3& getNormal() const { return _normal; } inline const Vec3& getNormal() const { return _normal; }
#ifdef USE_DEPRECTATED_API
/** Set the position of specified drawable. */ /** Set the position of specified drawable. */
inline void setPos(unsigned int i,const Vec3& pos) { _positionList[i] = pos; } inline void setPos(unsigned int i,const Vec3& pos) { _positionList[i] = pos; }
/** Get the position of specified drawable. */ /** Get the position of specified drawable. */
inline const Vec3& getPos(unsigned int i) const { return _positionList[i]; } inline const Vec3& getPos(unsigned int i) const { return _positionList[i]; }
#endif
/** Set the position of specified drawable. */
inline void setPosition(unsigned int i,const Vec3& pos) { _positionList[i] = pos; }
/** Get the position of specified drawable. */
inline const Vec3& getPosition(unsigned int i) const { return _positionList[i]; }
/** PositionList represents a list of pivot points for each drawable.*/ /** PositionList represents a list of pivot points for each drawable.*/
typedef std::vector<Vec3> PositionList; typedef std::vector<Vec3> PositionList;

View File

@ -40,7 +40,7 @@ void Billboard::write(DataOutputStream* out){
int size = _positionList.size(); int size = _positionList.size();
out->writeInt(size); out->writeInt(size);
for(int i=0;i<size;i++){ for(int i=0;i<size;i++){
out->writeVec3(getPos(i)); out->writeVec3(getPosition(i));
} }
} }
@ -68,7 +68,7 @@ void Billboard::read(DataInputStream* in){
// Read positions // Read positions
int size = in->readInt(); int size = in->readInt();
for(int i=0;i<size;i++){ for(int i=0;i<size;i++){
setPos(i,in->readVec3()); setPosition(i,in->readVec3());
} }
} }

View File

@ -854,7 +854,7 @@ void* labelRead::Parse(trpgToken /*tok*/,trpgReadBuffer &buf)
billboard->setAxis(osg::Vec3(0.0f,0.0,1.0f) ); billboard->setAxis(osg::Vec3(0.0f,0.0,1.0f) );
billboard->setNormal(osg::Vec3(0.0f,-1.0,0.0f)); billboard->setNormal(osg::Vec3(0.0f,-1.0,0.0f));
billboard->setMode(osg::Billboard::AXIAL_ROT); billboard->setMode(osg::Billboard::AXIAL_ROT);
billboard->setPos(0,pos); billboard->setPosition(0,pos);
_parse->getCurrTop()->addChild(billboard.get()); _parse->getCurrTop()->addChild(billboard.get());
} }
@ -1314,7 +1314,7 @@ void* geomRead::Parse(trpgToken /*tok*/,trpgReadBuffer &buf)
geometry->dirtyBound(); geometry->dirtyBound();
billboard->addDrawable(geometry); billboard->addDrawable(geometry);
billboard->setPos(0, center); billboard->setPosition(0, center);
} }
break; break;
case trpgBillboard::Group: case trpgBillboard::Group:
@ -1330,7 +1330,7 @@ void* geomRead::Parse(trpgToken /*tok*/,trpgReadBuffer &buf)
geometry->dirtyBound(); geometry->dirtyBound();
billboard->addDrawable(geometry); billboard->addDrawable(geometry);
billboard->setPos(0, center); billboard->setPosition(0, center);
} }
break; break;
default: default:

View File

@ -787,7 +787,7 @@ void CullVisitor::apply(Billboard& node)
for(unsigned int i=0;i<node.getNumDrawables();++i) for(unsigned int i=0;i<node.getNumDrawables();++i)
{ {
const Vec3& pos = node.getPos(i); const Vec3& pos = node.getPosition(i);
Drawable* drawable = node.getDrawable(i); Drawable* drawable = node.getDrawable(i);
// need to modify isCulled to handle the billboard offset. // need to modify isCulled to handle the billboard offset.

View File

@ -704,7 +704,7 @@ void CollectLowestTransformsVisitor::doTransform(osg::Object* obj,osg::Matrix& m
for(unsigned int i=0;i<billboard->getNumDrawables();++i) for(unsigned int i=0;i<billboard->getNumDrawables();++i)
{ {
billboard->setPos(i,billboard->getPos(i)*matrix); billboard->setPosition(i,billboard->getPosition(i)*matrix);
billboard->getDrawable(i)->accept(tf); billboard->getDrawable(i)->accept(tf);
billboard->getDrawable(i)->dirtyBound(); billboard->getDrawable(i)->dirtyBound();
} }