本文整理汇总了C++中ogre::MovableObject::setCastShadows方法的典型用法代码示例。如果您正苦于以下问题:C++ MovableObject::setCastShadows方法的具体用法?C++ MovableObject::setCastShadows怎么用?C++ MovableObject::setCastShadows使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::MovableObject
的用法示例。
在下文中一共展示了MovableObject::setCastShadows方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: changeState
void CObject::changeState(EEntityStateTypes eState) {
switch (m_uiType) {
case OBJECT_GREEN_BUSH:
case OBJECT_LIGHT_STONE:
if (eState == EST_LIFTED) {
btRigidBody *pRB = btRigidBody::upcast(this->getCollisionObject());
ASSERT(pRB);
m_pMap->getPhysicsManager()->getWorld()->removeCollisionObject(pRB);
m_pMap->getPhysicsManager()->getWorld()->addRigidBody(pRB, COL_DAMAGE_P, MASK_DAMAGE_P_COLLIDES_WITH);
// Entities now cast shadows
Ogre::SceneNode::ObjectIterator itObject = this->getSceneNode()->getAttachedObjectIterator();
while (itObject.hasMoreElements()) {
Ogre::MovableObject* pObject = static_cast<Ogre::MovableObject*>(itObject.getNext());
pObject->setCastShadows(true);
}
}
else if (eState == EST_THROWN) {
btRigidBody *pRB = btRigidBody::upcast(this->getCollisionObject());
ASSERT(pRB);
pRB->setLinearFactor(btVector3(1, 1, 1));
pRB->setAngularFactor(0);
pRB->activate();
}
break;
}
CWorldEntity::changeState(eState);
}
示例2: setCastShadows
void Actor::setCastShadows(bool hasShadows)
{
assert(mNode);
Ogre::SceneNode::ObjectIterator it = mNode->getAttachedObjectIterator();
while(it.hasMoreElements())
{
Ogre::MovableObject* obj = static_cast<Ogre::MovableObject*>(it.getNext());
obj->setCastShadows(hasShadows);
}
}
示例3: 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);
}
示例4: movableobject_set_cast_shadows
///void setCastShadows(bool enabled);
void movableobject_set_cast_shadows(MovableObjectHandle handle, int enabled)
{
Ogre::MovableObject* obj = static_cast<Ogre::MovableObject*>(handle);
obj->setCastShadows(enabled);
}