From 7943870ed4fee7b458baa65c3864d7b6fa01a810 Mon Sep 17 00:00:00 2001 From: yuanjiajia <1139393632@qq.com> Date: Tue, 8 Mar 2022 23:55:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BA=86=E4=B8=A4=E4=B8=AA?= =?UTF-8?q?=E6=9D=90=E8=B4=A8=E7=B1=BB=E6=96=87=E4=BB=B6=EF=BC=8C=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E3=80=81=E6=9D=90=E8=B4=A8=E3=80=81=E4=BD=93=E7=A7=AF?= =?UTF-8?q?=E3=80=81=E8=B4=B4=E5=9B=BEcards=E5=B1=9E=E6=80=A7=E5=B7=B2?= =?UTF-8?q?=E7=BB=8F=E6=94=B9=E4=B8=BAregisterId=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/launch.json | 2 +- examples/PrintRender.php | 61 +++++++++++ examples/{print.php => PrintScene.php} | 79 +-------------- src/scene/Scene.php | 12 +-- src/scene/materials/CarPaint.php | 24 ++--- src/scene/materials/Cloth.php | 118 ++++++++++++++++++++++ src/scene/materials/Disney.php | 34 +++---- src/scene/materials/Glass.php | 12 +-- src/scene/materials/GlassArch.php | 10 +- src/scene/materials/GlassRough.php | 14 +-- src/scene/materials/Glossy.php | 14 +-- src/scene/materials/GlossyCoating.php | 14 +-- src/scene/materials/GlossyTranslucent.php | 28 ++--- src/scene/materials/MaterialsBase.php | 14 +-- src/scene/materials/Matte.php | 2 +- src/scene/materials/MatteRough.php | 4 +- src/scene/materials/MatteTranslucent.php | 4 +- src/scene/materials/Metal.php | 6 +- src/scene/materials/Mirror.php | 2 +- src/scene/materials/Mix.php | 6 +- src/scene/materials/Velvet.php | 111 ++++++++++++++++++++ src/scene/objects/Objects.php | 4 +- src/scene/texture/TextureBase.php | 2 +- src/scene/volumes/HeteroGeneous.php | 4 +- src/scene/volumes/HomoGeneous.php | 4 +- src/scene/volumes/VolumesBase.php | 8 +- 26 files changed, 405 insertions(+), 188 deletions(-) create mode 100644 examples/PrintRender.php rename examples/{print.php => PrintScene.php} (60%) create mode 100644 src/scene/materials/Cloth.php create mode 100644 src/scene/materials/Velvet.php diff --git a/.vscode/launch.json b/.vscode/launch.json index 1ed85e3..d88edc1 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -11,7 +11,7 @@ "name": "Launch currently open script", "type": "php", "request": "launch", - "program": "${workspaceFolder}/examples/print.php", + "program": "${workspaceFolder}/examples/PrintScene.php", "cwd": "${workspaceFolder}", "port": 9055 } diff --git a/examples/PrintRender.php b/examples/PrintRender.php new file mode 100644 index 0000000..fcda354 --- /dev/null +++ b/examples/PrintRender.php @@ -0,0 +1,61 @@ +effect = [new render\effect\Pretreatment(),new render\effect\ToneMapLinear(),new render\effect\CammaCorrection()]; +$film->addImage($img); + +$film->addImage(new render\Image(['type' => 'ALBEDO'])); +$film->addImage(new render\Image(['type' => 'AVG_SHADING_NORMAL'])); + +$img = new render\Image(); +$img->effect = [new render\effect\NoiseReducerOIDN(),new render\effect\Pretreatment(),new render\effect\ToneMapLinear(),new render\effect\CammaCorrection()]; +$film->addImage($img); + + +echo $film; + +?> diff --git a/examples/print.php b/examples/PrintScene.php similarity index 60% rename from examples/print.php rename to examples/PrintScene.php index 9725ccd..6ba4ef8 100644 --- a/examples/print.php +++ b/examples/PrintScene.php @@ -7,77 +7,7 @@ namespace Blobt\Luxcore\scene; include dirname(dirname(__FILE__)) . "/vendor/autoload.php"; - - -echo '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>渲染配置参数>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>'; -echo "\n\n\n\n"; - -/* -//设置打印 渲染引擎 的配置参数 -$renderEngine = new render\RenderEngine(); -echo $renderEngine; - -//设置打印GPU渲染设备的配置参数 -$openCL = new render\OpenCL(); -echo $openCL; - -//设置打印光线跟踪的配置参数 -$path = new render\Path(); -echo $path; - -//设置打印 采样器 配置参数 -$sampler = new render\Sampler(); -echo $sampler; - -//设置打印 灯光策略 配置参数 -$lightStrategy = new render\LightStrategy(); -echo $lightStrategy; - -//设置打印 文件储存格式 配置参数 -$filesaver = new render\FileSaver(); -echo $filesaver; - -//设置打印 渲染终止 配置参数 -$batch = new render\Batch(); -echo $batch; - -//设置打印 场景属性 配置参数 -$scene = new render\Scene(); -echo $scene; - - - -//设置打印 “胶片” 配置参数 -$film = new render\Film();//添加一个胶片, - -$img = new render\Image(); -$img->effect = [new render\effect\Pretreatment(),new render\effect\ToneMapLinear(),new render\effect\CammaCorrection()]; -$film->addImage($img); - -$film->addImage(new render\Image(['type' => 'ALBEDO'])); -$film->addImage(new render\Image(['type' => 'AVG_SHADING_NORMAL'])); - -$img = new render\Image(); -$img->effect = [new render\effect\NoiseReducerOIDN(),new render\effect\Pretreatment(),new render\effect\ToneMapLinear(),new render\effect\CammaCorrection()]; -$film->addImage($img); - - -echo $film; - -*/ - - - - - -echo "\n\n\n\n"; -echo '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>场景配置参数>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>'; -echo "\n\n\n\n"; - -$scene = new Scene();//创建一个场景, - - -/* +$scene = new Scene(); //添加第一个模型 $obj = new objects\Objects( [ 'ply' => 'mesh-10086.ply','appliedtransformation' => '1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1' ] ); //创建一个的模型 @@ -115,21 +45,19 @@ $scene->registerMaterial($mix); //将这个对象注册到 Scene $obj->setMaterial($mix) ; //为模型的指定一个混合材质 $scene->registerObjects($obj); //将模型添加到场景中 -*/ - //添加第二个模型 $obj = new objects\Objects( [ 'ply' => 'mesh-119.ply','appliedtransformation' => '1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1' ] ); //创建一个的模型, $scene->registerObjects($obj); //将模型添加到场景中 - +//添加第三个模型 $obj = new objects\Objects( [ 'ply' => 'mesh-119.ply','appliedtransformation' => '1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1' ] ); //创建一个的模型, $scene->registerObjects($obj); //将模型添加到场景中 - +//添加第四个模型 $obj = new objects\Objects( [ 'ply' => 'mesh-119.ply','appliedtransformation' => '1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1' ] ); //创建一个的模型, $ClearVol = new volumes\Clear(); //创建一个 Clear体积效果 @@ -142,7 +70,6 @@ $scene->registerMaterial($colorGlass); //将玻璃材质注册到 Scene $obj->setMaterial($colorGlass); //将玻璃材质赋值到模型的材质属性 $scene->registerObjects($obj); //将模型添加到场景中 - echo $scene; diff --git a/src/scene/Scene.php b/src/scene/Scene.php index cc9315f..515e9e9 100644 --- a/src/scene/Scene.php +++ b/src/scene/Scene.php @@ -49,7 +49,7 @@ class Scene extends BaseCfg { $temp = null; $temp = sprintf("%014d",$obj->id); - $obj->cards = $temp; + $obj->registerId = $temp; if($obj->material == null) { if( !array_key_exists('__default',$this->materials ) ) @@ -65,7 +65,7 @@ class Scene extends BaseCfg { $temp = null; $temp = $material->type.'_'.sprintf("%014d",$material->id); - $material->cards = $temp; + $material->registerId = $temp; $this->materials[$temp] = $material; } @@ -74,7 +74,7 @@ class Scene extends BaseCfg { $temp = null; $temp = $texture->type.'_'.sprintf("%014d",$texture->id); - $texture->cards = $temp; + $texture->registerId = $temp; $this->textures[$temp] = $texture; } @@ -82,7 +82,7 @@ class Scene extends BaseCfg { $temp = null; $temp = $volume->type.'_'.sprintf("%014d",$volume->id); - $volume->cards = $temp; + $volume->registerId = $temp; $this->volumes[$temp] = $volume; } @@ -90,7 +90,7 @@ class Scene extends BaseCfg { $temp = null; $temp = $light->type.'_'.sprintf("%014d",$light->id); - $light->cards = $temp; + $light->registerId = $temp; $this->lights[$temp] = $light; } @@ -98,7 +98,7 @@ class Scene extends BaseCfg { $temp = null; $temp = $camera->type.'_'.sprintf("%014d",$camera->id); - $camera->cards = $temp; + $camera->registerId = $temp; $this->cameras[$temp] = $camera; } diff --git a/src/scene/materials/CarPaint.php b/src/scene/materials/CarPaint.php index fc91c56..a8f66ad 100644 --- a/src/scene/materials/CarPaint.php +++ b/src/scene/materials/CarPaint.php @@ -83,7 +83,7 @@ class CarPaint extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->kd = $color->cards; + if( $color->registerId != null ) $this->kd = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -96,7 +96,7 @@ class CarPaint extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->ks1 = $color->cards; + if( $color->registerId != null ) $this->ks1 = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -109,7 +109,7 @@ class CarPaint extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->ks2 = $color->cards; + if( $color->registerId != null ) $this->ks2 = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -122,7 +122,7 @@ class CarPaint extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->ks3 = $color->cards; + if( $color->registerId != null ) $this->ks3 = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -135,7 +135,7 @@ class CarPaint extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->m1 = $color->cards; + if( $color->registerId != null ) $this->m1 = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -148,7 +148,7 @@ class CarPaint extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->m2 = $color->cards; + if( $color->registerId != null ) $this->m2 = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -161,7 +161,7 @@ class CarPaint extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->m3 = $color->cards; + if( $color->registerId != null ) $this->m3 = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -174,7 +174,7 @@ class CarPaint extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->r1 = $color->cards; + if( $color->registerId != null ) $this->r1 = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -187,7 +187,7 @@ class CarPaint extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->r2 = $color->cards; + if( $color->registerId != null ) $this->r2 = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -200,7 +200,7 @@ class CarPaint extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->r3 = $color->cards; + if( $color->registerId != null ) $this->r3 = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -213,7 +213,7 @@ class CarPaint extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->ka = $color->cards; + if( $color->registerId != null ) $this->ka = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -226,7 +226,7 @@ class CarPaint extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->d = $color->cards; + if( $color->registerId != null ) $this->d = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); diff --git a/src/scene/materials/Cloth.php b/src/scene/materials/Cloth.php new file mode 100644 index 0000000..be2113d --- /dev/null +++ b/src/scene/materials/Cloth.php @@ -0,0 +1,118 @@ +type = self::TYPE_CLOTH; + $this->id = Scene::createID(); + Base::__construct($config); + } + + public function setWarpBaseColor($color) + { + if( is_object($color) ) + { + if( $color->registerId != null ) $this->warp_kd = $color->registerId; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->warp_kd = $color; + } + + public function setWeftBaseColor($color) + { + if( is_object($color) ) + { + if( $color->registerId != null ) $this->weft_kd = $color->registerId; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->weft_kd = $color; + } + + public function setWarpSpecular($color) + { + if( is_object($color) ) + { + if( $color->registerId != null ) $this->warp_ks = $color->registerId; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->warp_ks = $color; + } + + public function setWeftSpecular($color) + { + if( is_object($color) ) + { + if( $color->registerId != null ) $this->weft_ks = $color->registerId; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->weft_ks = $color; + } + +} + +?> diff --git a/src/scene/materials/Disney.php b/src/scene/materials/Disney.php index 8e12ffc..ea3893a 100644 --- a/src/scene/materials/Disney.php +++ b/src/scene/materials/Disney.php @@ -91,7 +91,7 @@ class Disney extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->basecolor = $color->cards; + if( $color->registerId != null ) $this->basecolor = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -104,7 +104,7 @@ class Disney extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->subsurface = $color->cards; + if( $color->registerId != null ) $this->subsurface = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -117,7 +117,7 @@ class Disney extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->metallic = $color->cards; + if( $color->registerId != null ) $this->metallic = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -130,7 +130,7 @@ class Disney extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->specular = $color->cards; + if( $color->registerId != null ) $this->specular = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -143,7 +143,7 @@ class Disney extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->speculartint = $color->cards; + if( $color->registerId != null ) $this->speculartint = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -156,7 +156,7 @@ class Disney extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->roughness = $color->cards; + if( $color->registerId != null ) $this->roughness = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -169,7 +169,7 @@ class Disney extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->anisotropic = $color->cards; + if( $color->registerId != null ) $this->anisotropic = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -182,7 +182,7 @@ class Disney extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->sheen = $color->cards; + if( $color->registerId != null ) $this->sheen = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -195,7 +195,7 @@ class Disney extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->sheentint = $color->cards; + if( $color->registerId != null ) $this->sheentint = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -208,7 +208,7 @@ class Disney extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->clearcoat = $color->cards; + if( $color->registerId != null ) $this->clearcoat = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -221,7 +221,7 @@ class Disney extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->clearcoatgloss = $color->cards; + if( $color->registerId != null ) $this->clearcoatgloss = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -234,7 +234,7 @@ class Disney extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->transparencyFront = $color->cards; + if( $color->registerId != null ) $this->transparencyFront = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -247,7 +247,7 @@ class Disney extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->transparencyBack = $color->cards; + if( $color->registerId != null ) $this->transparencyBack = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -260,7 +260,7 @@ class Disney extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->filmamount = $color->cards; + if( $color->registerId != null ) $this->filmamount = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -272,7 +272,7 @@ class Disney extends MaterialsBase public function setFilmthickness($color) { if( is_object($color) ) { - if( $color->cards != null ) $this->filmthickness = $color->cards; + if( $color->registerId != null ) $this->filmthickness = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -285,7 +285,7 @@ class Disney extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->filmior = $color->cards; + if( $color->registerId != null ) $this->filmior = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -298,7 +298,7 @@ class Disney extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->bumptex = $color->cards; + if( $color->registerId != null ) $this->bumptex = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); diff --git a/src/scene/materials/Glass.php b/src/scene/materials/Glass.php index b0ade85..6e15e86 100644 --- a/src/scene/materials/Glass.php +++ b/src/scene/materials/Glass.php @@ -55,7 +55,7 @@ class Glass extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->filmthickness = $color->cards; + if( $color->registerId != null ) $this->filmthickness = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -68,7 +68,7 @@ class Glass extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->filmior = $color->cards; + if( $color->registerId != null ) $this->filmior = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -81,7 +81,7 @@ class Glass extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->kt = $color->cards; + if( $color->registerId != null ) $this->kt = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -94,7 +94,7 @@ class Glass extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->kr = $color->cards; + if( $color->registerId != null ) $this->kr = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -107,7 +107,7 @@ class Glass extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->interiorior = $color->cards; + if( $color->registerId != null ) $this->interiorior = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -120,7 +120,7 @@ class Glass extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->cauchyb = $color->cards; + if( $color->registerId != null ) $this->cauchyb = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); diff --git a/src/scene/materials/GlassArch.php b/src/scene/materials/GlassArch.php index 7880d6f..70195e9 100644 --- a/src/scene/materials/GlassArch.php +++ b/src/scene/materials/GlassArch.php @@ -52,7 +52,7 @@ class GlassArch extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->filmthickness = $color->cards; + if( $color->registerId != null ) $this->filmthickness = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -65,7 +65,7 @@ class GlassArch extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->filmior = $color->cards; + if( $color->registerId != null ) $this->filmior = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -78,7 +78,7 @@ class GlassArch extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->kt = $color->cards; + if( $color->registerId != null ) $this->kt = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -91,7 +91,7 @@ class GlassArch extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->kr = $color->cards; + if( $color->registerId != null ) $this->kr = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -104,7 +104,7 @@ class GlassArch extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->interiorior = $color->cards; + if( $color->registerId != null ) $this->interiorior = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); diff --git a/src/scene/materials/GlassRough.php b/src/scene/materials/GlassRough.php index e3439ee..6ae3f11 100644 --- a/src/scene/materials/GlassRough.php +++ b/src/scene/materials/GlassRough.php @@ -60,7 +60,7 @@ class GlassRough extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->uroughness = $color->cards; + if( $color->registerId != null ) $this->uroughness = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -73,7 +73,7 @@ class GlassRough extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->vroughness = $color->cards; + if( $color->registerId != null ) $this->vroughness = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -86,7 +86,7 @@ class GlassRough extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->filmthickness = $color->cards; + if( $color->registerId != null ) $this->filmthickness = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -99,7 +99,7 @@ class GlassRough extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->filmior = $color->cards; + if( $color->registerId != null ) $this->filmior = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -112,7 +112,7 @@ class GlassRough extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->kt = $color->cards; + if( $color->registerId != null ) $this->kt = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -125,7 +125,7 @@ class GlassRough extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->kr = $color->cards; + if( $color->registerId != null ) $this->kr = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -138,7 +138,7 @@ class GlassRough extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->interiorior = $color->cards; + if( $color->registerId != null ) $this->interiorior = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); diff --git a/src/scene/materials/Glossy.php b/src/scene/materials/Glossy.php index 9589b90..a1612d3 100644 --- a/src/scene/materials/Glossy.php +++ b/src/scene/materials/Glossy.php @@ -61,7 +61,7 @@ class Glossy extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->uroughness = $color->cards; + if( $color->registerId != null ) $this->uroughness = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -74,7 +74,7 @@ class Glossy extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->vroughness = $color->cards; + if( $color->registerId != null ) $this->vroughness = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -87,7 +87,7 @@ class Glossy extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->kd = $color->cards; + if( $color->registerId != null ) $this->kd = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -100,7 +100,7 @@ class Glossy extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->ks = $color->cards; + if( $color->registerId != null ) $this->ks = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -113,7 +113,7 @@ class Glossy extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->ka = $color->cards; + if( $color->registerId != null ) $this->ka = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -126,7 +126,7 @@ class Glossy extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->d = $color->cards; + if( $color->registerId != null ) $this->d = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -139,7 +139,7 @@ class Glossy extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->index = $color->cards; + if( $color->registerId != null ) $this->index = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); diff --git a/src/scene/materials/GlossyCoating.php b/src/scene/materials/GlossyCoating.php index b26c246..fd77acd 100644 --- a/src/scene/materials/GlossyCoating.php +++ b/src/scene/materials/GlossyCoating.php @@ -64,7 +64,7 @@ class GlossyCoating extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->uroughness = $color->cards; + if( $color->registerId != null ) $this->uroughness = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -77,7 +77,7 @@ class GlossyCoating extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->vroughness = $color->cards; + if( $color->registerId != null ) $this->vroughness = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -90,7 +90,7 @@ class GlossyCoating extends MaterialsBase { if( is_object($material) ) { - if( $material->cards != null ) $this->base = $material->cards; + if( $material->registerId != null ) $this->base = $material->registerId; else { throw new \Exception("You use an unregistered ".$material->getInstanceClassName()." object for the current property"); @@ -103,7 +103,7 @@ class GlossyCoating extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->ks = $color->cards; + if( $color->registerId != null ) $this->ks = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -116,7 +116,7 @@ class GlossyCoating extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->ka = $color->cards; + if( $color->registerId != null ) $this->ka = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -129,7 +129,7 @@ class GlossyCoating extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->d = $color->cards; + if( $color->registerId != null ) $this->d = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -142,7 +142,7 @@ class GlossyCoating extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->index = $color->cards; + if( $color->registerId != null ) $this->index = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); diff --git a/src/scene/materials/GlossyTranslucent.php b/src/scene/materials/GlossyTranslucent.php index 446b9fd..480f28a 100644 --- a/src/scene/materials/GlossyTranslucent.php +++ b/src/scene/materials/GlossyTranslucent.php @@ -106,7 +106,7 @@ class Glossy extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->uroughness = $color->cards; + if( $color->registerId != null ) $this->uroughness = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -119,7 +119,7 @@ class Glossy extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->vroughness = $color->cards; + if( $color->registerId != null ) $this->vroughness = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -132,7 +132,7 @@ class Glossy extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->kd = $color->cards; + if( $color->registerId != null ) $this->kd = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -145,7 +145,7 @@ class Glossy extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->ks = $color->cards; + if( $color->registerId != null ) $this->ks = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -158,7 +158,7 @@ class Glossy extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->kt = $color->cards; + if( $color->registerId != null ) $this->kt = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -171,7 +171,7 @@ class Glossy extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->ka = $color->cards; + if( $color->registerId != null ) $this->ka = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -184,7 +184,7 @@ class Glossy extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->d = $color->cards; + if( $color->registerId != null ) $this->d = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -197,7 +197,7 @@ class Glossy extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->index = $color->cards; + if( $color->registerId != null ) $this->index = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -224,7 +224,7 @@ class Glossy extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->uroughness_bf = $color->cards; + if( $color->registerId != null ) $this->uroughness_bf = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -237,7 +237,7 @@ class Glossy extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->vroughness_bf = $color->cards; + if( $color->registerId != null ) $this->vroughness_bf = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -250,7 +250,7 @@ class Glossy extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->ks_bf = $color->cards; + if( $color->registerId != null ) $this->ks_bf = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -263,7 +263,7 @@ class Glossy extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->ka_bf = $color->cards; + if( $color->registerId != null ) $this->ka_bf = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -276,7 +276,7 @@ class Glossy extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->d_bf = $color->cards; + if( $color->registerId != null ) $this->d_bf = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -289,7 +289,7 @@ class Glossy extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->index_bf = $color->cards; + if( $color->registerId != null ) $this->index_bf = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); diff --git a/src/scene/materials/MaterialsBase.php b/src/scene/materials/MaterialsBase.php index c2fcabe..07ac3f5 100644 --- a/src/scene/materials/MaterialsBase.php +++ b/src/scene/materials/MaterialsBase.php @@ -74,7 +74,7 @@ class MaterialsBase extends BaseCfg /** * @var string TODO:储存个由Scene类颁发的注册信息,后期会屏敝此参数的输出 */ - public $cards; + public $registerId; /** * @var float TODO:采样距离,具体作用尚未明确,(固定取值:0.001) @@ -109,7 +109,7 @@ class MaterialsBase extends BaseCfg { if( is_object($color) ) { - if( $color->cards != null ) $this->transparencyFront = $color->cards; + if( $color->registerId != null ) $this->transparencyFront = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -122,7 +122,7 @@ class MaterialsBase extends BaseCfg { if( is_object($color) ) { - if( $color->cards != null ) $this->transparencyBack = $color->cards; + if( $color->registerId != null ) $this->transparencyBack = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -135,7 +135,7 @@ class MaterialsBase extends BaseCfg { if( is_object($color) ) { - if( $color->cards != null ) $this->bumptex = $color->cards; + if( $color->registerId != null ) $this->bumptex = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -148,7 +148,7 @@ class MaterialsBase extends BaseCfg { if( is_object($color) ) { - if( $color->cards != null ) $this->emission = $color->cards; + if( $color->registerId != null ) $this->emission = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -166,7 +166,7 @@ class MaterialsBase extends BaseCfg { if( is_object( $volumeInterior ) ) { - if( $volumeInterior->cards != null ) $this->volumeInterior = $volumeInterior->cards; + if( $volumeInterior->registerId != null ) $this->volumeInterior = $volumeInterior->registerId; else { throw new \Exception("You use an unregistered ".$volumeInterior->getInstanceClassName()." object for the current property"); @@ -179,7 +179,7 @@ class MaterialsBase extends BaseCfg { if( is_object( $volumeExterior ) ) { - if( $volumeExterior->cards != null ) $this->volumeExterior = $volumeExterior->cards; + if( $volumeExterior->registerId != null ) $this->volumeExterior = $volumeExterior->registerId; else { throw new \Exception("You use an unregistered ".$volumeExterior->getInstanceClassName()." object for the current property"); diff --git a/src/scene/materials/Matte.php b/src/scene/materials/Matte.php index b3d3891..e905adc 100644 --- a/src/scene/materials/Matte.php +++ b/src/scene/materials/Matte.php @@ -25,7 +25,7 @@ class Matte extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->kd = $color->cards; + if( $color->registerId != null ) $this->kd = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); diff --git a/src/scene/materials/MatteRough.php b/src/scene/materials/MatteRough.php index 1d688ca..e8eb8a9 100644 --- a/src/scene/materials/MatteRough.php +++ b/src/scene/materials/MatteRough.php @@ -30,7 +30,7 @@ class MatteRough extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->kd = $color->cards; + if( $color->registerId != null ) $this->kd = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -43,7 +43,7 @@ class MatteRough extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->sigma = $color->cards; + if( $color->registerId != null ) $this->sigma = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); diff --git a/src/scene/materials/MatteTranslucent.php b/src/scene/materials/MatteTranslucent.php index 04e5588..32c1f50 100644 --- a/src/scene/materials/MatteTranslucent.php +++ b/src/scene/materials/MatteTranslucent.php @@ -30,7 +30,7 @@ class Roughmatte extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->kr = $color->cards; + if( $color->registerId != null ) $this->kr = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -43,7 +43,7 @@ class Roughmatte extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->kt = $color->cards; + if( $color->registerId != null ) $this->kt = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); diff --git a/src/scene/materials/Metal.php b/src/scene/materials/Metal.php index c91e1a2..35091e4 100644 --- a/src/scene/materials/Metal.php +++ b/src/scene/materials/Metal.php @@ -36,7 +36,7 @@ class Metal extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->fresnel = $color->cards; + if( $color->registerId != null ) $this->fresnel = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -50,7 +50,7 @@ class Metal extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->uroughness = $color->cards; + if( $color->registerId != null ) $this->uroughness = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -63,7 +63,7 @@ class Metal extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->vroughness = $color->cards; + if( $color->registerId != null ) $this->vroughness = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); diff --git a/src/scene/materials/Mirror.php b/src/scene/materials/Mirror.php index 7e393fa..f3d8617 100644 --- a/src/scene/materials/Mirror.php +++ b/src/scene/materials/Mirror.php @@ -25,7 +25,7 @@ class Mirror extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->kr = $color->cards; + if( $color->registerId != null ) $this->kr = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); diff --git a/src/scene/materials/Mix.php b/src/scene/materials/Mix.php index 6eef546..5dbb2f6 100644 --- a/src/scene/materials/Mix.php +++ b/src/scene/materials/Mix.php @@ -34,7 +34,7 @@ class Mix extends MaterialsBase { if( is_object( $Material ) ) { - if( $Material->cards != null ) $this->material1 = $Material->cards; + if( $Material->registerId != null ) $this->material1 = $Material->registerId; else { throw new \Exception("You use an unregistered ".$Material->getInstanceClassName()." object for the current property"); @@ -47,7 +47,7 @@ class Mix extends MaterialsBase { if( is_object( $Material ) ) { - if( $Material->cards != null ) $this->material2 = $Material->cards; + if( $Material->registerId != null ) $this->material2 = $Material->registerId; else { throw new \Exception("You use an unregistered ".$Material->getInstanceClassName()." object for the current property"); @@ -60,7 +60,7 @@ class Mix extends MaterialsBase { if( is_object($color) ) { - if( $color->cards != null ) $this->amount = $color->cards; + if( $color->registerId != null ) $this->amount = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); diff --git a/src/scene/materials/Velvet.php b/src/scene/materials/Velvet.php new file mode 100644 index 0000000..308fa68 --- /dev/null +++ b/src/scene/materials/Velvet.php @@ -0,0 +1,111 @@ +type = self::TYPE_VELVET; + $this->id = Scene::createID(); + Base::__construct($config); + } + + public function setBaseColor($color) + { + if( is_object($color) ) + { + if( $color->registerId != null ) $this->kd = $color->registerId; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->kd = $color; + } + + public function setP1($color) + { + if( is_object($color) ) + { + if( $color->registerId != null ) $this->p1 = $color->registerId; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->p1 = $color; + } + + public function setP2($color) + { + if( is_object($color) ) + { + if( $color->registerId != null ) $this->p2 = $color->registerId; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->p2 = $color; + } + + public function setP3($color) + { + if( is_object($color) ) + { + if( $color->registerId != null ) $this->p3 = $color->registerId; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->p3 = $color; + } + + public function setThickness($color) + { + if( is_object($color) ) + { + if( $color->registerId != null ) $this->thickness = $color->registerId; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->thickness = $color; + } + +} + +?> diff --git a/src/scene/objects/Objects.php b/src/scene/objects/Objects.php index b3a79db..a6c1cec 100644 --- a/src/scene/objects/Objects.php +++ b/src/scene/objects/Objects.php @@ -31,7 +31,7 @@ class Objects extends BaseCfg /** * @var string TODO:储存个由Scene类颁发的注册信息,后期会屏敝此参数的输出 */ - public $cards; + public $registerId; /** * @var string 一个山16个数据组成模型的变换参数,包抱位置坐标,旋转参数,缩放参数 @@ -48,7 +48,7 @@ class Objects extends BaseCfg { if( is_object( $material ) ) { - if( $material->cards != null ) $this->material = $material->cards; + if( $material->registerId != null ) $this->material = $material->registerId; else { throw new \Exception("You use an unregistered ".$material->getInstanceClassName()." object for the current property"); diff --git a/src/scene/texture/TextureBase.php b/src/scene/texture/TextureBase.php index 7de2fb0..b97934b 100644 --- a/src/scene/texture/TextureBase.php +++ b/src/scene/texture/TextureBase.php @@ -20,7 +20,7 @@ class TextureBase extends BaseCfg /** * @var string TODO:储存个由Scene类颁发的注册信息,后期会屏敝此参数的输出 */ - public $cards; + public $registerId; } diff --git a/src/scene/volumes/HeteroGeneous.php b/src/scene/volumes/HeteroGeneous.php index af6f07b..b8964b7 100644 --- a/src/scene/volumes/HeteroGeneous.php +++ b/src/scene/volumes/HeteroGeneous.php @@ -45,7 +45,7 @@ class HomoGeneous extends VolumesBase { if( is_object($color) ) { - if( $color->cards != null ) $this->asymmetry = $color->cards; + if( $color->registerId != null ) $this->asymmetry = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -58,7 +58,7 @@ class HomoGeneous extends VolumesBase { if( is_object($color) ) { - if( $color->cards != null ) $this->scattering = $color->cards; + if( $color->registerId != null ) $this->scattering = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); diff --git a/src/scene/volumes/HomoGeneous.php b/src/scene/volumes/HomoGeneous.php index 4c8369e..538cb77 100644 --- a/src/scene/volumes/HomoGeneous.php +++ b/src/scene/volumes/HomoGeneous.php @@ -35,7 +35,7 @@ class HomoGeneous extends VolumesBase { if( is_object($color) ) { - if( $color->cards != null ) $this->asymmetry = $color->cards; + if( $color->registerId != null ) $this->asymmetry = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -48,7 +48,7 @@ class HomoGeneous extends VolumesBase { if( is_object($color) ) { - if( $color->cards != null ) $this->scattering = $color->cards; + if( $color->registerId != null ) $this->scattering = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); diff --git a/src/scene/volumes/VolumesBase.php b/src/scene/volumes/VolumesBase.php index 194f031..f790162 100644 --- a/src/scene/volumes/VolumesBase.php +++ b/src/scene/volumes/VolumesBase.php @@ -39,7 +39,7 @@ class VolumesBase extends BaseCfg /** * @var string TODO:储存个由Scene类颁发的注册信息,后期会屏敝此参数的输出 */ - public $cards; + public $registerId; /** * @var bool 设置当前材质是否保存和使用全局光缓存,当需要打开时,需要渲染器开启全局光缓存功能(取值:ture 或 false) @@ -60,7 +60,7 @@ class VolumesBase extends BaseCfg { if( is_object($color) ) { - if( $color->cards != null ) $this->emission = $color->cards; + if( $color->registerId != null ) $this->emission = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -74,7 +74,7 @@ class VolumesBase extends BaseCfg { if( is_object($color) ) { - if( $color->cards != null ) $this->absorption = $color->cards; + if( $color->registerId != null ) $this->absorption = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); @@ -87,7 +87,7 @@ class VolumesBase extends BaseCfg { if( is_object($color) ) { - if( $color->cards != null ) $this->ior = $color->cards; + if( $color->registerId != null ) $this->ior = $color->registerId; else { throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property");