Problem with airFrictionMult = NaN
8 posts • Page 1 of 1
Problem with airFrictionMult = NaN
The following script spawns circles that should disappear after some collisions through "e.this.airFrictionMult = NaN". This does seem to work fine, but at the same time every loose or hinged object, regardless if it is in the same collisiongroup or not, does disapoear too. Is there any way to avoid this?
- Code: Select all
(e)=>{
scene.addCircle({
color := [0.2, 0.2, 0.2, 0.0];
size := 0.5;
density := 0.005;
pos := e.pos;
collideSet := 1;
controllerAcc := 0.05;
OnCollide := (E)=>{{controlleracc > 0.01} ? {controlleracc = controlleracc - 0.01} : {e.this.airFrictionMult = NaN}}})}
- art-e-fact
- Posts: 2
- Joined: Tue Sep 01, 2009 12:11 pm
Re: Problem with airFrictionMult = NaN
AFAIK this is a known bug. Instead of using airFrictionMult try using density = 0.
-
standardtoaster - Posts: 606
- Joined: Mon Aug 31, 2009 7:57 pm
Re: Problem with airFrictionMult = NaN
That works great, thanks alot.
- art-e-fact
- Posts: 2
- Joined: Tue Sep 01, 2009 12:11 pm
Re: Problem with airFrictionMult = NaN
Your welcome. Although, I don't know why airFrictionMult set to NaN delets everything that isn't attached to the background.
-
standardtoaster - Posts: 606
- Joined: Mon Aug 31, 2009 7:57 pm
Re: Problem with airFrictionMult = NaN
well if im correct this makes the air kinda go crazy because phun reads NAN as 0 and it is a irregular number, as so it doesent know what to do and causes it to displace evreything intiul it gets to the "black border of death"
HYDRO THYMER!
- link145632
- Posts: 26
- Joined: Thu Sep 24, 2009 12:24 am
- Location: Catching waves on the internet
Re: Problem with airFrictionMult = NaN
nope. you can avoid it by having it to have its collision group removed before setting airfrictionmult to NaN...
but remember air needs to be on for it to work.
but remember air needs to be on for it to work.
Jrv wrote:TC42 wrote:Quite honestly, I didn't think anyone on 4chan has that good a use of grammar, spelling, usage, mechanics, ect.
But I've never been there, so I may be wrong.
GTFO newfgt
-
RA2lover - Posts: 607
- Joined: Mon Aug 31, 2009 8:43 pm
- Location: Brazil
Re: Problem with airFrictionMult = NaN
link145632 wrote:well if im correct this makes the air kinda go crazy because phun reads NAN as 0 and it is a irregular number, as so it doesent know what to do and causes it to displace evreything intiul it gets to the "black border of death"
NaN isn't read as 0 in Phun or Algodoo. NaN is a defined value. It's the short form for "not a number". For example you get NaN if you divide integer values with 0 for example 3/0 = NaN.
If airfrictionmult is 0 the geometry is just not affected by air friction.
-
KarateBrot - Posts: 825
- Joined: Mon Aug 31, 2009 7:32 pm
- Location: Germany
Re: Problem with airFrictionMult = NaN
but is still affected by air buoyancy
Jrv wrote:TC42 wrote:Quite honestly, I didn't think anyone on 4chan has that good a use of grammar, spelling, usage, mechanics, ect.
But I've never been there, so I may be wrong.
GTFO newfgt
-
RA2lover - Posts: 607
- Joined: Mon Aug 31, 2009 8:43 pm
- Location: Brazil
8 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 2 guests