~ubuntu-branches/debian/sid/ember/sid

« back to all changes in this revision

Viewing changes to .pc/0014-boost-1.53.patch/src/components/ogre/SceneManagers/EmberPagingSceneManager/src/OgrePagingLandScapeData2D.cpp

  • Committer: Package Import Robot
  • Author(s): Olek Wojnar, Stephen M. Webb, Olek Wojnar
  • Date: 2016-08-06 18:39:19 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20160806183919-4g72j3flj7xe2stj
Tags: 0.7.2+dfsg-1
[ Stephen M. Webb ]
* debian/control: updated build-depends to newer minimum versions
  (closes: #704786)
* debian/control: updated Standards-Version to 3.9.4 (updated VCS-* fields)
* debian/patches/0001-ember.in-test-expr.patch: removed (fixed upstream)
* debian/patches/0002-add-update_lua_bindings.patch: removed (fixed upstream)
* debian/patches/0003-add-atlas-pkg.patch: removed (fixed upstream)
* debian/patches/0004-domain-bindings-lua-makefile.patch: refreshed
* debian/patches/0005-ember.in-prefix.patch: removed (fixed upstream)
* debian/patches/0006-spellcheck-similiar.patch: removed (fixed upstream)
* debian/patches/0007-revert-libwfut-version.patch: refreshed
* debian/patches/0008-replace-fastdeletegate-with-sigc++.patch: removed
 (fixed upstream)
* debian/patches/0009-spelling-bach.patch: removed (fixed upstream)
* debian/patches/0010-fix-ember-script-args.patch: removed (fixed upstream)
* debian/patches/0011-qualify-template-functions.patch: removed (fixed
  upstream)
* debian/patches/0012-fix-osdir-headers.patch: removed (fixed upstream)
* debian/patches/0013-remove-invalid-linker-flags.patch: removed (fixed
  upstream)
* debian/patches/0014-add-missing-ogrelodstrategy.patch: new
* debian/control: fixed Vcs-Browser URL
* debian/patches/0015-verbose-configure-errors.patch: new
* debian/patches/0016-boost-1.53.patch: new
* debian/control: bump boost build dependeny to 1.53

[ Olek Wojnar ]
* New upstream release (Closes: #799748)
* Add myself as new uploader
  - Remove Stephen Webb per his request
  - Thanks for all the contributions, Stephen!
* d/patches/0007-revert-libwfut-version.patch: removed (unnecessary)
* d/control
  - Remove pre-dependency on dpkg
  - Update standards to 3.9.8 (no changes)
  - Update Vcs lines for secure URIs
* Import patch from the wfmath package to replace MersenneTwister.h
  -- Avoids problems from ambiguous copyright of the original file
* Update dependencies for version 0.7.2
* Enable all hardening options
* Add three lintian overrides
  -- Ignore install into usr/bin (binary)
  -- Ignore .rc files needed for WIN32 build (source)
  -- Ignore false positive of spelling error (binary)
* d/copyright: Update contributors and dates
* d/rules
  -- Do not remove "sounddefinitions" directory
  -- Enable parallel build
  -- Do not install into games directories
  -- Remove dh_builddeb override since xz is now the default
* d/watch: update file extensions
* Remove three patches, add eight patches, update remaining patches
  -- 0004-domain-bindings-lua-makefile.patch (implemented upstream)
  -- 0014-add-missing-ogrelodstrategy.patch (implemented upstream)
  -- 0016-boost-1.53.patch (patch target file removed upstream)
  -- 0018-enable-subdir-objects.patch (Fix automake 1.14 warnings)
  -- 0019-update-boost-m4.patch (Fix invalid boost_major_version)
  -- 0020-remove-obsolete-includes.patch (Fix obsolete includes)
  -- 0021-GraphicalChangeAdapter-fix-for-newer-compilers.patch (Added)
  -- 0022-fix-typos.patch (Fix typos identified by lintian)
  -- 0023-add-keywords-to-desktop-file.patch (Add Keywords to .desktop file)
  -- 0024-fix-icon-location (Make icon location Icon Theme Spec-compliant)
  -- 0025-fix-duplicate-script-install.patch (Was causing build failures)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
OgrePagingLandScapeData2D.cpp  -  description
3
 
-------------------
4
 
begin                : Wen Mar 06 2003
5
 
copyright            : (C) 2003-2006 by Jose A Milan && Tuan Kuranes
6
 
email                : spoke@supercable.es & tuan.kuranes@free.fr
7
 
***************************************************************************/
8
 
 
9
 
/***************************************************************************
10
 
*                                                                         *
11
 
*   This program is free software; you can redistribute it and/or modify  *
12
 
*   it under the terms of the GNU Lesser General Public License as        *
13
 
*   published by the Free Software Foundation; either version 2 of the    *
14
 
*   License, or (at your option) any later version.                       *
15
 
*                                                                         *
16
 
***************************************************************************/
17
 
 
18
 
#include "OgrePagingLandScapePrecompiledHeaders.h"
19
 
 
20
 
#include "OgreVector3.h"
21
 
#include "OgreColourValue.h"
22
 
 
23
 
#include "OgreSphere.h"
24
 
 
25
 
#include "OgrePagingLandScapeSceneManager.h"
26
 
 
27
 
#include "OgrePagingLandScapeData2DManager.h"
28
 
#include "OgrePagingLandScapeData2D.h"
29
 
#include "OgrePagingLandScapeOptions.h"
30
 
 
31
 
 
32
 
#ifndef _MAPSPLITTER
33
 
 
34
 
#include "OgreAxisAlignedBox.h"
35
 
#include "OgreMovableObject.h"
36
 
#include "OgreSimpleRenderable.h"
37
 
 
38
 
 
39
 
#include "OgrePagingLandScapePageManager.h"
40
 
#include "OgrePagingLandScapeTile.h"
41
 
#include "OgrePagingLandScapeRenderable.h"
42
 
 
43
 
#endif// _MAPSPLITTER
44
 
 
45
 
namespace Ogre
46
 
{
47
 
 
48
 
PagingLandScapeData2D::PagingLandScapeData2D(PagingLandScapeData2DManager* pageMgr):
49
 
        mParent(pageMgr),
50
 
        mHeightData (0),
51
 
        mIsLoaded (false),
52
 
        mIsModified (false),
53
 
        mIsRectModified (false),
54
 
        mRect (0, 0, 0, 0, 0, 1)
55
 
{
56
 
}
57
 
 
58
 
//-----------------------------------------------------------------------
59
 
PagingLandScapeData2D::~PagingLandScapeData2D()
60
 
{    
61
 
        unload ();
62
 
}
63
 
 
64
 
//-----------------------------------------------------------------------
65
 
void PagingLandScapeData2D::init()
66
 
{   
67
 
        //
68
 
69
 
 
70
 
//-----------------------------------------------------------------------
71
 
void PagingLandScapeData2D::uninit()
72
 
{    
73
 
        PagingLandScapeData2D::unload ();
74
 
}
75
 
 
76
 
//-----------------------------------------------------------------------
77
 
bool PagingLandScapeData2D::load(unsigned int x, unsigned int z)
78
 
{
79
 
        if (!mIsLoaded)
80
 
        {
81
 
                mIsModified = false;
82
 
                mIsRectModified = false;
83
 
                mRect = Image::Box (0, 0, 0, 0, 0, 1);
84
 
 
85
 
                mPageX = x; 
86
 
                mPageZ = z;
87
 
                
88
 
                mSize = mParent->getOptions()->PageSize;
89
 
                
90
 
                mShiftX = (mPageX * (mSize - 1)) - mParent->getOptions()->maxUnScaledX;
91
 
                mShiftZ = (mPageZ * (mSize - 1)) - mParent->getOptions()->maxUnScaledZ;
92
 
        
93
 
                const bool isLoadable = _load (x, z);
94
 
                mIsLoaded = true;  
95
 
                return isLoadable;
96
 
        }
97
 
        return true;        
98
 
}
99
 
 
100
 
//-----------------------------------------------------------------------
101
 
void PagingLandScapeData2D::load()
102
 
{       
103
 
        if (!mIsLoaded)
104
 
        {
105
 
                _load();
106
 
                mIsLoaded = true;
107
 
        }
108
 
}    
109
 
 
110
 
//-----------------------------------------------------------------------
111
 
void PagingLandScapeData2D::unload()
112
 
{
113
 
        if (mIsLoaded)
114
 
        {
115
 
                if (mIsModified && mParent->getOptions()->saveDeformation)
116
 
                        _save ();
117
 
                //Use the shared pointer for deletion
118
 
//              delete[] mHeightData;
119
 
                mHeightDataPtr.reset(0);
120
 
                mHeightData = 0;
121
 
                _unload();
122
 
                mIsLoaded = false;
123
 
#ifndef _MAPSPLITTER
124
 
                resetDeformationRectangle ();
125
 
#endif
126
 
        }
127
 
}
128
 
 
129
 
//-----------------------------------------------------------------------
130
 
void PagingLandScapeData2D::computePowerof2PlusOneSize()
131
 
{
132
 
        mSize = mParent->getOptions()->PageSize;
133
 
        const size_t p2size = mSize - 1;
134
 
 
135
 
        size_t pagex = mXDimension / p2size;
136
 
        if (mXDimension - (pagex * p2size) > 1)
137
 
                pagex++;
138
 
        mXDimension = pagex * p2size + 1;
139
 
 
140
 
        size_t pagez = mZDimension / p2size;
141
 
        if (mZDimension - (pagez * p2size) > 1)
142
 
                pagez++;
143
 
        mZDimension =  pagez * p2size + 1;
144
 
}
145
 
 
146
 
//-----------------------------------------------------------------------
147
 
bool PagingLandScapeData2D::_checkSize(size_t s)
148
 
{
149
 
        // ispow2 - 1
150
 
        const int p = static_cast <unsigned int> (s - 1); 
151
 
        // ispow2
152
 
        return ((p & (p - 1)) == 0);
153
 
}
154
 
    
155
 
#ifndef _MAPSPLITTER
156
 
 
157
 
//-----------------------------------------------------------------------
158
 
void PagingLandScapeData2D::resetDeformationRectangle()
159
 
{
160
 
        mRect.left = 0;
161
 
        mRect.right = 0;
162
 
        mRect.top = 0;
163
 
        mRect.bottom = 0;
164
 
        mIsRectModified = false;
165
 
}
166
 
 
167
 
//-----------------------------------------------------------------------
168
 
const Image::Box& PagingLandScapeData2D::getDeformationRectangle() const
169
 
{
170
 
        return mRect;
171
 
}
172
 
 
173
 
//-----------------------------------------------------------------------
174
 
void PagingLandScapeData2D::adjustDeformationRectangle(unsigned int x, unsigned int z)
175
 
{
176
 
        if (mIsRectModified)
177
 
        {
178
 
                if (mRect.left > x)
179
 
                        mRect.left = x;
180
 
                if (mRect.right < x)
181
 
                        mRect.right = x;
182
 
 
183
 
                if (mRect.top > z)
184
 
                        mRect.top = z;
185
 
                if (mRect.bottom < z)
186
 
                        mRect.bottom = z;
187
 
        }
188
 
        else
189
 
        {
190
 
                // first modification :
191
 
                // deformation rectangle is the point
192
 
                mRect.left = x;
193
 
                mRect.right = x;
194
 
                mRect.top = z;
195
 
                mRect.bottom = z;
196
 
                mIsRectModified = true;
197
 
                mIsModified = true;
198
 
        }
199
 
        unsigned int tileposx = x;
200
 
        unsigned int tileposz = z;
201
 
        PagingLandScapeTile *t = 
202
 
                mParent->getSceneManager()->getPageManager()->getTilePage(tileposx, tileposz, 
203
 
                                                                          mPageX, mPageZ);
204
 
        if (t && t->isLoaded ())
205
 
        { 
206
 
                // tells what tile portion needs to be updated.
207
 
                PagingLandScapeRenderable * const r = t->getRenderable ();                
208
 
                r->adjustDeformationRectangle (tileposx, tileposz); 
209
 
        }
210
 
}
211
 
 
212
 
//-----------------------------------------------------------------------
213
 
bool PagingLandScapeData2D::deformHeight(const Vector3& deformationPoint, Real& modificationHeight)
214
 
{
215
 
        // adjust x and z to be local to page
216
 
        const int x = static_cast<int> (deformationPoint.x - mShiftX);
217
 
        const int z = static_cast<int> (deformationPoint.z - mShiftZ);
218
 
        // due to Real imprecision on Reals, we have to use boundaries here
219
 
        // otherwise we'll hit asserts.
220
 
        const int size =  static_cast<int> (mSize-1);
221
 
        const unsigned int ux = static_cast<unsigned int> (std::max(std::min (x, size), 0));
222
 
        const unsigned int uz = static_cast<unsigned int> (std::max(std::min (z, size), 0));
223
 
        return deformHeight(ux, uz, modificationHeight);
224
 
225
 
 
226
 
//-----------------------------------------------------------------------
227
 
bool PagingLandScapeData2D::deformHeight(unsigned int x, unsigned int z, Real& modificationHeight)
228
 
{
229
 
        const unsigned int arraypos = static_cast <unsigned int> (z * mSize + x);
230
 
        assert (mHeightData && arraypos < mMaxArrayPos);
231
 
 
232
 
        const Real maxH = mParent->getMaxHeight();
233
 
        const Real newH = mHeightData[arraypos] - modificationHeight;
234
 
 
235
 
        bool did_modif = false;
236
 
        if (newH <= 0.0f)
237
 
        {
238
 
                if (mHeightData[arraypos] != 0.0f)
239
 
                        did_modif = setHeight(x, z, arraypos, 0.0f);
240
 
                modificationHeight = 0.0f;
241
 
        }
242
 
        else if (newH >= maxH)  
243
 
        {
244
 
                if (mHeightData[arraypos] != maxH)
245
 
                        did_modif = setHeight(x, z, arraypos, maxH);
246
 
                modificationHeight = maxH;
247
 
        }
248
 
        else 
249
 
        {
250
 
                did_modif = setHeight(x, z, arraypos, newH);
251
 
                modificationHeight = newH;
252
 
        }
253
 
        return did_modif;
254
 
}   
255
 
 
256
 
//-----------------------------------------------------------------------
257
 
bool PagingLandScapeData2D::setHeight(unsigned int x, unsigned int z, unsigned int Pos, const Real& h)
258
 
{
259
 
        if (mHeightData[Pos] != h)
260
 
        {
261
 
                mHeightData[ Pos ] = h;    
262
 
 
263
 
                unsigned int tileposx = x;
264
 
                unsigned int tileposz = z;
265
 
                // Make position local to tiles.
266
 
                // and return a Tile.
267
 
                PagingLandScapeTile *t = 
268
 
                        mParent->getSceneManager()->getPageManager()->getTilePage (tileposx, tileposz, 
269
 
                                                                                   mPageX, mPageZ);
270
 
                if (t && t->isLoaded ())
271
 
                { 
272
 
                        // tells what tile portion needs to be updated.
273
 
                        PagingLandScapeRenderable * const r = t->getRenderable ();                
274
 
                        r->adjustDeformationRectangle (tileposx, tileposz); 
275
 
                        
276
 
                        const unsigned int tSize = mParent->getOptions()->TileSize - 1;
277
 
                        const unsigned int NumTiles = mParent->getOptions()->NumTiles;
278
 
 
279
 
                        const PagingLandScapeTileInfo * const info =  t->getInfo();
280
 
                        const unsigned int tX = info->mTileX;
281
 
                        const unsigned int tZ = info->mTileZ;
282
 
 
283
 
                        // If we're on a page edge, we must duplicate the change on the 
284
 
                        // neighbour tile (if it has one...)
285
 
                        // could be a direct neighbour or a diagonal one (in a corner.)
286
 
                        const bool left  = (tileposx == 0     && tX != 0);
287
 
                        const bool right = (tileposx == tSize && tX != NumTiles - 1);
288
 
                        const bool down  = (tileposz == 0     && tZ != 0);
289
 
                        const bool up    = (tileposz == tSize && tZ != NumTiles - 1);
290
 
 
291
 
 
292
 
                        if (left)
293
 
                        { 
294
 
                                PagingLandScapeRenderable * const rn = r->_getNeighbor(WEST);
295
 
                                if (rn)
296
 
                                {
297
 
                                        if (down)
298
 
                                        {
299
 
                                                PagingLandScapeRenderable * const rnUp = rn->_getNeighbor(NORTH);
300
 
                                                if (rnUp && rnUp->isLoaded ())
301
 
                                                { 
302
 
                                                        rnUp->adjustDeformationRectangle (tSize, tSize); 
303
 
                                                }
304
 
                                        }
305
 
                                        else  if (up)
306
 
                                        {
307
 
                                                PagingLandScapeRenderable * const rnDown = rn->_getNeighbor(SOUTH);
308
 
                                                if (rnDown && rnDown->isLoaded ())
309
 
                                                { 
310
 
                                                        rnDown->adjustDeformationRectangle (tSize, 0); 
311
 
                                                }
312
 
                                        }
313
 
                                        if (rn->isLoaded ())
314
 
                                        { 
315
 
                                                rn->adjustDeformationRectangle (tSize, tileposz); 
316
 
                                        }
317
 
                                }
318
 
                        }
319
 
                        else  if (right)
320
 
                        {
321
 
                                PagingLandScapeRenderable * const rn = r->_getNeighbor(EAST);
322
 
                                if (rn)
323
 
                                { 
324
 
                                        if (down)
325
 
                                        {
326
 
                                                PagingLandScapeRenderable * const rnUp = rn->_getNeighbor(NORTH);
327
 
                                                if (rnUp && rnUp->isLoaded ())
328
 
                                                { 
329
 
                                                        rnUp->adjustDeformationRectangle (0, tSize); 
330
 
                                                }
331
 
                                        }
332
 
                                        else  if (up)
333
 
                                        {
334
 
                                                PagingLandScapeRenderable * const rnDown = rn->_getNeighbor(SOUTH);
335
 
                                                if (rnDown && rnDown->isLoaded ())
336
 
                                                { 
337
 
                                                        rnDown->adjustDeformationRectangle (0, 0); 
338
 
                                                }
339
 
                                        }
340
 
                                        if (rn)
341
 
                                        { 
342
 
                                                rn->adjustDeformationRectangle (0, tileposz); 
343
 
                                        }
344
 
                                }
345
 
                        }
346
 
                        if (down)
347
 
                        {
348
 
                                PagingLandScapeRenderable * const rn = r->_getNeighbor(NORTH);
349
 
                                if (rn && rn->isLoaded ())
350
 
                                { 
351
 
                                        rn->adjustDeformationRectangle (tileposx, tSize); 
352
 
                                }
353
 
                        }
354
 
                        else  if (up)
355
 
                        {
356
 
                                PagingLandScapeRenderable * const rn = r->_getNeighbor(SOUTH);
357
 
                                if (rn && rn->isLoaded ())
358
 
                                { 
359
 
                                        rn->adjustDeformationRectangle (tileposx, 0); 
360
 
                                }
361
 
                        }
362
 
                }
363
 
        
364
 
                adjustDeformationRectangle (x, z);
365
 
                return true;
366
 
        }
367
 
        return false;
368
 
}
369
 
 
370
 
//-----------------------------------------------------------------------
371
 
bool PagingLandScapeData2D::setHeight(unsigned int x, unsigned int z, const Real& h)
372
 
{
373
 
        const unsigned int Pos = static_cast <unsigned int> ((z * mSize)+ x);
374
 
        assert  (mHeightData &&  mMaxArrayPos > Pos); 
375
 
        return setHeight(x, z, Pos, h);
376
 
}
377
 
#endif //_MAPSPLITTER
378
 
 
379
 
//-----------------------------------------------------------------------
380
 
Vector3 PagingLandScapeData2D::getNormal(const Real& mX, const Real& mZ) const
381
 
{
382
 
        // First General method : (9 adds and 6 muls + a normalization)
383
 
        //        *---v3--*
384
 
        //        |   |   |
385
 
        //        |   |   |
386
 
        //        v1--X--v2
387
 
        //        |   |   |
388
 
        //        |   |   |
389
 
        //        *---v4--*
390
 
        //
391
 
        //        U = v2 - v1;
392
 
        //        V = v4 - v3;
393
 
        //        N = Cross(U, V);
394
 
        //        N.normalise;
395
 
        //
396
 
        // BUT IN CASE OF A HEIGHTMAP :
397
 
        //
398
 
        //   if you do some math by hand before you code,
399
 
        //   you can see that N is immediately given by
400
 
        //  Approximation (2 adds and a normalization)
401
 
        //
402
 
        //        N = Vector3(z[x-1][y] - z[x+1][y], z[x][y-1] - z[x][y+1], 2);
403
 
        //        N.normalise();
404
 
        //
405
 
        // or even using SOBEL operator VERY accurate!
406
 
        // (14 adds and a normalization)
407
 
        //
408
 
        //       N = Vector3 (z[x-1][y-1] + z[x-1][y] + z[x-1][y] + z[x-1][y+1] - z[x+1][y-1] - z[x+1][y] - z[x+1][y] - z[x+1][y+1],
409
 
        //                     z[x-1][y-1] + z[x][y-1] + z[x][y-1] + z[x+1][y-1] - z[x-1][y+1] - z[x][y+1] - z[x][y+1] - z[x+1][y+1],
410
 
        //                     8);
411
 
        //       N.normalize();
412
 
 
413
 
 
414
 
        // Fast SOBEL filter
415
 
 
416
 
        const size_t pageSize = mSize - 1;
417
 
 
418
 
        // the divider make sure we do respect proportion  (height and width proportional to y)
419
 
        const Real Divider = static_cast <Real> (pageSize) / mParent->getOptions()->scale.y;
420
 
 
421
 
        assert (mHeightData);
422
 
 
423
 
#define  getisIn(a, b) (mHeightData[static_cast<unsigned int> (a) + static_cast<unsigned int> (b) * mSize])
424
 
 
425
 
        if (mX > 0 && mZ > 0 &&
426
 
            mX < pageSize && mZ < pageSize)
427
 
        {
428
 
 
429
 
                //                        Vector3 result (getisIn(x-1,z-1) + getisIn (x-1, z) + getisIn (x-1, z) + getisIn (x-1, z+1) - getisIn (x+1, z-1) - getisIn (x+1, z) - getisIn (x+1, z) - getisIn (x+1, z+1),
430
 
                //                                            8.0f,
431
 
                //                                        getisIn (x-1, z-1) + getisIn (x, z-1) + getisIn (x, z-1) + getisIn (x+1, z-1) - getisIn (x-1, z+1) - getisIn (x, z+1) - getisIn (x, z+1) - getisIn (x+1, z+1));
432
 
 
433
 
                Vector3 result((getisIn (mX - 1 , mZ)     - getisIn (mX + 1 , mZ)) * Divider,
434
 
                               2.0f,
435
 
                               (getisIn (mX,      mZ - 1) - getisIn (mX     , mZ + 1)) * Divider);
436
 
 
437
 
                result.normalise ();
438
 
 
439
 
                return result;
440
 
        }
441
 
        else
442
 
        {   
443
 
                unsigned int x = static_cast <unsigned int> (mX);
444
 
                unsigned int z = static_cast <unsigned int> (mZ);
445
 
                Real a,b,c,d;
446
 
 
447
 
                if (x == 0)
448
 
                {                
449
 
                        a = getisIn (x  , z);
450
 
                        b = getisIn (x + 1, z);
451
 
                }
452
 
                else if (x == pageSize)
453
 
                {                
454
 
                        a = getisIn (x - 1 , z);
455
 
                        b = getisIn (x , z);
456
 
                }
457
 
                else
458
 
                {
459
 
                        a = getisIn (x - 1 , z);
460
 
                        b = getisIn (x + 1, z);
461
 
                }
462
 
 
463
 
                if (z == 0)
464
 
                {
465
 
                        c = getisIn (x , z);
466
 
                        d = getisIn (x , z + 1);
467
 
                }
468
 
                else if (z == pageSize)
469
 
                {
470
 
                        c = getisIn (x , z - 1);
471
 
                        d = getisIn (x , z);
472
 
                }
473
 
                else
474
 
                {
475
 
                        c = getisIn (x , z - 1);
476
 
                        d = getisIn (x , z + 1);
477
 
                }
478
 
 
479
 
 
480
 
                Vector3 result((a     - b) * Divider,
481
 
                               2.0f,
482
 
                               (c - d) * Divider);
483
 
                result.normalise ();
484
 
                return result;
485
 
 
486
 
#ifdef _NOWAY
487
 
#ifndef _MAPSPLITTER
488
 
#define  getisOut(a, b) (PagingLandScapeData2DManager::getSingleton ().getHeightAtPage (mPageX, mPageZ, static_cast<int> (a), static_cast<int> (b)))
489
 
 
490
 
//                       Vector3 result (getisOut(x-1,z-1) + getisOut (x-1, z) + getisOut (x-1, z) + getisOut (x-1, z+1) - getisOut (x+1, z-1) - getisOut (x+1, z) - getisOut (x+1, z) - getisOut (x+1, z+1),
491
 
//                                        8.0f,
492
 
//                                        getisOut (x-1, z-1) + getisOut (x, z-1) + getisOut (x, z-1) + getisOut (x+1, z-1) - getisOut (x-1, z+1) - getisOut (x, z+1) - getisOut (x, z+1) - getisOut (x+1, z+1));
493
 
 
494
 
                Vector3 result((getisOut (mX - 1 , mZ)     - getisOut (mX + 1 , mZ)) * Divider,
495
 
                               2.0f,
496
 
                               (getisOut (mX,      mZ - 1) - getisOut (mX     , mZ + 1)) * Divider);
497
 
 
498
 
                result.normalise ();
499
 
 
500
 
 
501
 
                return result;
502
 
#endif //_MAPSPLITTER
503
 
#endif //
504
 
 
505
 
        }
506
 
}
507
 
 
508
 
 
509
 
} //namespace
510
 
 
511
 
 
512
 
 
513
 
 
514
 
 
515
 
 
516
 
 
517
 
 
518
 
 
519
 
 
520
 
 
521
 
 
522
 
 
523
 
 
524
 
 
525
 
 
526
 
 
527