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 :)

asked 6 years ago163 views
3 Answers
0
Accepted Answer

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!

answered 6 years ago
profile picture
EXPERT
reviewed a month ago
0

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

answered 6 years ago
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.

answered 6 years ago

This post is closed: Adding new answers, comments, and votes is disabled.