Hi everyone,
Does anyone know how or have a function to get height point for animated mesh?
I want to supply the x, z and the near Y coordinate to the mesh. Then find out the nearest height (normal) point on the mesh polygon. This way I can have my character walk into cave autonomously.
I don't want to use the collision manager, because there is some performance reduction using it. If I use the collision manager in multiple thread app. it will cause exception. It would be nice to have a clone function for collision manager? This way I can do parallel collision detection.
At the moment I'm using recast detour, after it returned a 2D path, I used detour geometry function to get the nearest height. But there are some bugs in detour library, which makes the height returned wrongly at some corner edges causing my characters to fall down. I get around this problem by using the interpolated current position Y with the next position Y to determine the next point. Everything works, but I want to make sure irrlicht has better way of doing it.
Thanks
thanh
getHeight for animatedmesh or polygon mesh
Re: getHeight for animatedmesh or polygon mesh
I used the transformed bounding box for finding the y-offset to prevent the character from walking below the ground, e.g.
Regards,
smso
Code: Select all
f32 getAnimatedMeshSceneNodeYOffset(scene::IAnimatedMeshSceneNode* node)
{
f32 scale = 1.0f;
scene::ISceneNode* parent = node->getParent();
if (parent)
scale = parent->getScale().Y;
return node->getTransformedBoundingBox().getExtent().Y * 0.5f * scale;
}
smso
Re: getHeight for animatedmesh or polygon mesh
Thanks smso,
Unfortunately my mesh is not flat. It has holes, slope and things like that. For example it's a castle or a tunnel.
That's why I want to ask for polygon level of intersection.
E.g. Project a line straight in the Y downward direction from the character center height.
If there is no such function I will find time to write it.
Thanks
Thanh
Unfortunately my mesh is not flat. It has holes, slope and things like that. For example it's a castle or a tunnel.
That's why I want to ask for polygon level of intersection.
E.g. Project a line straight in the Y downward direction from the character center height.
If there is no such function I will find time to write it.
Thanks
Thanh
Re: getHeight for animatedmesh or polygon mesh
This is what physics systems like Bullet are for. Irr doesn't have a way other than the slow collision manager.