Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug / Crash  Errors when ending playmode
#22
(21-02-2020, 12:15 PM)TheMunk Wrote: That's fine - right now its not breaking anything important so I can live with it for now.

I was thinking more about the earlier comment:

Do you have any recommendations for increasing performance/simulation other than simulation? 
More specifically; is there any way to disable the solver ones all actors have entered sleep mode? Since in my app only playerinput (or narratively scripted event) will re-awaken the rope.


My current solution is to have each rope in a single solver, and then manually disabling and enabling the solver - this way I save a ton of performance because I'm only simulating the ropes I need to, but they are all still being rendered. I can't seem to find a function for checking if the rope has reached it's sleep thresh-hold. This way I could make sure the rope is not moving when I disable the solver.

A sleep threshold is basically low kinetic energy. Kinetic energy of a body is defined as: 1/2 * mass * velocity^2. If that value is lower than a threshold for all particles, you know the rope isnt moving. Since you’re only interested in visual movement (not energy) you can drop the mass term:
1/2 * velocity^2.

The 1/2 is just a constant, that you can fold it over to the threshold value. Also the square.

So it all boils down to iterating over all particles in the rope and checking if their velocity is smaller than a threshold. If it is, you can disable the solver. If you find a single particle whose velocity is over the threshold, you must keep the solver enabled, so in most cases it’s an early out.
Reply


Messages In This Thread
Errors when ending playmode - by TheMunk - 27-01-2020, 01:35 PM
RE: Errors when ending playmode - by TheMunk - 28-01-2020, 11:10 AM
RE: Errors when ending playmode - by TheMunk - 28-01-2020, 12:14 PM
RE: Errors when ending playmode - by josemendez - 28-01-2020, 12:38 PM
RE: Errors when ending playmode - by TheMunk - 28-01-2020, 12:59 PM
RE: Errors when ending playmode - by josemendez - 28-01-2020, 04:24 PM
RE: Errors when ending playmode - by TheMunk - 28-01-2020, 04:45 PM
RE: Errors when ending playmode - by josemendez - 28-01-2020, 05:00 PM
RE: Errors when ending playmode - by TheMunk - 29-01-2020, 09:56 AM
RE: Errors when ending playmode - by josemendez - 29-01-2020, 10:05 AM
RE: Errors when ending playmode - by TheMunk - 13-02-2020, 10:30 AM
RE: Errors when ending playmode - by josemendez - 13-02-2020, 01:14 PM
RE: Errors when ending playmode - by TheMunk - 13-02-2020, 02:04 PM
RE: Errors when ending playmode - by TheMunk - 13-02-2020, 03:39 PM
RE: Errors when ending playmode - by TheMunk - 13-02-2020, 05:00 PM
RE: Errors when ending playmode - by TheMunk - 19-02-2020, 12:06 PM
RE: Errors when ending playmode - by josemendez - 19-02-2020, 12:15 PM
RE: Errors when ending playmode - by TheMunk - 21-02-2020, 10:26 AM
RE: Errors when ending playmode - by josemendez - 21-02-2020, 11:18 AM
RE: Errors when ending playmode - by TheMunk - 21-02-2020, 12:15 PM
RE: Errors when ending playmode - by josemendez - 21-02-2020, 01:36 PM
RE: Errors when ending playmode - by TheMunk - 21-02-2020, 02:11 PM
RE: Errors when ending playmode - by TheMunk - 25-02-2020, 12:22 PM
RE: Errors when ending playmode - by josemendez - 25-02-2020, 12:35 PM
RE: Errors when ending playmode - by TheMunk - 25-02-2020, 04:09 PM
RE: Errors when ending playmode - by josemendez - 25-02-2020, 04:35 PM
RE: Errors when ending playmode - by TheMunk - 26-02-2020, 09:31 AM
RE: Errors when ending playmode - by TheMunk - 02-03-2020, 10:24 AM
RE: Errors when ending playmode - by TheMunk - 02-03-2020, 04:16 PM
RE: Errors when ending playmode - by josemendez - 09-03-2020, 11:00 AM
RE: Errors when ending playmode - by TheMunk - 09-03-2020, 08:52 AM
RE: Errors when ending playmode - by josemendez - 09-03-2020, 11:01 AM
RE: Errors when ending playmode - by TheMunk - 28-02-2020, 02:37 PM
RE: Errors when ending playmode - by TheMunk - 14-02-2020, 02:44 PM