当前位置: 首页>>代码示例>>C++>>正文


C++ setBoundingBox函数代码示例

本文整理汇总了C++中setBoundingBox函数的典型用法代码示例。如果您正苦于以下问题:C++ setBoundingBox函数的具体用法?C++ setBoundingBox怎么用?C++ setBoundingBox使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了setBoundingBox函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setRenderQueueGroup

AmbientLight::AmbientLight()
{
	setRenderQueueGroup(Ogre::RENDER_QUEUE_2);

	// Render op setup
	mRenderOp.vertexData = new Ogre::VertexData();
	mRenderOp.indexData = 0;
	GeomUtils::createQuad(mRenderOp.vertexData);
	mRenderOp.operationType = Ogre::RenderOperation::OT_TRIANGLE_STRIP; 
	mRenderOp.useIndexes = false; 

	// Set bounding box (pretty much infinite)
	setBoundingBox(Ogre::AxisAlignedBox(-10000,-10000,-10000,10000,10000,10000));
	mRadius = 15000;

	// Ambient lighting material
	mMatPtr = Ogre::MaterialManager::getSingleton().getByName("Render/AmbientLight");
	assert(mMatPtr.isNull() == false);
	mMatPtr->load();
	
	// Explicitly bind samplers for OpenGL
	if (Ogre::Root::getSingleton().getRenderSystem()->getName().find("OpenGL 3+") != Ogre::String::npos)
	{
		mMatPtr->getTechnique(0)->getPass(0)->getFragmentProgramParameters()->setNamedConstant("Tex0", 0);
		mMatPtr->getTechnique(0)->getPass(0)->getFragmentProgramParameters()->setNamedConstant("Tex1", 1);
		mMatPtr->getTechnique(0)->getPass(0)->getFragmentProgramParameters()->setNamedConstant("Tex2", 2);
	}
}
开发者ID:arbonagw,项目名称:Soyouz,代码行数:28,代码来源:ambient.cpp

示例2: mObjectBoundingBox

Blob::Blob(const cv::Rect_<float>& bb, ObjectState state, ApplicationContext* context)
: mObjectBoundingBox(bb)
, mState(state)
, mContext(context)
{
	setBoundingBox(bb);
}
开发者ID:yzbx,项目名称:opencv-qt,代码行数:7,代码来源:Blob.cpp

示例3: if

void SceneGraph::recomputeBoundingBox() 
{
	Node	*node;
	float	center[3];
	float	size[3];

	BoundingBox bbox;

	for (node=getNodes(); node; node=node->nextTraversal()) {
		if (node->isGroupingNode()) {
			GroupingNode *gnode = (GroupingNode *)node;
			gnode->getBoundingBoxCenter(center);
			gnode->getBoundingBoxSize(size);
			bbox.addBoundingBox(center, size);
		}
		else if (node->isGeometryNode()) { 
			GeometryNode *gnode = (GeometryNode *)node; 
			gnode->getBoundingBoxCenter(center); 
			gnode->getBoundingBoxSize(size); 
			bbox.addBoundingBox(center, size); 
		} 
	}

	setBoundingBox(&bbox);
}
开发者ID:lukfugl,项目名称:raytracer,代码行数:25,代码来源:SceneGraph.cpp

示例4: INFO

void ColorChange::setup() {  
  INFO("Creating a ColorChange ...");

  if(colorMask & BLUE)
      color = "FlatBlue";
  else if(colorMask & GREEN)
    color = "FlatGreen";
  else if(colorMask & RED)
    color = "FlatRed";
  else if(colorMask & GREY)
    color = "FlatGrey";
  
  colorChange = ObjectPtr(new Object(
                   LoadManager::getMesh("cube.obj"),
                   MaterialManager::getMaterial(color)));

  RenderEngine::getRenderElement("regular")->addObject(colorChange);

  colorChange->scale(glm::vec3(.5, .5, .5));
  colorChange->translate(position);

    
  setCollisionID(16);
  setCollideWithID(2);
  setCanCollide(true);

  setBoundingBox(BoundingBox(glm::vec3(.5f,.5f,.5f), glm::vec3(-.5f,-.5f,-.5f)));
  getBoundingBox()->setPosition(position);
}
开发者ID:MatheusFaria,项目名称:flood-fill,代码行数:29,代码来源:color_change.cpp

示例5: configOptions

void ServicesDbReader::setConfiguration(const Settings& conf)
{
  ConfigOptions configOptions(conf);
  setMaxElementsPerMap(configOptions.getMaxElementsPerPartialMap());
  setUserEmail(configOptions.getServicesDbReaderEmail());
  setBoundingBox(configOptions.getConvertBoundingBox());
}
开发者ID:digideskio,项目名称:hootenanny,代码行数:7,代码来源:ServicesDbReader.cpp

示例6: setFileName

//------------------------------------------------------------------------------
// TriMesh implementation
bool TriMesh::loadFile(QString fileName, size_t /*maxVertexCount*/)
{
    // maxVertexCount is ignored - not sure there's anything useful we can do
    // to respect it when loading a mesh...
    PlyLoadInfo info;
    if (!loadPlyFile(fileName, info))
        return false;
    setFileName(fileName);
    V3d offset = V3d(info.offset[0], info.offset[1], info.offset[2]);
    setOffset(offset);
    setCentroid(getCentroid(offset, info.verts));
    setBoundingBox(getBoundingBox(offset, info.verts));
    m_verts.swap(info.verts);
    m_colors.swap(info.colors);
    m_texcoords.swap(info.texcoords);
    m_triangles.swap(info.triangles);
    m_edges.swap(info.edges);
    if (!info.textureFileName.isEmpty())
    {
        QImage image;
        if (image.load(info.textureFileName))
            m_texture.reset(new Texture(image));
        else
            g_logger.warning("Could not load texture %s for model %s", info.textureFileName, fileName);
    }
    //makeSmoothNormals(m_normals, m_verts, m_triangles);
    //makeEdges(m_edges, m_triangles);
    return true;
}
开发者ID:JoshChristie,项目名称:displaz,代码行数:31,代码来源:TriMesh.cpp

示例7: Enemy

Trundler::Trundler(int blockX, int blockY, Field *field)
  : Enemy(TRUNDLER, field), dir(TRUNDLE_RIGHT), inAir(false), yvel(0),
    yvelTimer(TRUNDLER_FALL_DELAY)
{
  moveAbs(blockX * 32, blockY * 32);
  setBoundingBox(22, 25, 3, 3);
}
开发者ID:remar,项目名称:castle,代码行数:7,代码来源:Trundler.cpp

示例8:

RenderObjectPtr
MeshRenderComponent::buildRenderObject(MeshPropertyPtr mesh, RenderBufferPtr buffer) noexcept
{
	auto material = this->getMaterial(mesh->getMaterialID());
	if (material)
	{
		auto renderObject = std::make_shared<RenderMesh>();
		renderObject->setRenderBuffer(buffer);
		renderObject->setBoundingBox(mesh->getBoundingBox());
		renderObject->setRenderListener(this);

		renderObject->setMaterial(material);

		renderObject->setCastShadow(this->getCastShadow());
		renderObject->setReceiveShadow(this->getReceiveShadow());

		renderObject->setLayer(this->getGameObject()->getLayer());

		renderObject->setTransform(this->getGameObject()->getTransform());
		renderObject->setTransformInverse(this->getGameObject()->getTransformInverse());
		renderObject->setTransformInverseTranspose(this->getGameObject()->getTransformInverseTranspose());

		return renderObject;
	}

	return nullptr;
}
开发者ID:Kingwl,项目名称:ray,代码行数:27,代码来源:mesh_render_component.cpp

示例9: previewItem

/**
 * @brief cwCaptureViewport::updateBoundingBox
 *
 * This will update the bounding box for the viewport capture.
 *
 * This is useful for displaying annotation, and interactions ontop of the item
 * in qml.
 */
void cwCaptureViewport::updateBoundingBox()
{
    QTransform transform = previewItem()->transform();
    QRectF paperRect = previewItem()->boundingRect();
    QRectF boundingBoxRect = transform.mapRect(paperRect);
    setBoundingBox(boundingBoxRect);
}
开发者ID:Cavewhere,项目名称:cavewhere,代码行数:15,代码来源:cwCaptureViewport.cpp

示例10: clear

//-------------------------------------------------------------------------------------
//sets the actual corners of the box
void SelectionBox::setCorners(float left, float top, float right, float bottom)
{
    /** Set the coordinate\n
     *  first change the coordinate to -1~1\n
     *  draw the rectangle line\n
	*/
	left = left * 2 - 1;
	right = right * 2 - 1;
	top = 1 - top * 2;
	bottom = 1 - bottom * 2;
	
  	std::cout << "4......drawing\n";
	std::cout << "left:" << left << std::endl;
	std::cout << "right:" << right << std::endl;
	std::cout << "bottom:" << bottom << std::endl;
	std::cout << "top:" << top << std::endl;

	clear();
	begin("",Ogre::RenderOperation::OT_LINE_STRIP);
		position(left, top, -1);
		position(right, top, -1);
		position(right, bottom, -1);
		position(left, bottom, -1);
		position(left, top, -1);
	end();

	setBoundingBox(Ogre::AxisAlignedBox::BOX_INFINITE);
}
开发者ID:lypan,项目名称:Ogre3D,代码行数:30,代码来源:SelectionBox.cpp

示例11: setRenderQueueGroup

	AmbientLight::AmbientLight()
	{
		setRenderQueueGroup(RENDER_QUEUE_2);

		mRenderOp.vertexData = new VertexData();
		mRenderOp.indexData = 0;

		GeomUtils::createQuad(mRenderOp.vertexData);

		mRenderOp.operationType = RenderOperation::OT_TRIANGLE_STRIP; 
		mRenderOp.useIndexes = false; 

		// Set bounding
		setBoundingBox(AxisAlignedBox(-10000,-10000,-10000,10000,10000,10000));
		mRadius = 15000;

		mMatPtr = MaterialManager::getSingleton().getByName("DeferredShading/AmbientLight");
		assert(mMatPtr.isNull()==false);
		mMatPtr->load();

		//This shader needs to be aware if its running under OpenGL or DirectX.
		//Real depthFactor = (Root::getSingleton().getRenderSystem()->getName() ==
		//    "OpenGL Rendering Subsystem") ? 2.0 : 1.0;
		//mMatPtr->getTechnique(0)->getPass(0)->getFragmentProgramParameters()->setNamedConstant(
		//        "depthFactor", depthFactor);
	}
开发者ID:mavaL,项目名称:MiniCraft,代码行数:26,代码来源:AmbientLight.cpp

示例12: Vector3

   void EffectBillboardChain::updateBoundingBox()
   {
       if (mChainElementList.size() < 2)
          return;

       Ogre::Real width = mChainElementList[0].width;
       Vector3 widthVector = Vector3(width, width, width);
       const Vector3& position = mChainElementList[0].position;
       Vector3 minimum = position - widthVector;
       Vector3 maximum = position + widthVector;

       for (unsigned int i = 1; i < mChainElementList.size(); i++)
       {
         // Update the bounds of the bounding box
          Ogre::Real width = mChainElementList[i].width;
          Vector3 widthVector = Vector3(width, width, width);
          const Vector3& position = mChainElementList[i].position;

          minimum.makeFloor(position - widthVector);
          maximum.makeCeil(position + widthVector);
       }

       // Set the current bounding box
       setBoundingBox(AxisAlignedBox(minimum, maximum));

       // Set the current radius
       mRadius = Math::Sqrt(std::max(minimum.squaredLength(), maximum.squaredLength()));
   }
开发者ID:dodong471520,项目名称:pap,代码行数:28,代码来源:OgreBillboardChain.cpp

示例13: setBoundingBox

void geode::getBounds(Matrix4 m) {
	m.identity();
	m.scale(2, 2, 2);
	for (int i = 0; i < 4; i++) {
		if (m.get(0, i) < min.x) {
			min.x = m.get(0, i);
		}

		if (m.get(0, i) > max.x) {
			max.x = m.get(0, i);
		}

		if (m.get(1, i) < min.y) {
			min.y = m.get(1, i);
		}

		if (m.get(1, i) > max.y) {
			max.y = m.get(1, i);
		}

		if (m.get(2, i) < min.z) {
			min.z = m.get(2, i);
		}

		if (m.get(2, i) > max.z) {
			max.z = m.get(2, i);
		}
	}

	setBoundingBox(min, max);
}
开发者ID:Wooklien,项目名称:Computer-Graphics,代码行数:31,代码来源:geode.cpp

示例14: v

//==============================================================================
void DrawableText::refreshFromValueTree (const ValueTree& tree, ComponentBuilder&)
{
    ValueTreeWrapper v (tree);
    setComponentID (v.getID());

    const RelativeParallelogram newBounds (v.getBoundingBox());
    const RelativeCoordinate newFontHeight (v.getFontHeight());
    const RelativeCoordinate newFontHScale (v.getFontHorizontalScale());
    const Colour newColour (v.getColour());
    const Justification newJustification (v.getJustification());
    const String newText (v.getText());
    const Font newFont (v.getFont());

    if (text != newText || font != newFont || justification != newJustification
         || colour != newColour || bounds != newBounds
         || newFontHeight != fontHeight || newFontHScale != fontHScale)
    {
        setBoundingBox (newBounds);
        setFontHeight (newFontHeight);
        setFontHorizontalScale (newFontHScale);
        setColour (newColour);
        setFont (newFont, false);
        setJustification (newJustification);
        setText (newText);
    }
}
开发者ID:0x4d52,项目名称:KlangFalter,代码行数:27,代码来源:juce_DrawableText.cpp

示例15: controller

//==============================================================================
void DrawableImage::refreshFromValueTree (const ValueTree& tree, ComponentBuilder& builder)
{
    const ValueTreeWrapper controller (tree);
    setComponentID (controller.getID());

    const float newOpacity = controller.getOpacity();
    const Colour newOverlayColour (controller.getOverlayColour());

    Image newImage;
    const var imageIdentifier (controller.getImageIdentifier());


    jassert (builder.getImageProvider() != 0 || imageIdentifier.isVoid()); // if you're using images, you need to provide something that can load and save them!

    if (builder.getImageProvider() != nullptr)
        newImage = builder.getImageProvider()->getImageForIdentifier (imageIdentifier);

    const RelativeParallelogram newBounds (controller.getBoundingBox());

    if (bounds != newBounds || newOpacity != opacity
         || overlayColour != newOverlayColour || image != newImage)
    {
        repaint();
        opacity = newOpacity;
        overlayColour = newOverlayColour;

        if (image != newImage)
            setImage (newImage);

        setBoundingBox (newBounds);
    }
}
开发者ID:sonic59,项目名称:JuceEditor,代码行数:33,代码来源:juce_DrawableImage.cpp


注:本文中的setBoundingBox函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。