Freezing water on collide
7 posts • Page 1 of 1
Freezing water on collide
Is it possible (and how) to freeze water on collide with a solid? Please don't give negative replies. I am new to algodoo scripting and I cannot find this on the forums.
- rowanphilip
- Posts: 3
- Joined: Thu Jun 16, 2011 7:55 pm
Re: Freezing water on collide
It's possible to liquify a solid on contact with anything, but I don't think the reverse is possible, since a blob of water isn't a single object. I'm not sure collisions with water even trigger onCollide (on the other geom), and water particles certainly don't have an onCollide event of their own. There is an algorithm in Algodoo for whether a water particle is "in contact" with another, which could be used to find contiguous bodies of water, but there's no way to freeze them.
- daniels220
- Posts: 95
- Joined: Mon Aug 31, 2009 11:30 pm
Re: Freezing water on collide
Ok, I know that you can freeze water manually, I was just wandering if it could be done when a certain target is met.
- rowanphilip
- Posts: 3
- Joined: Thu Jun 16, 2011 7:55 pm
Re: Freezing water on collide
I mean, technically you can do it, it would just be insanely complicated. You would have to spawn geoms (polygons, probably) in the shape of the contacting water droplets, and fix them to existing geoms, then delete the water droplet that contacted them. It certainly can be done, it would just be really difficult. If you manage to pull it off, I will be extremely impressed. 
-

TC42 - Posts: 984
- Joined: Sun Jan 09, 2011 1:53 pm
- Location: $ sudo apt get-install sandwich_
Re: Freezing water on collide
... or you could make polygon water, such as this, and make the density become +inf when it collides with something.
Code to freeze:
Code to unfreeze:
Obviously you can change the density back to any value you want, but 2.0 is the default value.
Code to freeze:
- Code: Select all
(e)=>{e.this.density := +inf}
Code to unfreeze:
- Code: Select all
(e)=>{e.this.density := 2.0}
Obviously you can change the density back to any value you want, but 2.0 is the default value.
-

Dare - Posts: 833
- Joined: Sat Nov 21, 2009 4:27 pm
- Location: Sydney, Australia
Re: Freezing water on collide
The problem is that it collides with itself and freezes when you don't want it to.
- rowanphilip
- Posts: 3
- Joined: Thu Jun 16, 2011 7:55 pm
Re: Freezing water on collide
Density of water is 0.1kg/m^2.
Make several circles with controllerAcc = "unique number" example 1995.
Give freezer's controllerAcc an = "unique number" example 1337.
OnCollide:
Try.
Make several circles with controllerAcc = "unique number" example 1995.
Give freezer's controllerAcc an = "unique number" example 1337.
OnCollide:
- Code: Select all
(e)=>{
e.other.controllerAcc != 1995 ? {
e.other.controllerAcc == 1337 ? {
e.this.density = +inf;
e.this.controllerAcc = 1337;
e.this.color = [0.8, 0.8, 1.0, 1.0]
} : {}
} : {}
}
Try.
-

Rideg - Posts: 948
- Joined: Tue Dec 15, 2009 5:17 pm
- Location: Östersund, Sweden
7 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 3 guests






