Exemple #1
0
//-------------------------------------------------------------------------------------
//an overridden function to do the same as before but you can pass vector2s instead
void SelectionBox::setCorners(const Ogre::Vector2& topLeft, const Ogre::Vector2& bottomRight)
{
    /** Set the overridden coordinate\n
     *  call the original by split out the vector2\n
	*/	
	setCorners(topLeft.x, topLeft.y, bottomRight.x, bottomRight.y);
}
/*
 * BoundingBox
 * 
 * parameter _boundingBox - BoundingBox *
 */
BoundingBox::BoundingBox(BoundingBox * _boundingBox) {
	data = new float[24];
	float * origin = _boundingBox->getCorner(0);
	float * extent = _boundingBox->getCorner(7);
	setCorners(origin[0], origin[1], origin[2], extent[0], extent[1], extent[2]);
	delete[] origin;
	delete[] extent;
} // end BoundingBox()
Exemple #3
0
void rtPolyData2D::setCorners(double orig[3], double p1[3], double p2[3]) {
  double opp[3];
  double vec1[3], vec2[3];

  for (int ix1=0; ix1<3; ix1++) {
    vec1[ix1] = p1[ix1] - orig[ix1];
    vec2[ix1] = p2[ix1] - orig[ix1];
    opp[ix1] = orig[ix1] + vec1[ix1] + vec2[ix1];
  }

  setCorners(orig, p1, opp, p2);
}
Exemple #4
0
istream& 
BoundingBox::read(istream& anInStream)
{
  IPoint topL;
  IPoint bottomR;
  qgReadObjName(anInStream, "BoundingBox");
  qgReadObjData(anInStream, topL);
  qgReadObjData(anInStream, bottomR);

  setCorners(topL, bottomR);

  return anInStream;
}
Exemple #5
0
void SelectionBox::setCorners(const Ogre::Vector2& topLeft, const Ogre::Vector2& bottomRight)
{
	setCorners(topLeft.x, topLeft.y, bottomRight.x, bottomRight.y);
}
Exemple #6
0
BoundingBox::BoundingBox(int aX1, int aY1, int aX2, int aY2)
{
  setCorners(aX1, aY1, aX2, aY2);
}
Exemple #7
0
BoundingBox::BoundingBox(const IPoint& aPt1,
			 const IPoint& aPt2)
{
   setCorners(aPt1, aPt2);
}
Exemple #8
0
void
BoundingBox::setCorners(const IPoint& aPt1, const IPoint& aPt2)
{
  setCorners(aPt1.x(), aPt1.y(), aPt2.x(), aPt2.y());
}
/*
 * BoundingBox
 *
 * parameter originX - float
 * parameter originY - float
 * parameter originZ - float
 * parameter extentX - float
 * parameter extentY - float
 * parameter extentZ - float
 */
BoundingBox::BoundingBox(float originX, float originY, float originZ, float extentX, float extentY, float extentZ) {
	data = new float[24];
	setCorners(originX, originY, originZ, extentX, extentY, extentZ);
} // end BoundingBox()
/*
 * BoundingBox
 */
BoundingBox::BoundingBox(void) {
	data = new float[24];
	setCorners(0, 0, 0, 1, 1, 1);
} // end BoundingBox()