jorosy
Thank you wolfwood for putting up that information.
Actually, I did came over that post before I asked.
I am not familar with api or c++ stuff, thus when I saw that number behind state, I thought it was memory address ??
Think I am wrong, if thaken out the ox code from number, it seems represents the pstate number.
They are just numbers. Pstate is handled with a bitmask.
http://en.wikipedia.org/wiki/Mask_(computing) [
en.wikipedia.org]
The decimal representation of pstate hides all the neat stuff going on. If we look at it in binary we'll see a different story.
DYING
0x0002 (hex)
2 (decimal)
00000010 (binary)
STOPPED
0x0004 (hex)
4 (decimal)
00000100 (binary)
COLLIDE
0x0008 (hex)
8 (decimal)
00001000 (binary)
STUCK
0x0010 (hex)
16 (decimal)
00010000 (binary)
So if you want to have particle that has a shared state, say it just collided and is now marked for reaping (dying) you could have a dual state.
00000010 (dying)
OR 00001000 (collide)
= 00001010 (dying and colliding)
(or in decimal 10)
Why is the handy? Cause you can use logical operators to quicky get info.
Using the example above, I want to know if my particle is colliding, then you can do.
00001010 (your particle)
AND 00001000 (colliding state mask)
= 00001000 (non zero, thus TRUE)
So yes, your particle is colliding.
Another example, lets test if the same particle is stuck.
00001010 (your particle)
AND 00010000 (stuck state mask)
= 00000000 (zero, thus FALSE)
In this case, your particle is not stuck.
Looking at the numbers this way makes using VOPs to check for various particles significantly easier and faster.