本文整理汇总了C++中ogre::MaterialPtr::setReceiveShadows方法的典型用法代码示例。如果您正苦于以下问题:C++ MaterialPtr::setReceiveShadows方法的具体用法?C++ MaterialPtr::setReceiveShadows怎么用?C++ MaterialPtr::setReceiveShadows使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::MaterialPtr
的用法示例。
在下文中一共展示了MaterialPtr::setReceiveShadows方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createMaterials
void GridLineFactory::createMaterials(void)
{
Ogre::MaterialPtr myManualObjectMaterial = Ogre::MaterialManager::getSingleton().create("RedGridLine","General");
myManualObjectMaterial->setReceiveShadows(false);
myManualObjectMaterial->getTechnique(0)->setLightingEnabled(true);
myManualObjectMaterial->getTechnique(0)->getPass(0)->setDiffuse(1,0,0,0);
myManualObjectMaterial->getTechnique(0)->getPass(0)->setAmbient(1,0,0);
myManualObjectMaterial->getTechnique(0)->getPass(0)->setSelfIllumination(1,0,0);
//myManualObjectMaterial->dispose(); // dispose pointer, not the material
myManualObjectMaterial = Ogre::MaterialManager::getSingleton().create("GreenGridLine","General");
myManualObjectMaterial->setReceiveShadows(false);
myManualObjectMaterial->getTechnique(0)->setLightingEnabled(true);
myManualObjectMaterial->getTechnique(0)->getPass(0)->setDiffuse(0,1,0,0);
myManualObjectMaterial->getTechnique(0)->getPass(0)->setAmbient(0,1,0);
myManualObjectMaterial->getTechnique(0)->getPass(0)->setSelfIllumination(0,1,0);
myManualObjectMaterial = Ogre::MaterialManager::getSingleton().create("BlueGridLine","General");
myManualObjectMaterial->setReceiveShadows(false);
myManualObjectMaterial->getTechnique(0)->setLightingEnabled(true);
myManualObjectMaterial->getTechnique(0)->getPass(0)->setDiffuse(0,0,1,0);
myManualObjectMaterial->getTechnique(0)->getPass(0)->setAmbient(0,0,1);
myManualObjectMaterial->getTechnique(0)->getPass(0)->setSelfIllumination(0,0,1);
//materialsCreated = true;
}
示例2: CreateSky
void EC_SkyBox::CreateSky()
{
if (!ViewEnabled())
return;
if (renderer_.expired())
return;
QString currentMaterial = materialRef.Get().ref;
Ogre::MaterialPtr materialPtr = Ogre::MaterialManager::getSingleton().getByName(currentMaterial.toStdString().c_str());
if (materialPtr.isNull())
{
LogError("Could not get SkyBox material : " + currentMaterial.toStdString());
return;
}
materialPtr->setReceiveShadows(false);
try
{
//RexTypes::Vector3 v = angleAxisAttr.Get();
//Ogre::Quaternion rotation(Ogre::Degree(90.0), Ogre::Vector3(1, 0, 0));
Quaternion o = orientation.Get();
renderer_.lock()->GetSceneManager()->setSkyBox(true, currentMaterial.toStdString().c_str(), distance.Get(),
drawFirst.Get(), Ogre::Quaternion(o.w, o.x, o.y, o.z));
}
catch(Ogre::Exception& e)
{
LogError("Could not set SkyBox: " + std::string(e.what()));
}
}
示例3: mNode
PDebugger::PDebugger(Ogre::SceneManager *mgr, PLevel *lv, PPlayer *pl) :
mNode(NULL), mLevel(lv), mPlayer(pl)
{
mMObject = new Ogre::ManualObject("PLevelDebug");
Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().create("matDebug","Grup_prova");
mat->setReceiveShadows(false);
mat->getTechnique(0)->setLightingEnabled(true);
mat->getTechnique(0)->getPass(0)->setDiffuse(0,1,0,0);
mat->getTechnique(0)->getPass(0)->setAmbient(0,1,0);
mat->getTechnique(0)->getPass(0)->setSelfIllumination(0,1,0);
mMObject->begin("matDebug", Ogre::RenderOperation::OT_LINE_LIST);
//comencem indexacio
cpShape *shape;
cpSegmentShape *s;
cpVect v;
const Ogre::Real zeta = -7.0f;
for(int i=0;; i++)
{
shape = mLevel->getSegment(i);
if(shape==NULL) break; //ja hem acabat
v = cpSegmentShapeGetA(shape);
mMObject->position(v.x, v.y, zeta);
std::cerr << v.x << " " << v.y << std::endl;
v = cpSegmentShapeGetB(shape);
mMObject->position(v.x, v.y, zeta);
std::cerr << v.x << " " << v.y << std::endl;
}
mMObject->end();
mNode = mgr->getRootSceneNode()->createChildSceneNode("PLevelDebugNode");
mNode->attachObject(mMObject);
}
示例4: CreateSky
void EC_Sky::CreateSky()
{
if (!ViewEnabled())
return;
if (world_.expired())
return;
QString currentMaterial = materialRef.Get().ref;
Ogre::MaterialPtr materialPtr = Ogre::MaterialManager::getSingleton().getByName(currentMaterial.toStdString().c_str());
//Ogre::MaterialPtr materialPtr = Ogre::MaterialManager::getSingleton().getByName(framework->Asset()->LookupAssetRefToStorage(materialRef.Get().ref).toStdString().c_str());
if (materialPtr.isNull())
{
LogError("Could not get SkyBox material : " + currentMaterial.toStdString());
return;
}
materialPtr->setReceiveShadows(false);
try
{
world_.lock()->GetSceneManager()->setSkyBox(true, currentMaterial.toStdString().c_str(), distance.Get(),
drawFirst.Get(), orientation.Get());
}
catch(Ogre::Exception& e)
{
LogError("Could not set SkyBox: " + std::string(e.what()));
}
}
示例5: _drawGridPlane
void _drawGridPlane(void)
{
Ogre::ManualObject* gridPlane = mSceneMgr->createManualObject("GridPlane");
Ogre::SceneNode* gridPlaneNode = mSceneMgr->getRootSceneNode()->createChildSceneNode("GridPlaneNode");
Ogre::MaterialPtr gridPlaneMaterial = Ogre::MaterialManager::getSingleton().create("GridPlanMaterial", "General");
gridPlaneMaterial->setReceiveShadows(false);
gridPlaneMaterial->getTechnique(0)->setLightingEnabled(true);
gridPlaneMaterial->getTechnique(0)->getPass(0)->setDiffuse(1, 1, 1, 0);
gridPlaneMaterial->getTechnique(0)->getPass(0)->setAmbient(1, 1, 1);
gridPlaneMaterial->getTechnique(0)->getPass(0)->setSelfIllumination(1, 1, 1);
gridPlane->begin("GridPlaneMaterial", Ogre::RenderOperation::OT_LINE_LIST);
for (int i = 0; i < 21; i++)
{
gridPlane->position(-500.0f, 0.0f, 500.0f - i * 50);
gridPlane->position(500.0f, 0.0f, 500.0f - i * 50);
gridPlane->position(-500.f + i * 50, 0.f, 500.0f);
gridPlane->position(-500.f + i * 50, 0.f, -500.f);
}
gridPlane->end();
gridPlaneNode->attachObject(gridPlane);
}
示例6: initialize
void OgreBtDebugDrawer::initialize(Ogre::SceneManager* const sceneManager,
const bool drawTrajectory) {
mDrawTrajectory = drawTrajectory;
mContactPoints = &mContactPoints1;
mLines = new Ogre::ManualObject("BulletPhysicsLines1");
mLines2 = new Ogre::ManualObject("BulletPhysicsLines2");
mTriangles = new Ogre::ManualObject("BulletPhysicsTriangles1");
mTriangles2 = new Ogre::ManualObject("BulletPhysicsTriangles2");
mLines->setDynamic(true);
mLines2->setDynamic(true);
mTriangles->setDynamic(true);
mTriangles2->setDynamic(true);
//mLines->estimateVertexCount( 100000 );
//mLines->estimateIndexCount( 0 );
sceneManager->getRootSceneNode()->attachObject(mLines);
sceneManager->getRootSceneNode()->attachObject(mLines2);
sceneManager->getRootSceneNode()->attachObject(mTriangles);
sceneManager->getRootSceneNode()->attachObject(mTriangles2);
static const char* matName = "OgreBulletCollisionsDebugDefault";
Ogre::MaterialPtr mtl =
Ogre::MaterialManager::getSingleton().getDefaultSettings()->clone(
matName);
mtl->setReceiveShadows(false);
mtl->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA);
mtl->setDepthBias(0.1, 0);
Ogre::TextureUnitState * tu =
mtl->getTechnique(0)->getPass(0)->createTextureUnitState();
tu->setColourOperationEx(Ogre::LBX_SOURCE1, Ogre::LBS_DIFFUSE);
mtl->getTechnique(0)->setLightingEnabled(false);
//mtl->getTechnique(0)->setSelfIllumination( ColourValue::White );
//for the ogre text
Ogre::Root::getSingleton().addFrameListener(this);
//TODO: Add 3D text writing capability to ogreBtdebugdrawer #133.
// olm = Ogre::OverlayManager::getSingletonPtr();
// panel = static_cast<Ogre::OverlayContainer*>(olm->createOverlayElement(
// "Panel", "OGREBTDEBUGDRAWER_GUI"));
// panel->setMetricsMode(Ogre::GMM_PIXELS);
// panel->setPosition(0, 0);
// panel->setDimensions(1.0f, 1.0f);
// overlay = olm->create("OGREBTDEBUGDRAWER_OVERLAY");
// overlay->add2D(panel);
//
// szElement = "element_";
// overlay = olm->getByName("OGREBTDEBUGDRAWER_OVERLAY");
// panel = static_cast<Ogre::OverlayContainer*>(olm->getOverlayElement(
// "OGREBTDEBUGDRAWER_GUI"));
// textArea =
// static_cast<Ogre::TextAreaOverlayElement*>(olm->createOverlayElement(
// "TextArea", szElement));
// panel->addChild(textArea);
// overlay->show();
}
示例7: createPortalMaterials
//----------------------------------------------------------------------------------------
void PortalOutlineRenderable::createPortalMaterials(void)
{
Ogre::ColourValue colour = Ogre::ColourValue(0,1,0);//
Ogre::String matname = "PortalOutlineMaterial";
Ogre::ResourceManager::ResourceCreateOrRetrieveResult result = Ogre::MaterialManager::getSingleton().createOrRetrieve(matname, "General");
if(result.second)
{
Ogre::MaterialPtr freePortalMaterial = result.first;
freePortalMaterial->setReceiveShadows(false);
freePortalMaterial->getTechnique(0)->setLightingEnabled(true);
freePortalMaterial->getTechnique(0)->getPass(0)->setDiffuse(colour);
freePortalMaterial->getTechnique(0)->getPass(0)->setAmbient(colour);
freePortalMaterial->getTechnique(0)->getPass(0)->setSelfIllumination(colour);
}
colour = Ogre::ColourValue(1,1,0);//Yellow
matname = "PortalOutlineMaterialConnected";
result = Ogre::MaterialManager::getSingleton().createOrRetrieve(matname, "General");
if(result.second)
{
Ogre::MaterialPtr connectedPortalMaterial = result.first;
connectedPortalMaterial->setReceiveShadows(false);
connectedPortalMaterial->getTechnique(0)->setLightingEnabled(true);
connectedPortalMaterial->getTechnique(0)->getPass(0)->setDiffuse(colour);
connectedPortalMaterial->getTechnique(0)->getPass(0)->setAmbient(colour);
connectedPortalMaterial->getTechnique(0)->getPass(0)->setSelfIllumination(colour);
}
colour = Ogre::ColourValue(1,0,0);//Red
matname = "PortalOutlineMaterialLinked";
result = Ogre::MaterialManager::getSingleton().createOrRetrieve(matname, "General");
if(result.second)
{
Ogre::MaterialPtr linkedPortalMaterial = result.first;
linkedPortalMaterial->setReceiveShadows(false);
linkedPortalMaterial->getTechnique(0)->setLightingEnabled(true);
linkedPortalMaterial->getTechnique(0)->getPass(0)->setDiffuse(colour);
linkedPortalMaterial->getTechnique(0)->getPass(0)->setAmbient(colour);
linkedPortalMaterial->getTechnique(0)->getPass(0)->setSelfIllumination(colour);
}
}
示例8: createColorMaterial
void createColorMaterial(const std::string& name, const Ogre::ColourValue& color, bool use_self_illumination)
{
Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().create( name, ROS_PACKAGE_NAME );
mat->setAmbient(color * 0.5f);
mat->setDiffuse(color);
if( use_self_illumination )
{
mat->setSelfIllumination(color);
}
mat->setLightingEnabled(true);
mat->setReceiveShadows(false);
}
示例9: mo
VideoVisual::VideoVisual(
const std::string &name, rendering::VisualPtr parent,
int height, int width) :
rendering::Visual(name, parent), height_(height), width_(width)
{
texture_ = Ogre::TextureManager::getSingleton().createManual(
name + "__VideoTexture__",
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
Ogre::TEX_TYPE_2D,
width_, height_,
0,
Ogre::PF_BYTE_BGRA,
Ogre::TU_DYNAMIC_WRITE_ONLY_DISCARDABLE);
Ogre::MaterialPtr material =
Ogre::MaterialManager::getSingleton().create(
name + "__VideoMaterial__", "General");
material->getTechnique(0)->getPass(0)->createTextureUnitState(
name + "__VideoTexture__");
material->setReceiveShadows(false);
double factor = 1.0;
Ogre::ManualObject mo(name + "__VideoObject__");
mo.begin(name + "__VideoMaterial__",
Ogre::RenderOperation::OT_TRIANGLE_LIST);
mo.position(-factor / 2, factor / 2, 0.51);
mo.textureCoord(0, 0);
mo.position(factor / 2, factor / 2, 0.51);
mo.textureCoord(1, 0);
mo.position(factor / 2, -factor / 2, 0.51);
mo.textureCoord(1, 1);
mo.position(-factor / 2, -factor / 2, 0.51);
mo.textureCoord(0, 1);
mo.triangle(0, 3, 2);
mo.triangle(2, 1, 0);
mo.end();
mo.convertToMesh(name + "__VideoMesh__");
Ogre::MovableObject *obj = (Ogre::MovableObject*)
this->GetSceneNode()->getCreator()->createEntity(
name + "__VideoEntity__",
name + "__VideoMesh__");
obj->setCastShadows(false);
this->AttachObject(obj);
}
示例10: mWorld
DebugDrawer::DebugDrawer(Ogre::SceneNode *node, btDynamicsWorld *world) :
mNode(node), mWorld(world), m_debugMode(0)
{
mLineDrawer = new DynamicLines(Ogre::RenderOperation::OT_LINE_LIST);
mLineDrawer->setCastShadows(false); //`
mNode->attachObject(mLineDrawer);
Ogre::ResourceGroupManager::getSingleton().createResourceGroup("BtOgre");
Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().create("BtOgre/DebugLines", "BtOgre");
mat->setReceiveShadows(false);
mat->setLightingEnabled(false);
//mat->setSelfIllumination(1,1,1);
mLineDrawer->setMaterial("BtOgre/DebugLines");/**/ //crash debug..
}
示例11: setupMaterial
void
setupMaterial() {
Ogre::MaterialPtr material = Ogre::MaterialManager::getSingleton().getDefaultSettings()->clone(
MATERIAL_NAME
);
material->setReceiveShadows(false);
material->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA);
material->setDepthBias(0.1, 0);
Ogre::TextureUnitState* textureUnitState = material->getTechnique(0)->getPass(0)->createTextureUnitState();
textureUnitState->setColourOperationEx(
Ogre::LBX_SOURCE1,
Ogre::LBS_DIFFUSE
);
material->getTechnique(0)->setLightingEnabled(false);
}
示例12:
void
Player::createHitBox(std::string name)
{
Ogre::ManualObject* myManualObject = mSceneManager->createManualObject(name);
myManualObject->setDynamic(true);
Ogre::SceneNode* myManualObjectNode = mSceneManager->getRootSceneNode()->createChildSceneNode(name + "_node");
Ogre::MaterialPtr myManualObjectMaterial = Ogre::MaterialManager::getSingleton().create(name + "Material","General");
myManualObjectMaterial->setReceiveShadows(false);
myManualObjectMaterial->getTechnique(0)->setLightingEnabled(true);
myManualObjectMaterial->getTechnique(0)->getPass(0)->setDiffuse(1,0,0,0);
myManualObjectMaterial->getTechnique(0)->getPass(0)->setAmbient(1,0,0);
myManualObjectMaterial->getTechnique(0)->getPass(0)->setSelfIllumination(1,0,0);
myManualObjectNode->attachObject(myManualObject);
}
示例13: createMaterialIfNotExists
std::string createMaterialIfNotExists(const float r, const float g, const float b, const float a)
{
char buf[128];
sprintf(buf, "ShapeColor%f;%f;%f;%f",r,g,b,a);
if(!Ogre::MaterialManager::getSingleton().getByName(buf, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME).isNull())
return buf;
Ogre::ColourValue color( r,g,b,a );
Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().create( buf, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME );
mat->setAmbient(color * 0.01f);
mat->setDiffuse(color);
mat->setLightingEnabled(true);
mat->setReceiveShadows(true);
mat->setCullingMode(Ogre::CULL_NONE);
return buf;
}
示例14: addMaterial
void AxisComponent::addMaterial(const Ogre::String &mat, Ogre::ColourValue &clr, Ogre::SceneBlendType sbt)
{
static int init=false;
if(init)
return;
else
init=true;
Ogre::MaterialPtr matptr = Ogre::MaterialManager::getSingleton().create(mat, "General");
matptr->setReceiveShadows(false);
matptr->getTechnique(0)->setLightingEnabled(true);
matptr->getTechnique(0)->getPass(0)->setDiffuse(clr);
matptr->getTechnique(0)->getPass(0)->setAmbient(clr);
matptr->getTechnique(0)->getPass(0)->setSelfIllumination(clr);
matptr->getTechnique(0)->getPass(0)->setSceneBlending(sbt);
matptr->getTechnique(0)->getPass(0)->setLightingEnabled(false);
matptr->getTechnique(0)->getPass(0)->setVertexColourTracking(Ogre::TVC_DIFFUSE);
}
示例15: allocateMaterials
void PolygonArrayDisplay::allocateMaterials(int num)
{
if (only_border_) {
return;
}
static uint32_t count = 0;
if (num > materials_.size()) {
for (size_t i = materials_.size(); num > i; i++) {
std::stringstream ss;
ss << "PolygonArrayMaterial" << count++;
Ogre::MaterialPtr material = Ogre::MaterialManager::getSingleton().create(ss.str(), "rviz");
material->setReceiveShadows(false);
material->getTechnique(0)->setLightingEnabled(true);
material->getTechnique(0)->setAmbient(0.5, 0.5, 0.5);
materials_.push_back(material);
}
}
}