? 江苏极品身材白嫩少妇自拍,欧美3p在线观看一区二区三区
聯(lián)系我們

給我們留言

聯(lián)系我們

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

郵箱:info@narkii.com

電話:0595-82682267

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

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

UE4 SetPhysicsLinearVelocity、AddForce區(qū)別

來源: 52vr | 責(zé)任編輯:傳說的落葉 | 發(fā)布時間: 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:
一般動畫藍(lán)圖中使用Velocity來判定當(dāng)前對象的移動速度從而來判定是否播放跑步動畫。AddForce并不會修改Velocity值,所以如果要移動的同時來設(shè)置Velocity,需要手動設(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)友評論

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

關(guān)閉

全部評論:0條

推薦
熱門