weixin_40014641 2018-09-29 08:59 采纳率: 0%
浏览 418

怎么创建高低不平的地面和车辆模型,在irrlicht游戏引擎中运行

在我下载的源程序中,使用以下代码创建场景,是一个平面。
scene::IMeshSceneNode* planeNode = smgr->addCubeSceneNode(
1000.0f, // size heigth
0, // parent
-1, // id
core::vector3df(0,-500,0), // position cooridinary
core::vector3df(0,0,0), // rotation
core::vector3df(1.0f, 1.0f, 1.0f) // scale
);
planeNode->getMaterial(0).setTexture(0, driver->getTexture("data/meshes/rock.jpg"));
physicsParams.Mass = 0.0f;
m_bulletPhysicsSystem->addBox(
planeNode,
core::vector3df(1000,500,1000), //中间参数确认高度
&physicsParams,
false,

true
);
planeNode->setMaterialFlag(video::EMF_LIGHTING, false); // no lighting
车辆模型制作如下,这时车辆与地面已经物理联系起来:
scene::IAnimatedMeshSceneNode* carNode = loadMeshFromFile("data/Vehicles/Subaru/imprezaZX.3ds");
carNode->setPosition(core::vector3df(0, 0, 1));
m_car = new physics::PhysicsCar(
m_bulletPhysicsSystem,
carNode,
loadMeshFromFile("data/Vehicles/Subaru/swheel_left.3ds"),
loadMeshFromFile("data/Vehicles/Subaru/swheel.3ds"),
loadMeshFromFile("data/Vehicles/Subaru/swheel_left.3ds"),
loadMeshFromFile("data/Vehicles/Subaru/swheel.3ds")
);
我想做成凹凸不平的地面,使车辆在上面进行运行,需要如何进行修改!请路过大神指导,不胜感激!

  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥15 C++ 头文件/宏冲突问题解决
    • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
    • ¥50 安卓adb backup备份子用户应用数据失败
    • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
    • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
    • ¥30 python代码,帮调试
    • ¥15 #MATLAB仿真#车辆换道路径规划
    • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
    • ¥15 数据可视化Python
    • ¥15 要给毕业设计添加扫码登录的功能!!有偿