From b552f79856b00b5b38313baac41562151895602d Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期二, 23 四月 2024 09:12:17 +0800
Subject: [PATCH] #
---
src/utils/common.js | 24 +++++++++++++++++++++++-
1 files changed, 23 insertions(+), 1 deletions(-)
diff --git a/src/utils/common.js b/src/utils/common.js
index b1041f5..2ace608 100644
--- a/src/utils/common.js
+++ b/src/utils/common.js
@@ -20,4 +20,26 @@
export const rotationParseNum = (num) => {
return num * Math.PI / 180;
-}
\ No newline at end of file
+}
+
+export const setShadow = (obj) => {
+ obj.castShadow = true;
+ obj.receiveShadow = true;
+
+ if (obj.children) {
+ obj.children.forEach((child) => {
+ setShadow(child);
+ });
+ }
+};
+
+export const setColor = (obj) => {
+ if (obj.material) {
+ obj.material.color.set(0x4680BF);
+ }
+ if (obj.children) {
+ obj.children.forEach((child) => {
+ setColor(child);
+ });
+ }
+};
\ No newline at end of file
--
Gitblit v1.9.1