Changeset 272 for experimental/TerrainTest/terrainModificationTechnique.cpp
- Timestamp:
- Mar 9, 2011, 10:41:24 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
experimental/TerrainTest/terrainModificationTechnique.cpp
r270 r272 1 #pragma once 1 /* -*-c++-*- osgVisual - Copyright (C) 2009-2011 Torben Dannhauer 2 * 3 * This library is based on OpenSceneGraph, open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 5 * (at your option) any later version. The full license is in LICENSE file 6 * included with this distribution, and on the openscenegraph.org website. 7 * 8 * osgVisual requires for some proprietary modules a license from the correspondig manufacturer. 9 * You have to aquire licenses for all used proprietary modules. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * OpenSceneGraph Public License for more details. 15 */ 2 16 3 17 #include "terrainModificationTechnique.h" … … 13 27 14 28 } 15 16 17 18 region::region(osg::HeightField& h)19 {20 _lat_min = h.getOrigin()[1];21 _lat_max = _lat_min + h.getNumRows() * h.getYInterval();22 _lon_min = h.getOrigin()[0];23 _lon_max = _lon_min + h.getNumColumns() * h.getXInterval();24 }25 26 bool region::isInside(region& outsider)27 {28 if( outsider._lat_min <= _lat_min && _lat_max <= outsider._lat_max &&29 outsider._lon_min <= _lon_min && _lon_max <= outsider._lon_max )30 return true;31 else32 return false;33 }34 35 bool region::isFullOrPartiallyInside(region& outsider)36 {37 if( outsider._lat_min < _lat_max && _lat_min < outsider._lat_max &&38 outsider._lon_min < _lon_max && _lon_min < outsider._lon_max )39 return true;40 else41 return false;42 }43
Note: See TracChangeset
for help on using the changeset viewer.