|
|
Testing for Stuck Physics Objects
#36630
11/22/04 01:45
11/22/04 01:45
|
Joined: Mar 2003
Posts: 4,427 Japan
A.Russell
OP
Expert
|
OP
Expert
Joined: Mar 2003
Posts: 4,427
Japan
|
I need to write a routine that checks for when spinners (hinges) freeze and to reset them. How can I know when they have frozen? The spinners can come to rest naturally, so simply checking their angular velocity won't do.
Balls tend to get stuck in level geometry. I have already writtten an algorithm that checks their velocity and nudges/removes them if they stay in one place too long. However, this works very well when a balls comes to rest on top of an object (if it doesn't sink into it first), but when they are imbedded in a block they don't pop. Even though I can see they are not moving, they remain on the screen for a long time. How can I check for balls that are stuck inside blocks?
Also, I tried changing values for ph_setcorrections. This is supposed to check when a physics object is in an unacceptable position and correct it. No matter how I change the values, it doesn't improve anything.
Last edited by A.Russell; 11/22/04 01:50.
|
|
|
Re: Testing for Stuck Physics Objects
[Re: Error014]
#36632
11/22/04 01:51
11/22/04 01:51
|
Joined: Mar 2003
Posts: 4,427 Japan
A.Russell
OP
Expert
|
OP
Expert
Joined: Mar 2003
Posts: 4,427
Japan
|
|
|
|
Re: Testing for Stuck Physics Objects
[Re: A.Russell]
#36633
11/22/04 01:53
11/22/04 01:53
|
Joined: Mar 2003
Posts: 4,427 Japan
A.Russell
OP
Expert
|
OP
Expert
Joined: Mar 2003
Posts: 4,427
Japan
|
|
|
|
Re: Testing for Stuck Physics Objects
[Re: Error014]
#36635
11/22/04 03:54
11/22/04 03:54
|
Joined: Mar 2003
Posts: 5,377 USofA
fastlane69
Senior Expert
|
Senior Expert
Joined: Mar 2003
Posts: 5,377
USofA
|
I suggest also looking into event_stuck, though I'm not sure what it's status is with the new c_move instructions. This might address your stuck ball problem.
RE: the spinners, maybe, just maybe, the solutions for stuck balls will also work for stuck (ie frozen) spinners. That is, make the spinners sensible to event_stuck and if it gets triggered when your spinner freezes, you can give it a nudge, destroy and recreate, whatever.
Otherwise, short of sampling the velocity of the spinners every frame or two and checking when it goes from a large velocity to a dead stop, I can't think of another way to check for frozen spinners off the top of my head.
|
|
|
|