parent
61ecf0a7e2
commit
10d2f05c31
@ -817,7 +817,7 @@ int main( int argc, char **argv )
|
||||
|
||||
if (internalFormatMode != osg::Texture::USE_IMAGE_DATA_FORMAT)
|
||||
{
|
||||
std::string ext = osgDB::getFileExtension(fileNameOut);
|
||||
ext = osgDB::getFileExtension(fileNameOut);
|
||||
CompressTexturesVisitor ctv(internalFormatMode);
|
||||
root->accept(ctv);
|
||||
ctv.compress();
|
||||
|
@ -150,11 +150,12 @@ class OSG_EXPORT GraphicsContext : public Object
|
||||
refreshRate(0),
|
||||
colorDepth(0)
|
||||
{}
|
||||
ScreenSettings(int width, int height, double refreshRate=0, unsigned int colorDepth=0) :
|
||||
width(width),
|
||||
height(height),
|
||||
refreshRate(refreshRate),
|
||||
colorDepth(colorDepth)
|
||||
|
||||
ScreenSettings(int in_width, int in_height, double in_refreshRate=0, unsigned int in_colorDepth=0) :
|
||||
width(in_width),
|
||||
height(in_height),
|
||||
refreshRate(in_refreshRate),
|
||||
colorDepth(in_colorDepth)
|
||||
{}
|
||||
|
||||
int width;
|
||||
|
@ -1504,11 +1504,11 @@ void Geometry::fixDeprecatedData()
|
||||
// we start processing the primitive sets.
|
||||
int target_vindex = 0;
|
||||
int source_pindex = -1; // equals primitiveNum
|
||||
for(PrimitiveSetList::iterator itr = _primitives.begin();
|
||||
itr != _primitives.end();
|
||||
++itr)
|
||||
for(PrimitiveSetList::iterator prim_itr = _primitives.begin();
|
||||
prim_itr != _primitives.end();
|
||||
++prim_itr)
|
||||
{
|
||||
osg::PrimitiveSet* primitiveset = itr->get();
|
||||
osg::PrimitiveSet* primitiveset = prim_itr->get();
|
||||
GLenum mode=primitiveset->getMode();
|
||||
|
||||
unsigned int primLength;
|
||||
|
@ -561,13 +561,13 @@ static void fillSpotLightImage(unsigned char* ptr, const osg::Vec4& centerColour
|
||||
|
||||
float mid = (float(size)-1.0f)*0.5f;
|
||||
float div = 2.0f/float(size);
|
||||
for(unsigned int r=0;r<size;++r)
|
||||
for(unsigned int row=0;row<size;++row)
|
||||
{
|
||||
//unsigned char* ptr = image->data(0,r,0);
|
||||
for(unsigned int c=0;c<size;++c)
|
||||
for(unsigned int col=0;col<size;++col)
|
||||
{
|
||||
float dx = (float(c) - mid)*div;
|
||||
float dy = (float(r) - mid)*div;
|
||||
float dx = (float(col) - mid)*div;
|
||||
float dy = (float(row) - mid)*div;
|
||||
float r = powf(1.0f-sqrtf(dx*dx+dy*dy),power);
|
||||
if (r<0.0f) r=0.0f;
|
||||
osg::Vec4 color = centerColour*r+backgroudColour*(1.0f-r);
|
||||
|
@ -341,7 +341,6 @@ namespace MatrixDecomposition
|
||||
#define TOL 1.0e-6
|
||||
_HMatrix Mk, MadjTk, Ek;
|
||||
double det, M_one, M_inf, MadjT_one, MadjT_inf, E_one, gamma, g1, g2;
|
||||
int i, j;
|
||||
|
||||
mat_tpose(Mk,=,M,3);
|
||||
M_one = norm_one(Mk); M_inf = norm_inf(Mk);
|
||||
@ -374,8 +373,8 @@ namespace MatrixDecomposition
|
||||
mat_tpose(Q,=,Mk,3); mat_pad(Q);
|
||||
mat_mult(Mk, M, S); mat_pad(S);
|
||||
|
||||
for (i=0; i<3; i++)
|
||||
for (j=i; j<3; j++)
|
||||
for (int i=0; i<3; i++)
|
||||
for (int j=i; j<3; j++)
|
||||
S[i][j] = S[j][i] = 0.5*(S[i][j]+S[j][i]);
|
||||
return (det);
|
||||
}
|
||||
@ -393,14 +392,14 @@ namespace MatrixDecomposition
|
||||
double Diag[3],OffD[3]; /* OffD is off-diag (by omitted index) */
|
||||
double g,h,fabsh,fabsOffDi,t,theta,c,s,tau,ta,OffDq,a,b;
|
||||
static char nxt[] = {Y,Z,X};
|
||||
int sweep, i, j;
|
||||
int sweep;
|
||||
mat_copy(U,=,mat_id,4);
|
||||
Diag[X] = S[X][X]; Diag[Y] = S[Y][Y]; Diag[Z] = S[Z][Z];
|
||||
OffD[X] = S[Y][Z]; OffD[Y] = S[Z][X]; OffD[Z] = S[X][Y];
|
||||
for (sweep=20; sweep>0; sweep--) {
|
||||
double sm = fabs(OffD[X])+fabs(OffD[Y])+fabs(OffD[Z]);
|
||||
if (sm==0.0) break;
|
||||
for (i=Z; i>=X; i--) {
|
||||
for (int i=Z; i>=X; i--) {
|
||||
int p = nxt[i]; int q = nxt[p];
|
||||
fabsOffDi = fabs(OffD[i]);
|
||||
g = 100.0*fabsOffDi;
|
||||
@ -421,7 +420,7 @@ namespace MatrixDecomposition
|
||||
OffDq = OffD[q];
|
||||
OffD[q] -= s*(OffD[p] + tau*OffD[q]);
|
||||
OffD[p] += s*(OffDq - tau*OffD[p]);
|
||||
for (j=Z; j>=X; j--) {
|
||||
for (int j=Z; j>=X; j--) {
|
||||
a = U[j][p]; b = U[j][q];
|
||||
U[j][p] -= s*(b + tau*a);
|
||||
U[j][q] += s*(a - tau*b);
|
||||
@ -452,7 +451,7 @@ namespace MatrixDecomposition
|
||||
|
||||
Quat p = q0001;
|
||||
double ka[4];
|
||||
int i, turn = -1;
|
||||
int turn = -1;
|
||||
ka[X] = k->x; ka[Y] = k->y; ka[Z] = k->z;
|
||||
|
||||
if (ka[X]==ka[Y]) {
|
||||
@ -482,7 +481,7 @@ namespace MatrixDecomposition
|
||||
mag[2] = (double)q.y*q.z+(double)q.x*q.w;
|
||||
|
||||
bool neg[3];
|
||||
for (i=0; i<3; i++)
|
||||
for (int i=0; i<3; i++)
|
||||
{
|
||||
neg[i] = (mag[i]<0.0);
|
||||
if (neg[i]) mag[i] = -mag[i];
|
||||
@ -516,7 +515,7 @@ namespace MatrixDecomposition
|
||||
bool neg[4];
|
||||
double all, big, two;
|
||||
qa[0] = q.x; qa[1] = q.y; qa[2] = q.z; qa[3] = q.w;
|
||||
for (i=0; i<4; i++) {
|
||||
for (int i=0; i<4; i++) {
|
||||
pa[i] = 0.0;
|
||||
neg[i] = (qa[i]<0.0);
|
||||
if (neg[i]) qa[i] = -qa[i];
|
||||
@ -547,7 +546,7 @@ namespace MatrixDecomposition
|
||||
big = qa[hi];
|
||||
if (all>two) {
|
||||
if (all>big) {/*all*/
|
||||
{int i; for (i=0; i<4; i++) pa[i] = sgn(neg[i], 0.5);}
|
||||
{for (int i=0; i<4; i++) pa[i] = sgn(neg[i], 0.5);}
|
||||
cycle(ka,par);
|
||||
}
|
||||
else {/*big*/ pa[hi] = sgn(neg[hi],1.0);}
|
||||
|
@ -147,8 +147,7 @@ void ConnectedParticleSystem::drawImplementation(osg::RenderInfo& renderInfo) co
|
||||
const Particle* nextParticle = (particle->getNextParticle() != Particle::INVALID_INDEX) ? &_particles[particle->getNextParticle()] : 0;
|
||||
if (nextParticle)
|
||||
{
|
||||
const osg::Vec3& nextPos = nextParticle->getPosition();
|
||||
osg::Vec3 startDelta = nextPos-pos;
|
||||
osg::Vec3 startDelta = nextParticle->getPosition()-pos;
|
||||
startDelta.normalize();
|
||||
float distance2 = 0.0;
|
||||
|
||||
@ -158,8 +157,7 @@ void ConnectedParticleSystem::drawImplementation(osg::RenderInfo& renderInfo) co
|
||||
++i)
|
||||
{
|
||||
nextParticle = &_particles[nextParticle->getNextParticle()];
|
||||
const osg::Vec3& nextPos = nextParticle->getPosition();
|
||||
osg::Vec3 delta = nextPos-pos;
|
||||
osg::Vec3 delta = nextParticle->getPosition()-pos;
|
||||
distance2 = (delta^startDelta).length2();
|
||||
}
|
||||
}
|
||||
@ -187,8 +185,8 @@ void ConnectedParticleSystem::drawImplementation(osg::RenderInfo& renderInfo) co
|
||||
|
||||
if (nextParticle)
|
||||
{
|
||||
const osg::Vec3& nextPos = nextParticle->getPosition();
|
||||
osg::Vec3 startDelta = nextPos-pos;
|
||||
osg::Vec3 startDelta = nextParticle->getPosition()-pos;
|
||||
delta = startDelta;
|
||||
startDelta.normalize();
|
||||
float distance2 = 0.0;
|
||||
|
||||
@ -198,12 +196,10 @@ void ConnectedParticleSystem::drawImplementation(osg::RenderInfo& renderInfo) co
|
||||
++i)
|
||||
{
|
||||
nextParticle = &_particles[nextParticle->getNextParticle()];
|
||||
const osg::Vec3& nextPos = nextParticle->getPosition();
|
||||
delta = nextPos-pos;
|
||||
delta = nextParticle->getPosition()-pos;
|
||||
distance2 = (delta^startDelta).length2();
|
||||
}
|
||||
|
||||
delta = nextPos-pos;
|
||||
}
|
||||
|
||||
osg::Vec3 normal( delta ^ (pos-eyeLocal));
|
||||
|
Loading…
Reference in New Issue
Block a user