Blender渲染
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
936 B

  1. <?php
  2. namespace Blobt\Luxcore\scene\materials;
  3. use Blobt\Luxcore\core\Base;
  4. use Blobt\Luxcore\scene\Scene;
  5. class Mirror extends MaterialsBase
  6. {
  7. const TYPE_MIRROR = 'mirror';
  8. /**
  9. * @var string 反射颜色,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名
  10. */
  11. public $kr = "0.7 0.7 0.7";
  12. public function __construct($config = [])
  13. {
  14. $this->type = self::TYPE_MIRROR;
  15. $this->id = Scene::createID();
  16. Base::__construct($config);
  17. }
  18. public function setRefraction($color)
  19. {
  20. if( is_object($color) )
  21. {
  22. if( $color->registerId != null ) $this->kr = $color->registerId;
  23. else
  24. {
  25. throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property");
  26. }
  27. }
  28. else $this->kr = $color;
  29. }
  30. }
  31. ?>