diff --git a/src/scene/materials/CarPaint.php b/src/scene/materials/CarPaint.php new file mode 100644 index 0000000..fc91c56 --- /dev/null +++ b/src/scene/materials/CarPaint.php @@ -0,0 +1,240 @@ +type = self::TYPE_CARPAINT; + $this->id = Scene::createID(); + Base::__construct($config); + } + + 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 setSpecular1($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->ks1 = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->ks1 = $color; + } + + public function setSpecular2($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->ks2 = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->ks2 = $color; + } + + public function setSpecular3($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->ks3 = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->ks3 = $color; + } + + public function setMicrofacetRoughness1($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->m1 = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->m1 = $color; + } + + public function setMicrofacetRoughness2($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->m2 = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->m2 = $color; + } + + public function setMicrofacetRoughness3($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->m3 = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->m3 = $color; + } + + public function setGlossy1($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->r1 = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->r1 = $color; + } + + public function setGlossy2($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->r2 = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->r2 = $color; + } + + public function setGlossy3($color) + { + if( is_object($color) ) + { + if( $color->cards != null ) $this->r3 = $color->cards; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->r3 = $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; + } + +} + +?> diff --git a/src/scene/materials/GlossyCoating.php b/src/scene/materials/GlossyCoating.php new file mode 100644 index 0000000..b26c246 --- /dev/null +++ b/src/scene/materials/GlossyCoating.php @@ -0,0 +1,166 @@ +type = self::TYPE_GLOSSYCOATING; + $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 setBase($material) + { + if( is_object($material) ) + { + if( $material->cards != null ) $this->base = $material->cards; + else + { + throw new \Exception("You use an unregistered ".$material->getInstanceClassName()." object for the current property"); + } + } + else $this->base = $material; + } + + 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 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 = self::OPEN; + } + + public function closeMultiBounce() + { + $this->multibounce = self::CLOSE; + } + +} + +?>