当前位置: 首页 > news >正文

UE学习记录part11

第14节 breakable actors

147 destructible meshes

 a geometry collection is basically a set of static meshes that we get after we fracture a mesh. 几何体集合基本上是我们在断开网格后获得的一组静态网格。 

选中要破碎的网格物品,创建集合

可以选择不同的碎裂方式,以及选中已经破碎的碎片再次进行fracture(破碎)

设置enable gravity,  simulation physics和damage threadhold后可以播放查看破碎效果

选中物体,按住end之后可以将物体至于地面



148 field system actor: use field to break destructible

创建一个field system蓝图类

enable cluster有使物品聚集起来的能力,可以取消勾选



149 creating field with weapons: using the weapon to break destructible

可以改为box,capsule在物体破碎之后碎片会旋转,而box这种清空会减轻

createfields的蓝图实现(不在c++中实现,只在c++中声明)

 



150 breakable actor: create an actors that breaks

创建一个c++的actor类

UGeometryCollection是在GeometryCollectionEngine模块下的,需要在build.cs中手动添加这个模块

以c++为基类生成蓝图类

 



151 blueprint native event: functions with c++ and blueprint functionality

Even though this class implements the interface, that function is not exposed to blueprint. 即使此类实现了接口,该函数也不会向 Blueprint 公开。

In fact, if we go into hit interface, we can see that it's right here. 事实上,如果我们进入点击界面,我们可以看到它就在这里。

It's not even a U function, it's just a C++ function. 它甚至不是一个 U 函数,而只是一个 C++ 函数。

Now, we could make it a blueprint implementable event, but that means it would only be implemented 现在,我们可以将其设为 Blueprint 可实施事件,但这意味着它只会被实现

in Blueprint and then we wouldn't be able to have our own C++ functionality triggered as a result of ,然后我们就无法触发我们自己的 C++ 功能,因为

this function being called. this 函数。

So how do we get the best of both worlds? 那么我们如何两全其美呢?

Well, to do that, we could make this function a blueprint. 好吧,要做到这一点,我们可以将这个函数作为一个蓝图。

Native event. Native 事件。

A blueprint. 蓝图。

 这是c++实现的GetHit函数,使用了BlueprintNativeEvent之后,则纯c++实现名改为GetHit_Implementation



152 breaking sounds : playing sound whem we smash a pot

pot之所以会被武器震碎,是因为weapon类上附带了createfield函数增加了一个field立场,而pot是一个BP_Breakable蓝图类实例,其中它的rest collection是一个geometrycollection类,而这个类可以设置特性遇到field力场或其他力后破碎。

 在这里会出现一种情况,武器攻击了其中一个potA,另一个potB被potAde field给连带震碎了,但是只有potA被销毁了,因为是potA与weapon overlap然后被调用了gethit函数销毁。而potB只是被武器上的field震碎(或者被potA的碎片所连带的力所震碎),但weapon并没有与potB发生overlap事件,也就不会调用potB的gethit函数销毁potB,因此需要用函数来检测pot是否完整,不完成就调用销毁函数

相关文章:

  • DHT11数字温湿度传感器驱动开发全解析(中) | 零基础入门STM32第八十七步
  • 回调后门基础
  • Day18 -实例:app信息收集工具(Appinfoscanner、Mobsf)的配置和使用
  • 从PDF到精准答案:Coze助力RAGFlow框架提升数据召回率
  • Java基本类型深度解析:从内存模型到高效编程实践
  • 【MinerU】可本地部署的PDF解析器
  • HCIP-6 DHCP
  • 软考 中级软件设计师 考点知识点笔记总结 day08 算法设计与分析
  • 设计模式 Day 1:单例模式(Singleton Pattern)详解
  • 《Operating System Concepts》阅读笔记:p495-p511
  • argparse的使用
  • 【前端】【React】第四章:深入理解 React Router 及前端路由管理
  • 使用 mpstat 与 stress-ng 进行 CPU 性能监控
  • 从0到1的数据结构教程——深入思考动态数组
  • 记录一下最近参与实习 外包 社招流程里的一些感悟
  • Java EE(18)——网络原理——应用层HTTP协议
  • 内网渗透-网络分离免杀
  • git --- cherry pick
  • 深入解析C++模板:从基础到高级应用
  • AI Agent开发大全第十五课-零售智能导购Agent的代码实现
  • 廊坊网站建设制作电话/网络营销案例范文
  • 永顺网站建设/百度推广最近怎么了
  • 网站搜索功能怎样做/神马推广
  • 织梦做网站教程/seo排名优化
  • asp网站乱码/优化推荐
  • 求手机网站/全网营销策划公司