diff --git a/src/scene/materials/GlossyTranslucent.php b/src/scene/materials/GlossyTranslucent.php new file mode 100644 index 0000000..a7e2944 --- /dev/null +++ b/src/scene/materials/GlossyTranslucent.php @@ -0,0 +1,367 @@ +type = self::TYPE_GLOSSY; + $this->id = Scene::createID(); + Base::__construct($config); + } + + public function setUroughness($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->uroughness = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->uroughness = $color; + } + + public function setVroughness($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->vroughness = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->vroughness = $color; + } + + public function setTransparencyFront($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->transparencyFront = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->transparencyFront = $color; + } + + public function setTransparencyBack($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->transparencyBack = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->transparencyBack = $color; + } + + public function setBumptex($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->bumptex = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->bumptex = $color; + } + + public function setBaseColor($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->kd = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->kd = $color; + } + + public function setSpecular($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->ks = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->ks = $color; + } + + public function setTransmission($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->kt = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->kt = $color; + } + + public function setAbsorption($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->ka = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->ka = $color; + } + + public function setAbsorptionDepht($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->d = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->d = $color; + } + + public function setIor($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->index = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->index = $color; + } + + public function openMultiBounce() + { + $this->multibounce = true; + } + + public function closeMultiBounce() + { + $this->multibounce = false; + } + + + + + + public function setUroughness_BF($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->uroughness_bf = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->uroughness_bf = $color; + } + + public function setVroughness_BF($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->vroughness_bf = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->vroughness_bf = $color; + } + + public function setSpecular_BF($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->ks_bf = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->ks_bf = $color; + } + + public function setAbsorption_BF($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->ka_bf = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->ka_bf = $color; + } + + public function setAbsorptionDepht_BF($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->d_bf = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->d_bf = $color; + } + + public function setIor_BF($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->index_bf = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->index_bf = $color; + } + + public function openMultiBounce_BF() + { + $this->multibounce_bf = true; + } + + public function closeMultiBounce_BF() + { + $this->multibounce_bf = false; + } + +} + +?> diff --git a/src/scene/materials/MatteTranslucent.php b/src/scene/materials/MatteTranslucent.php new file mode 100644 index 0000000..a512153 --- /dev/null +++ b/src/scene/materials/MatteTranslucent.php @@ -0,0 +1,111 @@ +type = self::TYPE_MATTETRANSLUCENT; + $this->id = Scene::createID(); + Base::__construct($config); + } + + public function setTransparencyFront($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->transparencyFront = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->transparencyFront = $color; + } + + public function setTransparencyBack($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->transparencyBack = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->transparencyBack = $color; + } + + public function setBumptex($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->bumptex = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->bumptex = $color; + } + + public function setRefraction($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->kr = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->kr = $color; + } + + public function setTransmission($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->kt = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->kt = $color; + } + +} + +?> diff --git a/src/scene/materials/Mirror.php b/src/scene/materials/Mirror.php new file mode 100644 index 0000000..34129e9 --- /dev/null +++ b/src/scene/materials/Mirror.php @@ -0,0 +1,93 @@ +type = self::TYPE_MIRROR; + $this->id = Scene::createID(); + Base::__construct($config); + } + + public function setTransparencyFront($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->transparencyFront = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->transparencyFront = $color; + } + + public function setTransparencyBack($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->transparencyBack = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->transparencyBack = $color; + } + + public function setBumptex($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->bumptex = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->bumptex = $color; + } + + public function setRefraction($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->kr = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->kr = $color; + } + +} + +?>