CC3LightTracker Class Reference

CC3LightTracker is a specialized CC3TargettingNode that tracks a target and automatically updates its own globalLightLocation property from the globalLocation property of the target. More...

#import <CC3TargettingNode.h>

Inheritance diagram for CC3LightTracker:
Inheritance graph
[legend]
Collaboration diagram for CC3LightTracker:
Collaboration graph
[legend]

List of all members.


Detailed Description

CC3LightTracker is a specialized CC3TargettingNode that tracks a target and automatically updates its own globalLightLocation property from the globalLocation property of the target.

This globalLightLocaiton property is propagated to all child nodes. Unlike CC3TargettingNode, CC3LightTracker does not rotate itself or its child nodes to face the target.

The primary use of CC3LightTracker is to automatically update the globalLightLocation property of mesh nodes that contain bump-map textures, by tracking a light source as its target. Bump-mapping combines a light direction with the per-pixel normal vectors found in the texture to derive per-pixel luminosity.

Although the globalLightLocation property is used only by CC3MeshNodes that contain bump-map normal textures, the property is supported by all CC3Nodes. The automatic updating of the property by this node will be propagated automatically to all child nodes. Because of this, if you have a number of bump-mapped mesh nodes, you can add them all as descendants of a single CC3LightTracker node, and confgure the CC3LightTracker to track a light source. The CC3LightTracker will take care of updating the globalLightLocation of all the mesh nodes.

Although typically the target of each CC3LightTracker will be a light source, it is not required that the target be a CC3Light instance. Any CC3Node can be used as the target. This is because bump-mapping does not actually use real light sources to create its effect. Bump-mapping combines only the light direction vector and the texture normals to create luminosity. However, in most 3D worlds, you will want the same lighting effects to be visible on meshes that are covered with regular materials and textures, and meshes that are covered with bump-map textures. To accomplish this, you would set the target of the CC3LightTracker to be the CC3Light instance that is illuminating the regular mesh nodes.


The documentation for this class was generated from the following file: