/src/away3d/core/partition/LightNode.as

http://github.com/away3d/away3d-core-fp11 · ActionScript · 42 lines · 25 code · 4 blank · 13 comment · 1 complexity · fcf4246a46352581cd6f3b44655de859 MD5 · raw file

  1. package away3d.core.partition
  2. {
  3. import away3d.core.traverse.PartitionTraverser;
  4. import away3d.lights.LightBase;
  5. /**
  6. * LightNode is a space partitioning leaf node that contains a LightBase object. Used for lights that are not of default supported type.
  7. */
  8. public class LightNode extends EntityNode
  9. {
  10. private var _light:LightBase;
  11. /**
  12. * Creates a new LightNode object.
  13. * @param light The light to be contained in the node.
  14. */
  15. public function LightNode(light:LightBase)
  16. {
  17. super(light);
  18. _light = light;
  19. }
  20. /**
  21. * The light object contained in this node.
  22. */
  23. public function get light():LightBase
  24. {
  25. return _light;
  26. }
  27. /**
  28. * @inheritDoc
  29. */
  30. override public function acceptTraverser(traverser:PartitionTraverser):void
  31. {
  32. if (traverser.enterNode(this)) {
  33. super.acceptTraverser(traverser);
  34. traverser.applyUnknownLight(_light);
  35. }
  36. }
  37. }
  38. }