From d17734d96ea8bbc647e217af4b18ee9700da3d96 Mon Sep 17 00:00:00 2001 From: yuanjiajia <1139393632@qq.com> Date: Wed, 9 Mar 2022 17:40:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E7=BA=BF=E6=A1=86=E7=BA=B9=E7=90=86=E7=B1=BB=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=92=8C=E4=B8=80=E4=B8=AA=E7=A0=96=E5=9D=97=E7=BA=B9=E7=90=86?= =?UTF-8?q?=E7=B1=BB=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/scene/texture/procedural/Brick.php | 147 +++++++++++++++++++++ src/scene/texture/procedural/Wireframe.php | 71 ++++++++++ 2 files changed, 218 insertions(+) create mode 100644 src/scene/texture/procedural/Brick.php create mode 100644 src/scene/texture/procedural/Wireframe.php diff --git a/src/scene/texture/procedural/Brick.php b/src/scene/texture/procedural/Brick.php new file mode 100644 index 0000000..f4167a7 --- /dev/null +++ b/src/scene/texture/procedural/Brick.php @@ -0,0 +1,147 @@ +mapping = $mapping; + else $this->mapping = new Mapping(); + $this->type = self::TYPE_BRICK; + $this->id = Scene::createID(); + Base::__construct($config); + } + + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置砖块纹理的bricktex颜色 + */ + public function setBricktex($color) + { + if( is_object($color) ) + { + if( $color->registerId != null ) $this->bricktex = $color->registerId; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->bricktex = $color; + } + + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置砖块纹理的brickmodtex颜色 + */ + public function setBrickmodtex($color) + { + if( is_object($color) ) + { + if( $color->registerId != null ) $this->brickmodtex = $color->registerId; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->brickmodtex = $color; + } + + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置砖块纹理的砖缝颜色 + */ + public function setMortartex($color) + { + if( is_object($color) ) + { + if( $color->registerId != null ) $this->mortartex = $color->registerId; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->mortartex = $color; + } + +} + +?> diff --git a/src/scene/texture/procedural/Wireframe.php b/src/scene/texture/procedural/Wireframe.php new file mode 100644 index 0000000..6bed3c9 --- /dev/null +++ b/src/scene/texture/procedural/Wireframe.php @@ -0,0 +1,71 @@ +type = self::TYPE_WIREFRAME; + $this->id = Scene::createID(); + Base::__construct($config); + } + + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置线框纹理的线框颜色 + */ + public function setBricktex($color) + { + if( is_object($color) ) + { + if( $color->registerId != null ) $this->bricktex = $color->registerId; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->bricktex = $color; + } + + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置线框纹理的内部面颜色 + */ + public function setBrickmodtex($color) + { + if( is_object($color) ) + { + if( $color->registerId != null ) $this->brickmodtex = $color->registerId; + else + { + throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); + } + } + else $this->brickmodtex = $color; + } + +} + +?>