? ,,

新锐科创官网-专业室内外高精度人员定位系统厂家及服务商

聯系我們

給我們留言

聯系我們

地址:福建省晉江市青陽街道洪山路國際工業設計園納金網

郵箱:info@narkii.com

電話:0595-82682267

(周一到周五, 周六周日休息)

當前位置:主頁 > 3D教程 > 圖文教程

UE4 SetPhysicsLinearVelocity、AddForce區別

來源: 52vr | 責任編輯:傳說的落葉 | 發布時間: 2019-06-06 08:19 | 瀏覽量:

[UE4]SetPhysicsLinearVelocity、AddForce區別

 

SetPhysicsAngularVelocity:用于旋轉物體。但官方文檔建議謹慎使用此接口,建議用 AddTorque或者AddImpulse

 

AddForce用法:

 
  1. mesh->AddForce(FVector::RightVector * mesh->GetBodyInstance()->GetBodyMass() * 1000);  

https://answers.unrealengine.com/questions/290824/addforceaddimpulse-wont-work.html

 

修改Velocity:
一般動畫藍圖中使用Velocity來判定當前對象的移動速度從而來判定是否播放跑步動畫。AddForce并不會修改Velocity值,所以如果要移動的同時來設置Velocity,需要手動設置:

 
  1. MyChar->GetCharacterMovement()->Velocity += FVector(0,0,20000);  

https://answers.unrealengine.com/questions/27069/addimpulse-or-addforce-on-character.html

 

 

注意,如果要使用SetPhysicsLinearVelocity(),需要將SetSimulatePhysics設置為true

 
  1. MyCharacter->GetMesh()->SetSimulatePhysics(true);  
  2. MyCharacter->GetMesh()->SetPhysicsLinearVelocity(FVector(100.f, 100.f, 100.f));  

 https://answers.unrealengine.com/questions/140978/how-to-set-a-initial-velocity.html

 

 

UPrimitiveComponent::AddForce
https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/Components/UPrimitiveComponent/AddForce/index.html

 

UPrimitiveComponent::AddImpulse

https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/Components/UPrimitiveComponent/AddImpulse/index.html

 

UPrimitiveComponent::SetPhysicsLinearVelocity

https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/Components/UPrimitiveComponent/SetPhysicsLinearVelocity/index.html

 

UPrimitiveComponent::SetPhysicsAngularVelocity
https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/Components/UPrimitiveComponent/SetPhysicsAngularVelocity/index.html


相關文章
網友評論

您需要登錄后才可以發帖 登錄 | 立即注冊

關閉

全部評論:0條

推薦
熱門
主站蜘蛛池模板: 日本黄色大片免费观看 | 伊人青草 | 欧美成人黑人视频免费观看 | 国产精品亚洲一区二区无码 | 一边摸一边做爽的视频17国产 | 人妻丰满熟妇av无码区免 | 日韩中文字幕视频在线观看 | 国产亚洲福利一区二区免费看 | 黄色在线免费观看网站 | 开心五月激情综合婷婷色 | 欧美1314性欧美 | 自偷自偷自亚洲首页精品 | 久久国产精品自由自在 | 无码人妻精品一区二区三区久久久 | 和岳每晚弄的高潮嗷嗷叫视频 | 日本两人免费观看的视频 | 久久av高潮av无码av喷吹 | 亚洲成a∨人片在无码2023 | 人与禽交av在线播放 | 久久国产视频精品 | 国产高清精品自在线看 | 曰本一区二区三区 | 久久婷婷色香五月综合缴缴情 | 狠狠久久| 天天综合久久久网 | 全部aⅴ极品视觉盛宴精品 全部露出来毛走秀福利视频 | 免费无码又爽又刺激高潮视频 | 久久久久成人精品无码中文字幕 | 麻豆精品一区二区综合av | 又大又粗又爽的少妇免费视频 | 色综网| 天天躁狠狠躁狠狠躁夜夜躁 | 欧美激情亚洲精品日韩1区2区 | 一级一级一级一级毛片 | 国产欧美日韩精品综合 | 亚洲日韩精品欧美一区二区 | 国产欧美另类久久久精品免费 | 少妇高潮毛片免费看 | k频道国产在线观看 | 午夜精品一区二区三区在线观看 | 免费国产精成人品 |