Converted remaining osg::Matrix usage to osg::Matrixd.

This commit is contained in:
Robert Osfield 2005-11-16 16:30:51 +00:00
parent 4a26f10226
commit 9415f669e8
4 changed files with 16 additions and 16 deletions

View File

@ -164,7 +164,7 @@ dxfCircle::assign(dxfFile* dxf, codeValue& cv)
void
dxfCircle::drawScene(scene* sc)
{
Matrix m;
Matrixd m;
getOCSMatrix(_ocs, m);
sc->ocs(m);
std::vector<Vec3d> vlist;
@ -235,7 +235,7 @@ dxfArc::assign(dxfFile* dxf, codeValue& cv)
void
dxfArc::drawScene(scene* sc)
{
Matrix m;
Matrixd m;
getOCSMatrix(_ocs, m);
sc->ocs(m);
std::vector<Vec3d> vlist;
@ -313,7 +313,7 @@ dxfLine::assign(dxfFile* dxf, codeValue& cv)
void
dxfLine::drawScene(scene* sc)
{
Matrix m;
Matrixd m;
getOCSMatrix(_ocs, m);
// don't know why this doesn't work
// sc->ocs(m);
@ -395,7 +395,7 @@ dxfPolyline::drawScene(scene* sc)
{
// if (getLayer() != "UDF2" && getLayer() != "ENGINES") return;
// if (!(_flag & 16)) return;
Matrix m;
Matrixd m;
getOCSMatrix(_ocs, m);
sc->ocs(m);
std::vector<Vec3d> vlist;
@ -648,7 +648,7 @@ dxfLWPolyline::drawScene(scene* sc)
{
// if (getLayer() != "UDF2" && getLayer() != "ENGINES") return;
// if (!(_flag & 16)) return;
Matrix m;
Matrixd m;
getOCSMatrix(_ocs, m);
sc->ocs(m);
if (_flag & 1) {
@ -732,7 +732,7 @@ dxfInsert::drawScene(scene* sc)
sc->pushMatrix(Matrixd::rotate(osg::DegreesToRadians(_rotation), 0,0,1));
}
sc->pushMatrix(Matrixd::scale(_scale.x(), _scale.y(), _scale.z()));
sc->pushMatrix(Matrix::translate(_point.x(), _point.y(), _point.z()));
sc->pushMatrix(Matrixd::translate(_point.x(), _point.y(), _point.z()));
getOCSMatrix(_ocs, m);
sc->pushMatrix(m);
sc->pushMatrix(back);

View File

@ -23,7 +23,7 @@
#include <osg/Array>
#include <osg/Vec3d>
#include <osg/Node>
#include <osg/Matrix>
#include <osg/Matrixd>
#include "dxfBlock.h"
@ -33,7 +33,7 @@ class codeValue;
class dxfFile;
static inline void
getOCSMatrix(osg::Vec3d ocs, osg::Matrix &m)
getOCSMatrix(const osg::Vec3d& ocs, osg::Matrixd& m)
{
static const double one_64th = 1.0/64.0;
m.makeIdentity();
@ -49,7 +49,7 @@ getOCSMatrix(osg::Vec3d ocs, osg::Matrix &m)
ax.normalize();
ay = ocsaxis ^ ax;
ay.normalize();
m = osg::Matrix( ax.x(), ax.y(), ax.z(), 0,
m = osg::Matrixd( ax.x(), ax.y(), ax.z(), 0,
ay.x(), ay.y(), ay.z(), 0,
ocsaxis.x(), ocsaxis.y(), ocsaxis.z(), 0,
0,0,0,1);

View File

@ -38,7 +38,7 @@ Vec3d scene::addVertex(Vec3d v)
{
v += _t;
v = preMultd(_r, v);
osg::Matrixd m = osg::Matrix::translate(v.x(), v.y(), v.z());
osg::Matrixd m = osg::Matrixd::translate(v.x(), v.y(), v.z());
m = m * _m;
Vec3d a = preMultd(m, Vec3d(0,0,0));
_b.expandBy(a);

View File

@ -19,7 +19,7 @@
#ifndef DXF_SCENE
#define DXF_SCENE 1
#include <osg/Matrix>
#include <osg/Matrixd>
#include <osg/Group>
#include <osg/MatrixTransform>
#include <osg/Geometry>
@ -243,7 +243,7 @@ public:
scene(dxfLayerTable* lt = NULL);
virtual ~scene() {}
void setLayerTable(dxfLayerTable* lt);
void pushMatrix(osg::Matrixd m, bool protect = false)
void pushMatrix(const osg::Matrixd& m, bool protect = false)
{
_mStack.push_back(_m);
if (protect) // equivalent to setMatrix
@ -259,11 +259,11 @@ public:
else
_m.makeIdentity();
}
void ocs(osg::Matrixd r)
void ocs(const osg::Matrixd& r)
{
_r = r;
}
void blockOffset(osg::Vec3d t)
void blockOffset(const osg::Vec3d& t)
{
_t = t;
}
@ -300,10 +300,10 @@ public:
double x = _b._min.x() - (double)v.x();
double y = _b._min.y() - (double)v.y();
double z = _b._min.z() - (double)v.z();
osg::Matrix m = osg::Matrix::translate(v);
osg::Matrixd m = osg::Matrixd::translate(v);
root = new osg::MatrixTransform(m);
if (x || y || z) {
m = osg::Matrix::translate(x,y,z);
m = osg::Matrixd::translate(x,y,z);
child = new osg::MatrixTransform(m);
root->addChild(child);
} else {