| Particle FLAGS and MASKS 粒子效果中的旗子与蒙板 |
| 作者:梦翔儿 日期:2007-6-24 21:25:00 |
Particle FLAGS and MASKS
粒子效果中的形状与透明度
----------------------------- Quick and dirty explanation of the terms FLAGS and MASKS: Ever see one of those mailboxes with a metal 'flag' painted red on the side,
hinged so that it could be up or down. Up to tell the postman that there's mail waiting to be picked up... or down to tell the owner that the postman has already picked up the outgoing mail. 常见在邮箱中,一侧喷成红色,取决与它能上下。上则告诉邮递员,有邮件需要取出,反之已取出。
FLAGS in programming are the same kinda thing, they're binary. ON or OFF, and mean different things. 旗标记都是同样的,是个开关,只有开与关,有不同的含义。
Often, if there are several useful 'flags' that can be ON or OFF, they are joined together in a special way, for computer speed and to save memory. 经常地,有很多用处,能够开关,他们在一些特效场合下,联合在一起使用,像电脑速度与保存内存一样。
MASKS exist so that you, the programmer, can turn on and off flags easily. Why call it a 'mask' ? Because, in a sense, it covers up all the other flags. 蒙板,存在,作为一个程序员,可以很容易地开关,为什么叫~呢?因为在一个场景中,他将遮盖所以其它的旗子。
The simplest 'flag' for particles is PSYS_PART_EMISSIVE_MASK. If it were a newer feature it may have been called FULL_BRIGHT instead because that's exactly what it does for particles.... it makes them full bright. 高亮的问题。。。。
A particle definition has the format format: [ NAME1, value1, NAME2, value2, ..., .... ]
So, the 'flags parameter', named PSYS_PART_FLAGS, needs to have one value (an integer) that goes along with it. If that value is 0, it means "all flags are off." 格式的参数列表,应该有一个附属值,如果为o,则意味着关闭
You can turn on a flag by using one of the MASKS as the flag value, for example: PSYS_PART_FLAGS, ( PSYS_PART_EMISSIVE_MASK ),
which means "all flags are off EXCEPT the emissive flag." 应用的格式如上。
If you want to use more than one options you must combine the masks together, PSYS_PART_FLAGS, ( PSYS_PART_EMISSIVE_MASK | PSYS_PART_WIND_MASK ),
This line means: "all flags are off, except EMISSIVE and WIND".
如果两个如放射性与风性一起使用用|隔开。
You can use all 10 or so options at once if you like, the line gets kind of long though. PSYS_PART_FLAGS, ( PSYS_PART_EMISSIVE_MASK Notice the | acts like a comma, it only goes BETWEEN masks, not at the beginning or
the end of the mask list. 多个向上边那样做,|只用在中间,不在结尾使用。
And, the ( )'s aren't required... but I like to use them just so that I don't accidentally mix
masks and parameters together. () 不是必须的,但是最好使用,否则可能会混。 |
