本文整理汇总了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);
}
}
示例2: mObjectBoundingBox
Blob::Blob(const cv::Rect_<float>& bb, ObjectState state, ApplicationContext* context)
: mObjectBoundingBox(bb)
, mState(state)
, mContext(context)
{
setBoundingBox(bb);
}
示例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);
}
示例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);
}
示例5: configOptions
void ServicesDbReader::setConfiguration(const Settings& conf)
{
ConfigOptions configOptions(conf);
setMaxElementsPerMap(configOptions.getMaxElementsPerPartialMap());
setUserEmail(configOptions.getServicesDbReaderEmail());
setBoundingBox(configOptions.getConvertBoundingBox());
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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()));
}
示例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);
}
示例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);
}
}
示例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);
}
}