~ubuntu-branches/ubuntu/trusty/blender/trusty-proposed

« back to all changes in this revision

Viewing changes to intern/smoke/intern/INTERPOLATE.h

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2013-08-14 10:43:49 UTC
  • mfrom: (14.2.19 sid)
  • Revision ID: package-import@ubuntu.com-20130814104349-t1d5mtwkphp12dyj
Tags: 2.68a-3
* Upload to unstable
* debian/: python3.3 Depends simplified
  - debian/control: python3.3 Depends dropped
    for blender-data package
  - 0001-blender_thumbnailer.patch refreshed
* debian/control: libavcodec b-dep versioning dropped

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
////////////////////////////////////////////////////////////////////////////////////////// 
63
63
static inline float lerp3d(float* field, float x, float y, float z,  int xres, int yres, int zres) {
64
64
        // clamp pos to grid boundaries
65
 
        if (x < 0.5) x = 0.5;
66
 
        if (x > xres - 1.5) x = xres - 1.5;
67
 
        if (y < 0.5) y = 0.5;
68
 
        if (y > yres - 1.5) y = yres - 1.5;
69
 
        if (z < 0.5) z = 0.5;
70
 
        if (z > zres - 1.5) z = zres - 1.5;
 
65
        if (x < 0.5f) x = 0.5f;
 
66
        if (x > xres - 1.5f) x = xres - 1.5f;
 
67
        if (y < 0.5f) y = 0.5f;
 
68
        if (y > yres - 1.5f) y = yres - 1.5f;
 
69
        if (z < 0.5f) z = 0.5f;
 
70
        if (z > zres - 1.5f) z = zres - 1.5f;
71
71
 
72
72
        // locate neighbors to interpolate
73
73
        const int x0 = (int)x;
113
113
static inline float lerp3dToFloat(T* field1,
114
114
                float x, float y, float z,  int xres, int yres, int zres) {
115
115
        // clamp pos to grid boundaries
116
 
        if (x < 0.5) x = 0.5;
117
 
        if (x > xres - 1.5) x = xres - 1.5;
118
 
        if (y < 0.5) y = 0.5;
119
 
        if (y > yres - 1.5) y = yres - 1.5;
120
 
        if (z < 0.5) z = 0.5;
121
 
        if (z > zres - 1.5) z = zres - 1.5;
 
116
        if (x < 0.5f) x = 0.5f;
 
117
        if (x > xres - 1.5f) x = xres - 1.5f;
 
118
        if (y < 0.5f) y = 0.5f;
 
119
        if (y > yres - 1.5f) y = yres - 1.5f;
 
120
        if (z < 0.5f) z = 0.5f;
 
121
        if (z > zres - 1.5f) z = zres - 1.5f;
122
122
 
123
123
        // locate neighbors to interpolate
124
124
        const int x0 = (int)x;
164
164
static inline Vec3 lerp3dVec(float* field1, float* field2, float* field3, 
165
165
                float x, float y, float z,  int xres, int yres, int zres) {
166
166
        // clamp pos to grid boundaries
167
 
        if (x < 0.5) x = 0.5;
168
 
        if (x > xres - 1.5) x = xres - 1.5;
169
 
        if (y < 0.5) y = 0.5;
170
 
        if (y > yres - 1.5) y = yres - 1.5;
171
 
        if (z < 0.5) z = 0.5;
172
 
        if (z > zres - 1.5) z = zres - 1.5;
 
167
        if (x < 0.5f) x = 0.5f;
 
168
        if (x > xres - 1.5f) x = xres - 1.5f;
 
169
        if (y < 0.5f) y = 0.5f;
 
170
        if (y > yres - 1.5f) y = yres - 1.5f;
 
171
        if (z < 0.5f) z = 0.5f;
 
172
        if (z > zres - 1.5f) z = zres - 1.5f;
173
173
 
174
174
        // locate neighbors to interpolate
175
175
        const int x0 = (int)x;