Page 1 of 1

Readable

PostPosted: Sun Dec 25, 2016 2:20 pm
by Cathier
So what does readable() actually do? Like, what's the function executed when calling readable()? What is its purpose?

Re: Readable

PostPosted: Sun Dec 25, 2016 8:58 pm
by FRA32
As much as I know, readable() enables accessing the readonly variables of something. So if you use readable(this), you get a version of this that allows reading values like geom0, layer, surfaces etc. It could be that my knowledge about this is not 100% correct tho since I can only learn from experimenting with stuff, and this is the most logical explanation for me.

Re: Readable

PostPosted: Mon Dec 26, 2016 12:32 am
by Cathier
Well, actually it makes a lot of sense now that I think of it. Thanks. Gotta get rid of some global variables then.

Re: Readable

PostPosted: Mon Dec 26, 2016 9:41 am
by Kilinich
Cathier wrote:So what does readable() actually do? Like, what's the function executed when calling readable()? What is its purpose?

It was added in early algodoo version as the only way to read pos, vel, angle and etc. After that in recent version direct read-write access to most properties was added, but some (like linked geom, impulse, surfaces) are still available only via readable() object.
Actually you could see all "readable" variables and values in entity's script menu under bottom line.

Re: Readable

PostPosted: Wed Dec 28, 2016 8:09 pm
by Cathier
Kilinich wrote:
Cathier wrote:So what does readable() actually do? Like, what's the function executed when calling readable()? What is its purpose?

It was added in early algodoo version as the only way to read pos, vel, angle and etc. After that in recent version direct read-write access to most properties was added, but some (like linked geom, impulse, surfaces) are still available only via readable() object.
Actually you could see all "readable" variables and values in entity's script menu under bottom line.


Thanks! That opens a lot of possibilities for me now. I have a lot of uses for that.

Unfortunately, there doesn't seem to be an actual official documentation about algodoo's engine. It would help a lot of users including me.