Skip to content

Commit fc4e70c

Browse files
author
Thayer J Andrews
committed
CCEffectReflection - API documentation
1 parent f823f87 commit fc4e70c

File tree

1 file changed

+86
-0
lines changed

1 file changed

+86
-0
lines changed

cocos2d/CCEffectReflection.h

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,102 @@
1010

1111
@interface CCEffectReflection : CCEffect
1212

13+
/// -----------------------------------------------------------------------
14+
/// @name Accessing Effect Attributes
15+
/// -----------------------------------------------------------------------
16+
17+
/** The environment that will be refracted by the affected node. Typically this is a sprite
18+
* that is not visible in the scene as it is conceptually "behind the viewer" and only visible
19+
* where reflected by the affected node.
20+
*/
1321
@property (nonatomic) CCSprite *environment;
22+
23+
/** The normal map that encodes the normal vectors of the affected node. Each pixel in the normal
24+
* map is a 3 component vector that is perpendicular to the surface of the sprite at that point.
25+
*/
1426
@property (nonatomic) CCSpriteFrame *normalMap;
27+
28+
/** The bias term in the fresnel reflectance equation:
29+
* reflectance = max(0.0, fresnelBias + (1 - fresnelBias) * pow((1 - nDotV), fresnelPower))
30+
* This value is in the range [0..1] and it controls the constant (view angle independent) contribution
31+
* to the reflectance equation.
32+
*/
1533
@property (nonatomic) float fresnelBias;
34+
35+
/** The power term in the fresnel reflectance equation:
36+
* reflectance = max(0.0, fresnelBias + (1 - fresnelBias) * pow((1 - nDotV), fresnelPower))
37+
* This value is in the range [0..inf] and it controls the view angle dependent contribution
38+
* to the reflectance equation.
39+
*/
1640
@property (nonatomic) float fresnelPower;
1741

42+
43+
/// -----------------------------------------------------------------------
44+
/// @name Initializing a CCEffectReflection object
45+
/// -----------------------------------------------------------------------
46+
47+
/**
48+
* Initializes a CCEffectReflection object with the following default parameters:
49+
* fresnelBias : 1.0
50+
* fresnelPower : 0.0
51+
* environment : nil
52+
* normalMap : nil
53+
*
54+
* @return The CCEffectReflection object.
55+
*/
1856
-(id)init;
57+
58+
/**
59+
* Initializes a CCEffectReflection object with the specified environment and normal map and the following default parameters:
60+
* fresnelBias : 1.0
61+
* fresnelPower : 0.0
62+
*
63+
* @param environment The environment image that will be reflected by the affected node.
64+
* @param normalMap The normal map of the affected node. This can also be specified as a property of the affected sprite.
65+
*
66+
* @return The CCEffectReflection object.
67+
*/
1968
-(id)initWithEnvironment:(CCSprite *)environment normalMap:(CCSpriteFrame *)normalMap;
69+
70+
/**
71+
* Initializes a CCEffectReflection object with the specified parameters.
72+
*
73+
* @param bias The bias term in the fresnel reflectance equation.
74+
* @param power The power term in the fresnel reflectance equation.
75+
* @param environment The environment image that will be reflected by the affected node.
76+
* @param normalMap The normal map of the affected node. This can also be specified as a property of the affected sprite.
77+
*
78+
* @return The CCEffectReflection object.
79+
*/
2080
-(id)initWithFresnelBias:(float)bias fresnelPower:(float)power environment:(CCSprite *)environment normalMap:(CCSpriteFrame *)normalMap;
2181

82+
83+
/// -----------------------------------------------------------------------
84+
/// @name Creating a CCEffectReflection object
85+
/// -----------------------------------------------------------------------
86+
87+
/**
88+
* Creates a CCEffectReflection object with the specified environment and normal map and the following default parameters:
89+
* fresnelBias : 1.0
90+
* fresnelPower : 0.0
91+
*
92+
* @param environment The environment image that will be reflected by the affected node.
93+
* @param normalMap The normal map of the affected node. This can also be specified as a property of the affected sprite.
94+
*
95+
* @return The CCEffectReflection object.
96+
*/
2297
+(id)effectWithEnvironment:(CCSprite *)environment normalMap:(CCSpriteFrame *)normalMap;
98+
99+
/**
100+
* Creates a CCEffectReflection object with the specified parameters.
101+
*
102+
* @param bias The bias term in the fresnel reflectance equation.
103+
* @param power The power term in the fresnel reflectance equation.
104+
* @param environment The environment image that will be reflected by the affected node.
105+
* @param normalMap The normal map of the affected node. This can also be specified as a property of the affected sprite.
106+
*
107+
* @return The CCEffectReflection object.
108+
*/
23109
+(id)effectWithFresnelBias:(float)bias fresnelPower:(float)power environment:(CCSprite *)environment normalMap:(CCSpriteFrame *)normalMap;
24110

25111
@end

0 commit comments

Comments
 (0)