Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

shadowedBitMask vs. shadowCastBitMask

I do not understand the difference between shadowedBitMask and shadowCastBitMask in SKSpriteNode of spritekit in objective-c for ios development.

in the documentation it says:

shadowedBitMask is defined as "To determine whether this sprite is affected by being a shadow generated by a light, its shadowCastBitMask property is tested against the light’s categoryBitMask property by performing a logical AND operation. If the comparison results in a non-zero value, then the sprite is drawn using a shadowed effect."

The default value is 0x00000000 (all bits cleared).

shadowCastBitMask = "To determine whether this sprite blocks the light (casting a shadow) the sprite’s shadowedBitMask property is tested against the light’s categoryBitMask property by performing a logical AND operation. If the comparison results in a non-zero value, then the sprite casts a shadow past itself."

could someone please rephrase or give me an example because I dont understand what shadowedBitMask does??

like image 480
the pickle Avatar asked Aug 06 '14 13:08

the pickle


1 Answers

shadowCastBitMask will set if the light creates a shadow with that object.

shadowedBitMask will set if the object receives a shadow from the objects that cast one.

Let's not forget that the light must be higher in the zPosition to cast a shadow on another item.

like image 199
Tokuriku Avatar answered Nov 10 '22 19:11

Tokuriku