virtual IAnimatedMeshSceneNode* irr::scene::ISceneManager::addAnimatedMeshSceneNode (
IAnimatedMesh* mesh,
ISceneNode* parent = 0,
s32 id = -1,
const core::vector3df& position = (0, 0, 0),
const core::vector3df& rotation = (0 ,0 , 0),
const core::vector3df& scale = (1.0f, 1.0f, 1.0f),
bool alsoAddIfMeshPointerZero = false)
[pure virsual]
Adds a scene node for rendering an animated mesh model.
Parameters:
|
| mesh,: | Pointer to the loaded animated mesh to be displayed. |
|
| parent,: | Parent of the scene node. Can be NULL if no parent. |
|
| id,: | Id of the node. This id can be used to identify the scene node. |
|
| position,: | Position of the space relative to its parent where the scene node will be placed. |
|
| rotation,: | Initital rotation of the scene node. |
|
| scale,: | Initial scale of the scene node. |
|
| alsoAddIfMeshPointerZero,: | Add the scene node even if a 0 pointer is passed |
Returns:
Pointer to the created scene node. This pointer should not be dropped. See IReferenceCounted::drop() for more information.
使用技巧: 以摄像机(camera)为父节点(parent), 其position坐标为相对父节点(parent)位置坐标, 可以用该函数(function)把模型(mesh)绑定在摄像机(camera)上, 当摄像机(camera),比如说一个FPS(first person shoot)摄像机移动的时候, 绑定在摄像机(camera)上的模型(mesh)也随之移动, 可以简单的构造一个类似CS的第一人称视角.
IRRLICHT提供的2种比较特别但是很广泛使用的摄像机模拟视角和操作分别是FPS,和MAYA的典型操作.使用非常简单.
本文介绍如何使用irr::scene::ISceneManager的addAnimatedMeshSceneNode方法来创建动画网格场景节点。通过设置不同的参数,如网格、父节点、位置等,可以实现模型在三维空间中的精确放置。
736

被折叠的 条评论
为什么被折叠?



