Update physics more than once per frame?

0

Hi, have a way to Update Physics more than once per one frame ? If i have some condition and if after update physics i need re update again physics, with different condition and after update run render frame. Any help will be nice :)

質問済み 6年前175ビュー
3回答
0
承認された回答

Hi @REDACTEDUSER

By default, there isn't a way to update physics more than once per frame, but if you are comfortable with C++ there are some things that you can work with:

  1. First, here's the standard documentation regarding physics and threads

https://docs.aws.amazon.com/lumberyard/latest/developerguide/physics-scripting-threads.html

  1. There is a flag: sys_physics_CPU that determines whether physics uses the main thread or not. Setting this = to 0 will force it to use the main thread

  2. If the sys_physics_CPU flag is not set to 0, then p_force_sync controls how the physics thread syncs with the physics thread. If p_force_sync is set to 1, the main thread will wait for physics. If 0, the main thread will move on without the physics thread. You may be able to make adjustments to this to achieve what you are looking for.

  3. If you really want to dive deep, take a look at CSystem::Update() and CPhysicsThreadTask::Run() to check out this interaction.

What is your intended use case for this update? If it is for simply an object check or a raycast, there are probably some simpler methods involving straightforward checks instead of running an entire physics step for the whole simulation, but it really depends on what you want to accomplish!

Let me know if this helps!

回答済み 6年前
profile picture
エキスパート
レビュー済み 3日前
profile picture
エキスパート
レビュー済み 2ヶ月前
0

Ah, interesting! Fetching some advice/assistance from the techs! Stay tuned :)

回答済み 6年前
0

Super, thanks you Chronos for answer. I trying synchronise my custom character over network. And i hope this way is help me to achieve the goal.

回答済み 6年前

この投稿はクローズされています。新しい回答、コメント、投票の追加はできません。

関連するコンテンツ