but I'm using Octtree with this tutorial by ChristianClavet.
The collision function use ISceneNode instead of IAnimatedMeshSceneNode.
So it's not possible to add shadows to the octtrees.
If you take a look at the Irrlicht documentation, IAnimatedMeshSceneNode inherits from ISceneNode; thus, I don't think there is an error in the Irrlicht Design in regards to shadows. However, I'm not sure until you post some code detailing how you're using Christian's code.
void amhEventReceiver::generateCollision(ISceneNode* n, IMetaTriangleSelector* meta )
{
if (n->getType() == ESNT_OCT_TREE){
IAttributes* attribs = device->getFileSystem()->createEmptyAttributes();
if (attribs) {// get the mesh name out
n->serializeAttributes(attribs);
stringc name = attribs->getAttributeAsString("Mesh");
attribs->drop();
// get the animated mesh for the object
IAnimatedMesh* mesh = smgr->getMesh(name.c_str());
if (mesh){
ITriangleSelector* selector = smgr->createOctTreeTriangleSelector(mesh->getMesh(0), n, 128);
n->setTriangleSelector(selector);
metaSelector->addTriangleSelector(selector);
selector->drop();
// IAnimatedMeshSceneNode*iamsn = smgr->getSceneNodeFromId( n->getID());
n->addShadowVolumeSceneNode();
}
}
}
// now recurse on children...
list<ISceneNode*>::ConstIterator begin = n->getChildren().begin();
list<ISceneNode*>::ConstIterator end = n->getChildren().end();
for (; begin != end; ++begin)
generateCollision(*begin, meta);
}
and this is the error :
f:\abyss\abyss\abyss\amheventreceiver.cpp(180) : error C2039: 'addShadowVolumeSceneNode' : is not membre of 'irr::scene::ISceneNode'
ESNT_OCT_TREE or octTreeSceneNode is design for level usually a huge mesh. so i think its design not to have any shadow, we get shadows from lightmaping only. dynamic only for animated mesh because it's moving and off course the shadow change while it animates. no design error i think.
P/S:
for collision in game industry they using 2 mesh collision mesh and the one that rendered. since level mesh usually very complex with large amount of vertex. it's better to make second mesh with less vertices, get the triangle selector, apply to animators and hide it.
for collision in game industry they using 2 mesh collision mesh and the one that rendered. since level mesh usually very complex with large amount of vertex. it's better to make second mesh with less vertices, get the triangle selector, apply to animators and hide it.
I know. But my meshes are large with large polys and collide with small objects. So it require exact match between rendered and coliided shapes.
And it's not possible to add lightmap on octrees in irrEdit.
It seems that the solutions are to add two times the mesh (one for collision, one for rendering...) or to change irrlicht code.
Keys : ZQSD (or WASD on english keybord) to move, SPACE BARR and CONTROL to move up and down, A and E (or Q and E on english keybord) to roll and mouse movement to pitch and yaw.