? 亚洲欧美色19p,无码丰满熟妇浪潮一区二区Av
聯(lián)系我們

給我們留言

聯(lián)系我們

地址:福建省晉江市青陽街道洪山路國(guó)際工業(yè)設(shè)計(jì)園納金網(wǎng)

郵箱:info@narkii.com

電話:0595-82682267

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

當(dāng)前位置:主頁 > 3D教程 > 圖文教程

UE4 SetPhysicsLinearVelocity、AddForce區(qū)別

來源: 52vr | 責(zé)任編輯:傳說的落葉 | 發(fā)布時(shí)間: 2019-06-06 08:19 | 瀏覽量:

[UE4]SetPhysicsLinearVelocity、AddForce區(qū)別

 

SetPhysicsAngularVelocity:用于旋轉(zhuǎn)物體。但官方文檔建議謹(jǐn)慎使用此接口,建議用 AddTorque或者AddImpulse

 

AddForce用法:

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

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

 

修改Velocity:
一般動(dòng)畫藍(lán)圖中使用Velocity來判定當(dāng)前對(duì)象的移動(dòng)速度從而來判定是否播放跑步動(dòng)畫。AddForce并不會(huì)修改Velocity值,所以如果要移動(dòng)的同時(shí)來設(shè)置Velocity,需要手動(dòng)設(shè)置:

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

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

 

 

注意,如果要使用SetPhysicsLinearVelocity(),需要將SetSimulatePhysics設(shè)置為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


相關(guān)文章
網(wǎng)友評(píng)論

您需要登錄后才可以發(fā)帖 登錄 | 立即注冊(cè)

關(guān)閉

全部評(píng)論:0條

推薦
熱門