Changeset 4907


Ignore:
Timestamp:
Dec 23, 2014, 8:24:52 PM (5 years ago)
Author:
ldelgass
Message:

volume interpolator fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nanovis/trunk/VolumeInterpolator.cpp

    r3630 r4907  
    55 */
    66#include <string.h>
    7 #include <memory.h>
    8 #include <time.h>
    97#include <sys/time.h>
    10 #include <math.h>
    11 #include <stdlib.h>
    128
    139#include <vrmath/Vector3f.h>
     
    2117
    2218VolumeInterpolator::VolumeInterpolator() :
    23     _volume(0),
     19    _volume(NULL),
    2420    _interval(8.0),
    2521    _started(false),
     
    5551    float interp;
    5652
    57     computeKeys(fraction, _volumes.size(), &interp, &key1, &key2);
     53    computeKeys(fraction, (int)_volumes.size(), &interp, &key1, &key2);
    5854
    5955    if (interp == 0.0f) {
     
    7066            normal1 = (*(Vector3f*)(data1 + 1) - 0.5) * 2;
    7167            normal2 = (*(Vector3f*)(data2 + 1) - 0.5) * 2;
    72             normal = (normal2 - normal2) * interp + normal1;
     68            normal = (normal2 - normal1) * interp + normal1;
    7369            normal = normal.normalize();
    7470            normal = normal * 0.5 + 0.5;
     
    9086                                int *key1, int *key2)
    9187{
    92     int limit = (int) count - 1;
     88    int limit = count - 1;
    9389    if (fraction <= 0) {
    9490        *key1 = *key2 = 0;
     
    9995    } else {
    10096        int n;
    101         for (n = 0; n < limit; n++){
    102             if (fraction >= (n / (count - 1.0f)) && 
     97        for (n = 0; n < limit; n++) {
     98            if (fraction >= (n / (count - 1.0f)) &&
    10399                fraction < ((n+1)/(count-1.0f))) {
    104100                break;
Note: See TracChangeset for help on using the changeset viewer.