- ),
- },
- {
- title: "Latest Commit",
- dataIndex: ["mostRecentRepo", "url"],
- key: "url",
- width: 276,
- sorter: {
- compare: (a, b) => {
- const dateA = a.mostRecentRepo?.pushedAt
- ? new Date(a.mostRecentRepo.pushedAt).getTime()
- : 0;
- const dateB = b.mostRecentRepo?.pushedAt
- ? new Date(b.mostRecentRepo.pushedAt).getTime()
- : 0;
- return dateB - dateA;
- },
- multiple: 3,
- },
- render: (url, record) => (
- <>
-
-
-
-
-
-
-
- {record.mostRecentRepo?.timeSinceLastCommit || "..."}
-
- >
- ),
- },
{
title: "Team GitHub",
dataIndex: "teamGithubURL",
From 1d4a2602a48e3a7ef1998c9440bc9e41d92d8a5d Mon Sep 17 00:00:00 2001
From: tuckpuck
Date: Mon, 2 Dec 2024 16:38:47 +0100
Subject: [PATCH 006/111] style: improve table header styles
---
css/styles.css | 7 ++++---
pages/_app.js | 1 +
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/css/styles.css b/css/styles.css
index 211b5d27..0f540dc8 100644
--- a/css/styles.css
+++ b/css/styles.css
@@ -701,15 +701,12 @@ html[style*="color-scheme: dark;"] .team_table_name:hover {
html[style*="color-scheme: light;"] .team_table_name {
color: #4b5563;
}
-
html[style*="color-scheme: light;"] .team_table_name:hover {
color: black;
}
-
.ant-table-cell div a {
width: 100%;
}
-
html[style*="color-scheme: dark;"] .ant-typography-copy svg {
margin-bottom: -6px;
opacity: 25%;
@@ -742,6 +739,10 @@ td.ant-table-cell {
padding: 4px 6px !important;
}
+thead th.ant-table-cell {
+ padding: 4px 16px !important;
+}
+
.stars-across-all-repos-badge-content {
outline-offset: 0 !important;
outline: none !important;
diff --git a/pages/_app.js b/pages/_app.js
index 50fc2edf..7ecde12a 100644
--- a/pages/_app.js
+++ b/pages/_app.js
@@ -77,6 +77,7 @@ const ThemeWrapper = ({ children }) => {
components: {
Table: {
colorBgContainer: isDark ? "#0e121e" : "#f7f7f7",
+ headerBorderRadius: 4,
},
},
}}
From bbcab0c456c746729d183059d279d2c134e0ade6 Mon Sep 17 00:00:00 2001
From: tuckpuck
Date: Tue, 3 Dec 2024 14:33:16 +0100
Subject: [PATCH 007/111] remove unused page (content will go on Utility Tools)
---
pages/development/_meta.json | 10 ----------
pages/development/developer_tool_explorers.mdx | 18 ------------------
2 files changed, 28 deletions(-)
delete mode 100644 pages/development/developer_tool_explorers.mdx
diff --git a/pages/development/_meta.json b/pages/development/_meta.json
index beb89f32..7c07d6ac 100644
--- a/pages/development/_meta.json
+++ b/pages/development/_meta.json
@@ -152,16 +152,6 @@
"pagination": false
}
},
- "developer_tool_explorers": {
- "title": "Tool Explorers ",
- "theme": {
- "breadcrumb": true,
- "sidebar": true,
- "toc": true,
- "footer": true,
- "pagination": false
- }
- },
"developer_jobs": {
"title": "Developer Jobs ",
"theme": {
diff --git a/pages/development/developer_tool_explorers.mdx b/pages/development/developer_tool_explorers.mdx
deleted file mode 100644
index fbf56c9b..00000000
--- a/pages/development/developer_tool_explorers.mdx
+++ /dev/null
@@ -1,18 +0,0 @@
----
-seo_title: Developer Tool Explorers
-seo_description:
-toc: false
----
-
-# Developer Tool Explorers
-
-This content is being peer reviewed & formally verified. Check back soon!
-
-In the meantime, explore other Cardano collections:
-
-- [YouTube Channels](https://www.adastack.io/community/youtube)
-- [Development Firms](https://www.adastack.io/development/dev_teams)
-- [Newsletters](https://www.adastack.io/community/newsletters)
-- [News and Blogs](https://www.adastack.io/community/news_and_blogs)
-
-[Back to Full Library →](https://www.adastack.io/all_pages)
From 81d8e33c5c2fba48f5c257f635181f34d9c8a1e6 Mon Sep 17 00:00:00 2001
From: tuckpuck
Date: Tue, 3 Dec 2024 14:44:09 +0100
Subject: [PATCH 008/111] remove unused page (content will go on Network
Activity)
---
pages/on_chain_metrics/_meta.json | 10 ----------
pages/on_chain_metrics/total_value_locked.mdx | 18 ------------------
2 files changed, 28 deletions(-)
delete mode 100644 pages/on_chain_metrics/total_value_locked.mdx
diff --git a/pages/on_chain_metrics/_meta.json b/pages/on_chain_metrics/_meta.json
index 5e15c939..5df13d4d 100644
--- a/pages/on_chain_metrics/_meta.json
+++ b/pages/on_chain_metrics/_meta.json
@@ -69,16 +69,6 @@
"pagination": false
}
},
- "total_value_locked": {
- "title": "Total Value Locked ",
- "theme": {
- "breadcrumb": true,
- "sidebar": true,
- "toc": true,
- "footer": true,
- "pagination": false
- }
- },
"staking_metrics": {
"title": "Staking Metrics ",
"theme": {
diff --git a/pages/on_chain_metrics/total_value_locked.mdx b/pages/on_chain_metrics/total_value_locked.mdx
deleted file mode 100644
index c6b5887f..00000000
--- a/pages/on_chain_metrics/total_value_locked.mdx
+++ /dev/null
@@ -1,18 +0,0 @@
----
-seo_title: Total Value Locked
-seo_description:
-toc: false
----
-
-# Total Value Locked
-
-This content is being peer reviewed & formally verified. Check back soon!
-
-In the meantime, explore other Cardano collections:
-
-- [YouTube Channels](https://www.adastack.io/community/youtube)
-- [Development Firms](https://www.adastack.io/development/dev_teams)
-- [Newsletters](https://www.adastack.io/community/newsletters)
-- [News and Blogs](https://www.adastack.io/community/news_and_blogs)
-
-[Back to Full Library →](https://www.adastack.io/all_pages)
From 0ec43d1d9238bfcf1718d59731c76cead7235971 Mon Sep 17 00:00:00 2001
From: tuckpuck
Date: Tue, 3 Dec 2024 15:52:44 +0100
Subject: [PATCH 009/111] Add more sections and resources to Network Activity
page
---
pages/on_chain_metrics/network_activity.mdx | 33 ++++++++++++++++++---
1 file changed, 29 insertions(+), 4 deletions(-)
diff --git a/pages/on_chain_metrics/network_activity.mdx b/pages/on_chain_metrics/network_activity.mdx
index 03b63eba..f3614e18 100644
--- a/pages/on_chain_metrics/network_activity.mdx
+++ b/pages/on_chain_metrics/network_activity.mdx
@@ -1,14 +1,14 @@
---
seo_title: Network Activity
-seo_description: View transaction activity on Cardano network. See transaction volume, addresses, fees, and block space. Explore real-time metrics and long-term trends.
+seo_description: View transaction activity on Cardano network. See transaction volume, addresses, TVL, and block space. Explore real-time metrics and long-term trends.
toc: false
---
# Network Activity
-Network activity metrics give insight into Cardano's usage and network health. See transaction volumes, address growth, and block space.
+Network activity metrics give insight into Cardano's usage and network health. See transaction volumes, address growth, TVL, block space usage, and more.
-## Transactions
+## Transaction Metrics
Transaction metrics including transaction volume, value, and fees.
@@ -23,12 +23,37 @@ Transaction metrics including transaction volume, value, and fees.
## Addresses and Account Activity
-Address metrics look at Cardano address growth and activity.
+Address metrics look at Cardano address growth and activity.
- [Adastats.info](https://adastats.info/addresses): Total addresses, and growth in number of addresses over time
- [Cexplorer Wallets](https://cexplorer.io/wallets): Active addresses
- [DefiLlama Addresses](https://defillama.com/chain/Cardano?addresses=true&tvl=false): Active addresses
+## Trading Metrics
+
+Trading Metrics track trading volumes, price, and liquidity of tokens on Cardano's decentralized exchanges.
+
+- [DexScreener](https://dexscreener.com/cardano)
+- [Coingecko Cardano Ecosystem](https://www.coingecko.com/en/categories/cardano-ecosystem)
+- [CoinMarketCap Cardano Ecosystem](https://coinmarketcap.com/view/cardano-ecosystem/)
+- [CardexScan](https://cardexscan.com/global-trades)
+
+## Total Value Locked
+
+Total Value Locked (TVL) quantifies the total assets deposited in Cardano DeFi protocols.
+
+- [Cexplorer TVL](https://cexplorer.io/defi/tvl): Total TVL chart
+- [DefiLlama TVL](https://defillama.com/chain/Cardano?currency=USD&tvl=tvl): Total TVL
+- [Cardano Blockchain Insights](https://lookerstudio.google.com/s/kpmEIAO1Qiw): Value locked per day
+
+## Dapp TVL Metrics
+
+Dapp TVL Metrics show information about the assets locked in decentralized applications on Cardano.
+
+- [Danogo](https://danogo.io/tvl-report): TVL by dApp
+- [Cardano Blockchain Insights](https://lookerstudio.google.com/s/kpmEIAO1Qiw): TVL by dApp
+- [Taptools Market Overview](https://www.taptools.io/market-overview): TVL by dApp
+
## Block Space Usage
Block space metrics show how full blocks are on the Cardano network.
From f5318161378cdbf5ac3cb33abe8187f68a8b88a5 Mon Sep 17 00:00:00 2001
From: tuckpuck
Date: Tue, 3 Dec 2024 16:38:21 +0100
Subject: [PATCH 010/111] add "full node size" section, rewrite some
descriptions
---
.../decentralization_metrics.mdx | 21 ++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/pages/on_chain_metrics/decentralization_metrics.mdx b/pages/on_chain_metrics/decentralization_metrics.mdx
index c04ac240..4c932974 100644
--- a/pages/on_chain_metrics/decentralization_metrics.mdx
+++ b/pages/on_chain_metrics/decentralization_metrics.mdx
@@ -1,6 +1,6 @@
---
seo_title: Decentralization Metrics
-seo_description: Cardano's decentralization metrics for network security. Explore key metrics like MAV, nakamoto coefficient, ISPs, and geographic distribution of nodes.
+seo_description: Discover Cardano's robust decentralization and network security through key metrics like node distribution, Nakamoto coefficient (MAV), and ledger size.
toc: false
---
@@ -8,15 +8,15 @@ toc: false
Blockchains rely on decentralization to maintain long-term resilience and security. By distributing block-production and block records across a wide network of nodes, decentralization prevents single points of failure that can compromise the system.
-## Decentralization Index
+## Decentralization Indexes
-Comparison of Cardano's decentralization with other blockchains.
+Compare Cardano's decentralization with other blockchains.
-- [Edinburgh Decentralization Index](http://blockchainlab.inf.ed.ac.uk/edi-dashboard/)
+- [Edinburgh Decentralization Index](http://blockchainlab.inf.ed.ac.uk/edi-dashboard/): University of Edinburgh initiative to objectively measure the decentralization of major cryptocurrencies across various layers.
## Minimum Attack Vector (MAV)
-MAV examines how many stake pools would need to be compromised for an attacker to gain a majority of the block production of the network (51% attack). This metric is also known as Nakamoto Coefficient.
+MAV measures how many stake pools would need to be compromised for an attacker to gain a majority of the network's block production (51% attack). This metric is also known as Nakamoto Coefficient.
- [Cexplorer Groups](https://cexplorer.io/groups): MAV by stake pool
- [Balance Analytics Cardano Donut Chart](https://www.balanceanalytics.io/chartboards/donut_shop): MAV donut graphs
@@ -24,10 +24,17 @@ MAV examines how many stake pools would need to be compromised for an attacker t
## Geographic Node Distribution
-Geographic node distribution refers to the global placement of nodes. High distribution improves resiliancy because some nodes are likely to remain operating at any time.
+Geographic node distribution refers to the global spread of blockchain nodes, enhancing network resilience by reducing single points of failure.
- [Cexplorer.io Relays](https://cexplorer.io/relays): Country and ISP distribution
- [Pooltool Network Health](https://pooltool.io/networkhealth): Data center distribution
- [Cardano Blockchain Insights](https://lookerstudio.google.com/s/m24jHTNX1DM): Geographic and ISP distribution
- [MonadPool](https://monadpool.com/cardano.html): Relay Map
-- [Relay Geolocation](https://relaygeolocatio.netlify.app/): Geolocation Map for Cardano Relays
\ No newline at end of file
+- [Relay Geolocation](https://relaygeolocatio.netlify.app/): Geolocation Map for Cardano Relays
+
+## Full Node Size
+
+The size of a Cardano full node indicates the amount of storage needed to maintain the complete blockchain record.
+
+- [Cexplorer Storage](https://cexplorer.io/storage)
+- [Cardano Blockchain Insights](https://lookerstudio.google.com/s/rkbL4boJKeY)
\ No newline at end of file
From 1f4adfeda94898d03e646c917140fcd13083a504 Mon Sep 17 00:00:00 2001
From: tuckpuck
Date: Tue, 3 Dec 2024 16:44:14 +0100
Subject: [PATCH 011/111] re-order on-chain metrics and change a page title
---
pages/on_chain_metrics/_meta.json | 20 ++++++++++----------
pages/on_chain_metrics/network_activity.mdx | 4 ++--
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/pages/on_chain_metrics/_meta.json b/pages/on_chain_metrics/_meta.json
index 5df13d4d..096cd39b 100644
--- a/pages/on_chain_metrics/_meta.json
+++ b/pages/on_chain_metrics/_meta.json
@@ -29,8 +29,8 @@
"pagination": false
}
},
- "tokenomics_and_distribution": {
- "title": "Tokenomics and Distribution ",
+ "staking_metrics": {
+ "title": "Staking ",
"theme": {
"breadcrumb": true,
"sidebar": true,
@@ -39,8 +39,8 @@
"pagination": false
}
},
- "monetary_policy": {
- "title": "Monetary Policy ",
+ "tokenomics_and_distribution": {
+ "title": "Tokenomics and Distribution ",
"theme": {
"breadcrumb": true,
"sidebar": true,
@@ -49,8 +49,8 @@
"pagination": false
}
},
- "circulating_supply": {
- "title": "Circulating Supply ",
+ "monetary_policy": {
+ "title": "Monetary Policy ",
"theme": {
"breadcrumb": true,
"sidebar": true,
@@ -59,8 +59,8 @@
"pagination": false
}
},
- "treasury": {
- "title": "Treasury ",
+ "circulating_supply": {
+ "title": "Circulating Supply ",
"theme": {
"breadcrumb": true,
"sidebar": true,
@@ -69,8 +69,8 @@
"pagination": false
}
},
- "staking_metrics": {
- "title": "Staking Metrics ",
+ "treasury": {
+ "title": "Treasury ",
"theme": {
"breadcrumb": true,
"sidebar": true,
diff --git a/pages/on_chain_metrics/network_activity.mdx b/pages/on_chain_metrics/network_activity.mdx
index f3614e18..2ddda7a3 100644
--- a/pages/on_chain_metrics/network_activity.mdx
+++ b/pages/on_chain_metrics/network_activity.mdx
@@ -1,10 +1,10 @@
---
-seo_title: Network Activity
+seo_title: Network Activity Metrics
seo_description: View transaction activity on Cardano network. See transaction volume, addresses, TVL, and block space. Explore real-time metrics and long-term trends.
toc: false
---
-# Network Activity
+# Network Activity Metrics
Network activity metrics give insight into Cardano's usage and network health. See transaction volumes, address growth, TVL, block space usage, and more.
From 39b98174da619f9d128846f7d5d184347384e264 Mon Sep 17 00:00:00 2001
From: tuckpuck
Date: Wed, 4 Dec 2024 14:44:09 +0100
Subject: [PATCH 012/111] update page name to "Price and Charts"
---
pages/ecosystem/_meta.json | 4 ++--
pages/ecosystem/{cardano_markets.mdx => price_and_charts.mdx} | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
rename pages/ecosystem/{cardano_markets.mdx => price_and_charts.mdx} (91%)
diff --git a/pages/ecosystem/_meta.json b/pages/ecosystem/_meta.json
index 14922fdc..d6056b66 100644
--- a/pages/ecosystem/_meta.json
+++ b/pages/ecosystem/_meta.json
@@ -39,8 +39,8 @@
"pagination": false
}
},
- "cardano_markets": {
- "title": "Cardano Markets ",
+ "price_and_charts": {
+ "title": "Price and Charts ",
"theme": {
"breadcrumb": true,
"sidebar": true,
diff --git a/pages/ecosystem/cardano_markets.mdx b/pages/ecosystem/price_and_charts.mdx
similarity index 91%
rename from pages/ecosystem/cardano_markets.mdx
rename to pages/ecosystem/price_and_charts.mdx
index 70b2da9a..9de7236f 100644
--- a/pages/ecosystem/cardano_markets.mdx
+++ b/pages/ecosystem/price_and_charts.mdx
@@ -1,10 +1,10 @@
---
-seo_title: Cardano Markets
+seo_title: Price and Charts
seo_description:
toc: false
---
-# Cardano Markets
+# Price and Charts
This content is being peer reviewed & formally verified. Check back soon!
From 55c8c89d8d149ca82bd2982d5713d727283878c0 Mon Sep 17 00:00:00 2001
From: tuckpuck
Date: Wed, 4 Dec 2024 15:02:42 +0100
Subject: [PATCH 013/111] add medical and health dapps page
---
pages/dapps/_meta.json | 10 ++++++++++
pages/dapps/medical_and_health.mdx | 18 ++++++++++++++++++
2 files changed, 28 insertions(+)
create mode 100644 pages/dapps/medical_and_health.mdx
diff --git a/pages/dapps/_meta.json b/pages/dapps/_meta.json
index eec93b40..f68e8fa7 100644
--- a/pages/dapps/_meta.json
+++ b/pages/dapps/_meta.json
@@ -189,6 +189,16 @@
"pagination": false
}
},
+ "medical_and_health": {
+ "title": "Medical and Health ",
+ "theme": {
+ "breadcrumb": true,
+ "sidebar": true,
+ "toc": true,
+ "footer": true,
+ "pagination": false
+ }
+ },
"other_dapps": {
"title": "Other dApps ",
"theme": {
diff --git a/pages/dapps/medical_and_health.mdx b/pages/dapps/medical_and_health.mdx
new file mode 100644
index 00000000..c19d51b4
--- /dev/null
+++ b/pages/dapps/medical_and_health.mdx
@@ -0,0 +1,18 @@
+---
+seo_title: Medical and Health
+seo_description:
+toc: false
+---
+
+# Medical and Health
+
+This content is being peer reviewed & formally verified. Check back soon!
+
+In the meantime, explore other Cardano collections:
+
+- [YouTube Channels](https://www.adastack.io/community/youtube)
+- [Development Firms](https://www.adastack.io/development/dev_teams)
+- [Newsletters](https://www.adastack.io/community/newsletters)
+- [News and Blogs](https://www.adastack.io/community/news_and_blogs)
+
+[Back to Full Library →](https://www.adastack.io/all_pages)
\ No newline at end of file
From 061cd6d0a2683778664b43ac6ece6a99fe4e89e2 Mon Sep 17 00:00:00 2001
From: tuckpuck
Date: Wed, 4 Dec 2024 15:05:44 +0100
Subject: [PATCH 014/111] remove unused page
---
pages/ecosystem/tokens.mdx | 17 -----------------
1 file changed, 17 deletions(-)
delete mode 100644 pages/ecosystem/tokens.mdx
diff --git a/pages/ecosystem/tokens.mdx b/pages/ecosystem/tokens.mdx
deleted file mode 100644
index ceb36dbd..00000000
--- a/pages/ecosystem/tokens.mdx
+++ /dev/null
@@ -1,17 +0,0 @@
----
-seo_title: Cardano Tokens
-seo_description:
----
-
-# Cardano Tokens
-
-This content is being peer reviewed & formally verified. Check back soon!
-
-In the meantime, explore other Cardano collections:
-
-- [YouTube Channels](https://www.adastack.io/community/youtube)
-- [Development Firms](https://www.adastack.io/development/dev_teams)
-- [Newsletters](https://www.adastack.io/community/newsletters)
-- [News and Blogs](https://www.adastack.io/community/news_and_blogs)
-
-[Back to Full Library →](https://www.adastack.io/all_pages)
From cb9f26df1c1dc8e0d23387762e27354dc9d0b142 Mon Sep 17 00:00:00 2001
From: tuckpuck
Date: Wed, 4 Dec 2024 15:06:07 +0100
Subject: [PATCH 015/111] re-order dapps
---
pages/dapps/_meta.json | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/pages/dapps/_meta.json b/pages/dapps/_meta.json
index f68e8fa7..de3d1666 100644
--- a/pages/dapps/_meta.json
+++ b/pages/dapps/_meta.json
@@ -179,8 +179,8 @@
"pagination": false
}
},
- "reward_distribution_dapps": {
- "title": "Reward Distribution ",
+ "medical_and_health": {
+ "title": "Medical and Health ",
"theme": {
"breadcrumb": true,
"sidebar": true,
@@ -189,8 +189,8 @@
"pagination": false
}
},
- "medical_and_health": {
- "title": "Medical and Health ",
+ "reward_distribution_dapps": {
+ "title": "Reward Distribution ",
"theme": {
"breadcrumb": true,
"sidebar": true,
From d259fe3d968585c879f03fc59e9805108ab0f0a8 Mon Sep 17 00:00:00 2001
From: tuckpuck
Date: Wed, 4 Dec 2024 16:19:08 +0100
Subject: [PATCH 016/111] reorganize dapps alphabetically and remove "dapps"
from page names and meta descriptions
---
pages/_meta.json | 2 +-
pages/dapps/_meta.json | 74 +++++++++----------
pages/dapps/{ai_dapps.mdx => ai.mdx} | 2 +-
....mdx => dapp_analysis_and_risk_rating.mdx} | 4 +-
pages/dapps/dapp_explorers.mdx | 4 +-
...pps.mdx => data_storage_and_computing.mdx} | 2 +-
pages/dapps/{defi_dapps.mdx => defi.mdx} | 2 +-
.../{education_dapps.mdx => education.mdx} | 2 +-
...ing_dapps.mdx => events_and_ticketing.mdx} | 2 +-
.../{identity_dapps.mdx => identity.mdx} | 2 +-
..._chat_dapps.mdx => messaging_and_chat.mdx} | 2 +-
pages/dapps/other_dapps.mdx | 2 +-
...e_dapps.mdx => payments_and_ecommerce.mdx} | 2 +-
...e_impact_dapps.mdx => positive_impact.mdx} | 2 +-
.../dapps/{privacy_dapps.mdx => privacy.mdx} | 2 +-
..._asset_dapps.mdx => real_world_assets.mdx} | 2 +-
...tion_dapps.mdx => reward_distribution.mdx} | 2 +-
...dapps.mdx => signing_and_verification.mdx} | 2 +-
...ocial_media_dapps.mdx => social_media.mdx} | 2 +-
...upply_chain_dapps.mdx => supply_chain.mdx} | 2 +-
20 files changed, 58 insertions(+), 58 deletions(-)
rename pages/dapps/{ai_dapps.mdx => ai.mdx} (96%)
rename pages/dapps/{dapp_analysis_tools.mdx => dapp_analysis_and_risk_rating.mdx} (86%)
rename pages/dapps/{data_storage_and_computing_dapps.mdx => data_storage_and_computing.mdx} (92%)
rename pages/dapps/{defi_dapps.mdx => defi.mdx} (95%)
rename pages/dapps/{education_dapps.mdx => education.mdx} (94%)
rename pages/dapps/{events_and_ticketing_dapps.mdx => events_and_ticketing.mdx} (93%)
rename pages/dapps/{identity_dapps.mdx => identity.mdx} (95%)
rename pages/dapps/{messaging_and_chat_dapps.mdx => messaging_and_chat.mdx} (93%)
rename pages/dapps/{payments_and_ecommerce_dapps.mdx => payments_and_ecommerce.mdx} (92%)
rename pages/dapps/{positive_impact_dapps.mdx => positive_impact.mdx} (93%)
rename pages/dapps/{privacy_dapps.mdx => privacy.mdx} (95%)
rename pages/dapps/{real_world_asset_dapps.mdx => real_world_assets.mdx} (93%)
rename pages/dapps/{reward_distribution_dapps.mdx => reward_distribution.mdx} (93%)
rename pages/dapps/{signing_and_verification_dapps.mdx => signing_and_verification.mdx} (92%)
rename pages/dapps/{social_media_dapps.mdx => social_media.mdx} (94%)
rename pages/dapps/{supply_chain_dapps.mdx => supply_chain.mdx} (94%)
diff --git a/pages/_meta.json b/pages/_meta.json
index ae836824..ba3583fc 100644
--- a/pages/_meta.json
+++ b/pages/_meta.json
@@ -63,7 +63,7 @@
}
},
"dapps": {
- "title": "dApps",
+ "title": "Dapps",
"theme": {
"breadcrumb": true,
"sidebar": true,
diff --git a/pages/dapps/_meta.json b/pages/dapps/_meta.json
index de3d1666..855b77d5 100644
--- a/pages/dapps/_meta.json
+++ b/pages/dapps/_meta.json
@@ -9,8 +9,8 @@
"pagination": false
}
},
- "dapp_explorers": {
- "title": "dApp Explorers",
+ "ai": {
+ "title": "AI ",
"theme": {
"breadcrumb": true,
"sidebar": true,
@@ -19,8 +19,8 @@
"pagination": false
}
},
- "dapp_analysis_tools": {
- "title": "dApp Analysis Tools ",
+ "dapp_analysis_and_risk_rating": {
+ "title": "Dapp Analysis & Risk Ratings ",
"theme": {
"breadcrumb": true,
"sidebar": true,
@@ -29,8 +29,8 @@
"pagination": false
}
},
- "dexs": {
- "title": "DEXs ",
+ "dapp_explorers": {
+ "title": "Dapp Explorers",
"theme": {
"breadcrumb": true,
"sidebar": true,
@@ -39,8 +39,8 @@
"pagination": false
}
},
- "defi_dapps": {
- "title": "DeFi ",
+ "data_storage_and_computing": {
+ "title": "Data Storage & Computing ",
"theme": {
"breadcrumb": true,
"sidebar": true,
@@ -49,8 +49,8 @@
"pagination": false
}
},
- "payments_and_ecommerce_dapps": {
- "title": "Payments and E-Commerce ",
+ "defi": {
+ "title": "DeFi ",
"theme": {
"breadcrumb": true,
"sidebar": true,
@@ -59,8 +59,8 @@
"pagination": false
}
},
- "data_storage_and_computing_dapps": {
- "title": "Data Storage and Computing ",
+ "dexs": {
+ "title": "DEXs ",
"theme": {
"breadcrumb": true,
"sidebar": true,
@@ -69,8 +69,8 @@
"pagination": false
}
},
- "ai_dapps": {
- "title": "AI ",
+ "education": {
+ "title": "Education ",
"theme": {
"breadcrumb": true,
"sidebar": true,
@@ -79,8 +79,8 @@
"pagination": false
}
},
- "social_media_dapps": {
- "title": "Social Media ",
+ "events_and_ticketing": {
+ "title": "Events & Ticketing ",
"theme": {
"breadcrumb": true,
"sidebar": true,
@@ -89,8 +89,8 @@
"pagination": false
}
},
- "messaging_and_chat_dapps": {
- "title": "Messaging and Chat ",
+ "identity": {
+ "title": "Identity ",
"theme": {
"breadcrumb": true,
"sidebar": true,
@@ -99,8 +99,8 @@
"pagination": false
}
},
- "identity_dapps": {
- "title": "Identity ",
+ "medical_and_health": {
+ "title": "Medical & Health ",
"theme": {
"breadcrumb": true,
"sidebar": true,
@@ -109,8 +109,8 @@
"pagination": false
}
},
- "signing_and_verification_dapps": {
- "title": "Signing and Verification ",
+ "messaging_and_chat": {
+ "title": "Messaging & Chat ",
"theme": {
"breadcrumb": true,
"sidebar": true,
@@ -119,8 +119,8 @@
"pagination": false
}
},
- "education_dapps": {
- "title": "Education ",
+ "payments_and_ecommerce": {
+ "title": "Payments & E-Commerce ",
"theme": {
"breadcrumb": true,
"sidebar": true,
@@ -129,8 +129,8 @@
"pagination": false
}
},
- "events_and_ticketing_dapps": {
- "title": "Events and Ticketing ",
+ "positive_impact": {
+ "title": "Positive Impact ",
"theme": {
"breadcrumb": true,
"sidebar": true,
@@ -139,8 +139,8 @@
"pagination": false
}
},
- "supply_chain_dapps": {
- "title": "Supply Chain ",
+ "privacy": {
+ "title": "Privacy ",
"theme": {
"breadcrumb": true,
"sidebar": true,
@@ -149,7 +149,7 @@
"pagination": false
}
},
- "real_world_asset_dapps": {
+ "real_world_assets": {
"title": "Real World Assets ",
"theme": {
"breadcrumb": true,
@@ -159,8 +159,8 @@
"pagination": false
}
},
- "positive_impact_dapps": {
- "title": "Positive Impact ",
+ "reward_distribution": {
+ "title": "Reward Distribution ",
"theme": {
"breadcrumb": true,
"sidebar": true,
@@ -169,8 +169,8 @@
"pagination": false
}
},
- "privacy_dapps": {
- "title": "Privacy ",
+ "signing_and_verification": {
+ "title": "Signing & Verification ",
"theme": {
"breadcrumb": true,
"sidebar": true,
@@ -179,8 +179,8 @@
"pagination": false
}
},
- "medical_and_health": {
- "title": "Medical and Health ",
+ "social_media": {
+ "title": "Social Media ",
"theme": {
"breadcrumb": true,
"sidebar": true,
@@ -189,8 +189,8 @@
"pagination": false
}
},
- "reward_distribution_dapps": {
- "title": "Reward Distribution ",
+ "supply_chain": {
+ "title": "Supply Chain ",
"theme": {
"breadcrumb": true,
"sidebar": true,
diff --git a/pages/dapps/ai_dapps.mdx b/pages/dapps/ai.mdx
similarity index 96%
rename from pages/dapps/ai_dapps.mdx
rename to pages/dapps/ai.mdx
index 0e169d21..3a22f5ee 100644
--- a/pages/dapps/ai_dapps.mdx
+++ b/pages/dapps/ai.mdx
@@ -1,5 +1,5 @@
---
-seo_title: AI dApps
+seo_title: AI
seo_description:
toc: false
---
diff --git a/pages/dapps/dapp_analysis_tools.mdx b/pages/dapps/dapp_analysis_and_risk_rating.mdx
similarity index 86%
rename from pages/dapps/dapp_analysis_tools.mdx
rename to pages/dapps/dapp_analysis_and_risk_rating.mdx
index 72201c2c..7a63f5fd 100644
--- a/pages/dapps/dapp_analysis_tools.mdx
+++ b/pages/dapps/dapp_analysis_and_risk_rating.mdx
@@ -1,10 +1,10 @@
---
-seo_title: dApp Analysis Tools
+seo_title: Dapp Analysis and Risk Rating
seo_description:
toc: false
---
-# dApp Analysis Tools
+# Dapp Analysis and Risk Ratings
This content is being peer reviewed & formally verified. Check back soon!
diff --git a/pages/dapps/dapp_explorers.mdx b/pages/dapps/dapp_explorers.mdx
index e66778e1..f3310298 100644
--- a/pages/dapps/dapp_explorers.mdx
+++ b/pages/dapps/dapp_explorers.mdx
@@ -1,10 +1,10 @@
---
-seo_title: dApp Explorers
+seo_title: Dapp Explorers
seo_description: Discover a variety of decentralized applications (dApps) in the Cardano ecosystem, using these explorers. Find the blockchain service for what you need.
toc: false
---
-# dApp Explorers
+# Dapp Explorers
Explore the dApps in the Cardano ecosystem.
diff --git a/pages/dapps/data_storage_and_computing_dapps.mdx b/pages/dapps/data_storage_and_computing.mdx
similarity index 92%
rename from pages/dapps/data_storage_and_computing_dapps.mdx
rename to pages/dapps/data_storage_and_computing.mdx
index bebf26fb..9428cf59 100644
--- a/pages/dapps/data_storage_and_computing_dapps.mdx
+++ b/pages/dapps/data_storage_and_computing.mdx
@@ -1,5 +1,5 @@
---
-seo_title: Data Storage and Computing dApps
+seo_title: Data Storage and Computing
seo_description:
toc: false
---
diff --git a/pages/dapps/defi_dapps.mdx b/pages/dapps/defi.mdx
similarity index 95%
rename from pages/dapps/defi_dapps.mdx
rename to pages/dapps/defi.mdx
index 2a3cf18e..b116762b 100644
--- a/pages/dapps/defi_dapps.mdx
+++ b/pages/dapps/defi.mdx
@@ -1,5 +1,5 @@
---
-seo_title: DeFi dApps
+seo_title: DeFi
seo_description:
toc: false
---
diff --git a/pages/dapps/education_dapps.mdx b/pages/dapps/education.mdx
similarity index 94%
rename from pages/dapps/education_dapps.mdx
rename to pages/dapps/education.mdx
index ee223b16..010a3963 100644
--- a/pages/dapps/education_dapps.mdx
+++ b/pages/dapps/education.mdx
@@ -1,5 +1,5 @@
---
-seo_title: Education dApps
+seo_title: Education
seo_description:
toc: false
---
diff --git a/pages/dapps/events_and_ticketing_dapps.mdx b/pages/dapps/events_and_ticketing.mdx
similarity index 93%
rename from pages/dapps/events_and_ticketing_dapps.mdx
rename to pages/dapps/events_and_ticketing.mdx
index 1ace50f9..c8e9a4e6 100644
--- a/pages/dapps/events_and_ticketing_dapps.mdx
+++ b/pages/dapps/events_and_ticketing.mdx
@@ -1,5 +1,5 @@
---
-seo_title: Events and Ticketing dApps
+seo_title: Events and Ticketing
seo_description:
toc: false
---
diff --git a/pages/dapps/identity_dapps.mdx b/pages/dapps/identity.mdx
similarity index 95%
rename from pages/dapps/identity_dapps.mdx
rename to pages/dapps/identity.mdx
index 43a121d1..3d5ac80b 100644
--- a/pages/dapps/identity_dapps.mdx
+++ b/pages/dapps/identity.mdx
@@ -1,5 +1,5 @@
---
-seo_title: Identity dApps
+seo_title: Identity
seo_description:
toc: false
---
diff --git a/pages/dapps/messaging_and_chat_dapps.mdx b/pages/dapps/messaging_and_chat.mdx
similarity index 93%
rename from pages/dapps/messaging_and_chat_dapps.mdx
rename to pages/dapps/messaging_and_chat.mdx
index ceebfb04..734a5a22 100644
--- a/pages/dapps/messaging_and_chat_dapps.mdx
+++ b/pages/dapps/messaging_and_chat.mdx
@@ -1,5 +1,5 @@
---
-seo_title: Messaging and Chat dApps
+seo_title: Messaging and Chat
seo_description:
toc: false
---
diff --git a/pages/dapps/other_dapps.mdx b/pages/dapps/other_dapps.mdx
index 61133bb3..a72e7ef0 100644
--- a/pages/dapps/other_dapps.mdx
+++ b/pages/dapps/other_dapps.mdx
@@ -1,5 +1,5 @@
---
-seo_title: Other dApps
+seo_title: Other Dapps on Cardano
seo_description:
toc: false
---
diff --git a/pages/dapps/payments_and_ecommerce_dapps.mdx b/pages/dapps/payments_and_ecommerce.mdx
similarity index 92%
rename from pages/dapps/payments_and_ecommerce_dapps.mdx
rename to pages/dapps/payments_and_ecommerce.mdx
index 15c33784..65fc20ea 100644
--- a/pages/dapps/payments_and_ecommerce_dapps.mdx
+++ b/pages/dapps/payments_and_ecommerce.mdx
@@ -1,5 +1,5 @@
---
-seo_title: Payments and E-Commerce dApps
+seo_title: Payments and E-Commerce
seo_description:
toc: false
---
diff --git a/pages/dapps/positive_impact_dapps.mdx b/pages/dapps/positive_impact.mdx
similarity index 93%
rename from pages/dapps/positive_impact_dapps.mdx
rename to pages/dapps/positive_impact.mdx
index c88367fd..3359cbc3 100644
--- a/pages/dapps/positive_impact_dapps.mdx
+++ b/pages/dapps/positive_impact.mdx
@@ -1,5 +1,5 @@
---
-seo_title: Positive Impact dApps
+seo_title: Positive Impact
seo_description:
toc: false
---
diff --git a/pages/dapps/privacy_dapps.mdx b/pages/dapps/privacy.mdx
similarity index 95%
rename from pages/dapps/privacy_dapps.mdx
rename to pages/dapps/privacy.mdx
index 57d77600..de84297d 100644
--- a/pages/dapps/privacy_dapps.mdx
+++ b/pages/dapps/privacy.mdx
@@ -1,5 +1,5 @@
---
-seo_title: Privacy dApps
+seo_title: Privacy
seo_description:
toc: false
---
diff --git a/pages/dapps/real_world_asset_dapps.mdx b/pages/dapps/real_world_assets.mdx
similarity index 93%
rename from pages/dapps/real_world_asset_dapps.mdx
rename to pages/dapps/real_world_assets.mdx
index 60741724..eec7c822 100644
--- a/pages/dapps/real_world_asset_dapps.mdx
+++ b/pages/dapps/real_world_assets.mdx
@@ -1,5 +1,5 @@
---
-seo_title: Real World Asset dApps
+seo_title: Real World Asset
seo_description:
toc: false
---
diff --git a/pages/dapps/reward_distribution_dapps.mdx b/pages/dapps/reward_distribution.mdx
similarity index 93%
rename from pages/dapps/reward_distribution_dapps.mdx
rename to pages/dapps/reward_distribution.mdx
index 8e06941e..93aba142 100644
--- a/pages/dapps/reward_distribution_dapps.mdx
+++ b/pages/dapps/reward_distribution.mdx
@@ -1,5 +1,5 @@
---
-seo_title: Reward Distribution dApps
+seo_title: Reward Distribution
seo_description:
toc: false
---
diff --git a/pages/dapps/signing_and_verification_dapps.mdx b/pages/dapps/signing_and_verification.mdx
similarity index 92%
rename from pages/dapps/signing_and_verification_dapps.mdx
rename to pages/dapps/signing_and_verification.mdx
index 73713566..c593a122 100644
--- a/pages/dapps/signing_and_verification_dapps.mdx
+++ b/pages/dapps/signing_and_verification.mdx
@@ -1,5 +1,5 @@
---
-seo_title: Signing and Verification dApps
+seo_title: Signing and Verification
seo_description:
toc: false
---
diff --git a/pages/dapps/social_media_dapps.mdx b/pages/dapps/social_media.mdx
similarity index 94%
rename from pages/dapps/social_media_dapps.mdx
rename to pages/dapps/social_media.mdx
index b3af446a..851bb7e5 100644
--- a/pages/dapps/social_media_dapps.mdx
+++ b/pages/dapps/social_media.mdx
@@ -1,5 +1,5 @@
---
-seo_title: Social Media dApps
+seo_title: Social Media
seo_description:
toc: false
---
diff --git a/pages/dapps/supply_chain_dapps.mdx b/pages/dapps/supply_chain.mdx
similarity index 94%
rename from pages/dapps/supply_chain_dapps.mdx
rename to pages/dapps/supply_chain.mdx
index 88a9db5f..f1f40fa3 100644
--- a/pages/dapps/supply_chain_dapps.mdx
+++ b/pages/dapps/supply_chain.mdx
@@ -1,5 +1,5 @@
---
-seo_title: Supply Chain dApps
+seo_title: Supply Chain
seo_description:
toc: false
---
From 111ed700ea79fcf40e4921971c094b6798ae494b Mon Sep 17 00:00:00 2001
From: tuckpuck
Date: Wed, 4 Dec 2024 16:25:50 +0100
Subject: [PATCH 017/111] Add & everytime it says "and" in the menu
---
pages/community/_meta.json | 4 ++--
pages/ecosystem/_meta.json | 2 +-
pages/governance/_meta.json | 2 +-
pages/nfts/_meta.json | 4 ++--
pages/on_chain_metrics/_meta.json | 2 +-
5 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/pages/community/_meta.json b/pages/community/_meta.json
index a2917906..03e7bd97 100644
--- a/pages/community/_meta.json
+++ b/pages/community/_meta.json
@@ -10,7 +10,7 @@
}
},
"news_and_blogs": {
- "title": "News and Blogs",
+ "title": "News & Blogs",
"theme": {
"breadcrumb": true,
"sidebar": true,
@@ -30,7 +30,7 @@
}
},
"reddit_and_forums": {
- "title": "Reddit and Forums ",
+ "title": "Reddit & Forums ",
"theme": {
"breadcrumb": true,
"sidebar": true,
diff --git a/pages/ecosystem/_meta.json b/pages/ecosystem/_meta.json
index d6056b66..fa6447c5 100644
--- a/pages/ecosystem/_meta.json
+++ b/pages/ecosystem/_meta.json
@@ -40,7 +40,7 @@
}
},
"price_and_charts": {
- "title": "Price and Charts ",
+ "title": "Price & Charts ",
"theme": {
"breadcrumb": true,
"sidebar": true,
diff --git a/pages/governance/_meta.json b/pages/governance/_meta.json
index 172eee2d..ff8036e4 100644
--- a/pages/governance/_meta.json
+++ b/pages/governance/_meta.json
@@ -10,7 +10,7 @@
}
},
"voting_and_dreps": {
- "title": "Voting and DReps ",
+ "title": "Voting & DReps ",
"theme": {
"breadcrumb": true,
"sidebar": true,
diff --git a/pages/nfts/_meta.json b/pages/nfts/_meta.json
index 984fe9d3..795a42fa 100644
--- a/pages/nfts/_meta.json
+++ b/pages/nfts/_meta.json
@@ -40,7 +40,7 @@
}
},
"domains_and_handles": {
- "title": "Domains and Handles ",
+ "title": "Domains & Handles ",
"theme": {
"breadcrumb": true,
"sidebar": true,
@@ -70,7 +70,7 @@
}
},
"nft_lending_and_borrowing": {
- "title": "NFT Lending and Borrowing ",
+ "title": "NFT Lending & Borrowing ",
"theme": {
"breadcrumb": true,
"sidebar": true,
diff --git a/pages/on_chain_metrics/_meta.json b/pages/on_chain_metrics/_meta.json
index 096cd39b..9118f5b5 100644
--- a/pages/on_chain_metrics/_meta.json
+++ b/pages/on_chain_metrics/_meta.json
@@ -40,7 +40,7 @@
}
},
"tokenomics_and_distribution": {
- "title": "Tokenomics and Distribution ",
+ "title": "Tokenomics & Distribution ",
"theme": {
"breadcrumb": true,
"sidebar": true,
From 54b913c7b4bc31ed3b15c3c35e4fecb89356b563 Mon Sep 17 00:00:00 2001
From: tuckpuck
Date: Wed, 4 Dec 2024 16:28:06 +0100
Subject: [PATCH 018/111] rename privacy to privacy and security
---
pages/dapps/_meta.json | 4 ++--
pages/dapps/{privacy.mdx => privacy_and_security.mdx} | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
rename pages/dapps/{privacy.mdx => privacy_and_security.mdx} (89%)
diff --git a/pages/dapps/_meta.json b/pages/dapps/_meta.json
index 855b77d5..aad665a0 100644
--- a/pages/dapps/_meta.json
+++ b/pages/dapps/_meta.json
@@ -139,8 +139,8 @@
"pagination": false
}
},
- "privacy": {
- "title": "Privacy ",
+ "privacy_and_security": {
+ "title": "Privacy & Security ",
"theme": {
"breadcrumb": true,
"sidebar": true,
diff --git a/pages/dapps/privacy.mdx b/pages/dapps/privacy_and_security.mdx
similarity index 89%
rename from pages/dapps/privacy.mdx
rename to pages/dapps/privacy_and_security.mdx
index de84297d..9632c979 100644
--- a/pages/dapps/privacy.mdx
+++ b/pages/dapps/privacy_and_security.mdx
@@ -1,10 +1,10 @@
---
-seo_title: Privacy
+seo_title: Privacy and Security
seo_description:
toc: false
---
-# Privacy
+# Privacy and Security
This content is being peer reviewed & formally verified. Check back soon!
From b3909d987ddcf996018ecb9f8d992534a1e3a2d7 Mon Sep 17 00:00:00 2001
From: tuckpuck
Date: Wed, 4 Dec 2024 21:33:04 +0100
Subject: [PATCH 019/111] standardize spelling
---
pages/dapps/what_is_a_dapp.mdx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pages/dapps/what_is_a_dapp.mdx b/pages/dapps/what_is_a_dapp.mdx
index d7447c54..0c2397c0 100644
--- a/pages/dapps/what_is_a_dapp.mdx
+++ b/pages/dapps/what_is_a_dapp.mdx
@@ -6,9 +6,9 @@ toc: false
# What is a dApp?
-A decentralized application, or dApp, is any application that runs on a blockchain network. The dApp can execute logic and make transactions on the blockchain using a smart contract. Smart contract are pieces of unchangable code forged the Cardano blockchain that execute once conditions are met. Dapps provide services and utilities within the Cardano economy. Because of open the nature of blockhain, all Cardano users should enjoy equal access when using decentralized applications.
+A decentralized application, or dApp, is any application that runs on a blockchain network. The dApp can execute logic and make transactions on the blockchain using a smart contract. Smart contract are pieces of unchangeable code forged the Cardano blockchain that execute once conditions are met. Dapps provide services and utilities within the Cardano economy. Because of open the nature of blockchain, all Cardano users should enjoy equal access when using decentralized applications.
-## Common Types of DApps
+## Common Types of dApps
**Decentralized Exchange (DEX)**: Facilitates peer-to-peer trading of cryptocurrencies, eliminating intermediaries to offer users greater autonomy and transparency in transactions.
From 9ae40c55bb6cb0def30cb3509284d245612b7897 Mon Sep 17 00:00:00 2001
From: tuckpuck
Date: Thu, 5 Dec 2024 09:20:10 +0100
Subject: [PATCH 020/111] make "Other ..." page titles consistent
---
pages/on_chain_metrics/_meta.json | 4 ++--
.../{other_metrics.mdx => other_on_chain_metrics.mdx} | 4 ++--
pages/staking/_meta.json | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
rename pages/on_chain_metrics/{other_metrics.mdx => other_on_chain_metrics.mdx} (89%)
diff --git a/pages/on_chain_metrics/_meta.json b/pages/on_chain_metrics/_meta.json
index 9118f5b5..055a5791 100644
--- a/pages/on_chain_metrics/_meta.json
+++ b/pages/on_chain_metrics/_meta.json
@@ -79,8 +79,8 @@
"pagination": false
}
},
- "other_metrics": {
- "title": "Other Metrics ",
+ "other_on_chain_metrics": {
+ "title": "Other On-Chain Metrics ",
"theme": {
"breadcrumb": true,
"sidebar": true,
diff --git a/pages/on_chain_metrics/other_metrics.mdx b/pages/on_chain_metrics/other_on_chain_metrics.mdx
similarity index 89%
rename from pages/on_chain_metrics/other_metrics.mdx
rename to pages/on_chain_metrics/other_on_chain_metrics.mdx
index 64f32323..69d477c8 100644
--- a/pages/on_chain_metrics/other_metrics.mdx
+++ b/pages/on_chain_metrics/other_on_chain_metrics.mdx
@@ -1,10 +1,10 @@
---
-seo_title: Other Metrics
+seo_title: Other On-Chain Metrics
seo_description:
toc: false
---
-# Other Metrics
+# Other On-Chain Metrics
This content is being peer reviewed & formally verified. Check back soon!
diff --git a/pages/staking/_meta.json b/pages/staking/_meta.json
index d97650c9..8b1f0e4b 100644
--- a/pages/staking/_meta.json
+++ b/pages/staking/_meta.json
@@ -110,7 +110,7 @@
}
},
"other_staking_tools": {
- "title": "Other Tools ",
+ "title": "Other Staking Tools ",
"theme": {
"breadcrumb": true,
"sidebar": true,
From dfb6e576291d01f34f3f7d231e200cc280291ab8 Mon Sep 17 00:00:00 2001
From: tuckpuck
Date: Thu, 5 Dec 2024 09:30:47 +0100
Subject: [PATCH 021/111] remove multisig page, content will go on Wallets page
instead
---
pages/daos/_meta.json | 10 ----------
pages/daos/multisig.mdx | 18 ------------------
2 files changed, 28 deletions(-)
delete mode 100644 pages/daos/multisig.mdx
diff --git a/pages/daos/_meta.json b/pages/daos/_meta.json
index 6a9773e8..e47d06ff 100644
--- a/pages/daos/_meta.json
+++ b/pages/daos/_meta.json
@@ -28,15 +28,5 @@
"footer": true,
"pagination": false
}
- },
- "multisig": {
- "title": "Multisig ",
- "theme": {
- "breadcrumb": true,
- "sidebar": true,
- "toc": true,
- "footer": true,
- "pagination": false
- }
}
}
diff --git a/pages/daos/multisig.mdx b/pages/daos/multisig.mdx
deleted file mode 100644
index 7c8c0c72..00000000
--- a/pages/daos/multisig.mdx
+++ /dev/null
@@ -1,18 +0,0 @@
----
-seo_title: Multisig
-seo_description:
-toc: false
----
-
-# Multisig
-
-This content is being peer reviewed & formally verified. Check back soon!
-
-In the meantime, explore other Cardano collections:
-
-- [YouTube Channels](https://www.adastack.io/community/youtube)
-- [Development Firms](https://www.adastack.io/development/dev_teams)
-- [Newsletters](https://www.adastack.io/community/newsletters)
-- [News and Blogs](https://www.adastack.io/community/news_and_blogs)
-
-[Back to Full Library →](https://www.adastack.io/all_pages)
From 567e287bf0070882277d633471ba16c06633a7fd Mon Sep 17 00:00:00 2001
From: tuckpuck
Date: Thu, 5 Dec 2024 09:54:04 +0100
Subject: [PATCH 022/111] rename Sidechains to Partner Chains, update related
content, create redirect
---
next.config.js | 5 ++
pages/_meta.json | 4 +-
pages/all_pages.mdx | 4 +-
pages/partner_chains/_meta.json | 32 ++++++++++
.../cardano_partner_chains.mdx} | 0
.../partner_chain_explorers.mdx} | 4 +-
.../what_are_partner_chains.mdx} | 4 +-
pages/sidechains/_meta.json | 62 -------------------
pages/sidechains/midnight.mdx | 18 ------
pages/sidechains/milkomeda.mdx | 18 ------
pages/sidechains/singularitynet.mdx | 18 ------
11 files changed, 45 insertions(+), 124 deletions(-)
create mode 100644 pages/partner_chains/_meta.json
rename pages/{sidechains/other_sidechains.mdx => partner_chains/cardano_partner_chains.mdx} (100%)
rename pages/{sidechains/world_mobile.mdx => partner_chains/partner_chain_explorers.mdx} (89%)
rename pages/{sidechains/what_are_sidechains.mdx => partner_chains/what_are_partner_chains.mdx} (95%)
delete mode 100644 pages/sidechains/_meta.json
delete mode 100644 pages/sidechains/midnight.mdx
delete mode 100644 pages/sidechains/milkomeda.mdx
delete mode 100644 pages/sidechains/singularitynet.mdx
diff --git a/next.config.js b/next.config.js
index 49a3b62b..5ec96ae9 100644
--- a/next.config.js
+++ b/next.config.js
@@ -20,6 +20,11 @@ module.exports = withNextra({
destination: "/development/dev_teams", // new URL
permanent: true, // permanent 308
},
+ {
+ source: "/sidechains/what_are_sidechains", // old URL
+ destination: "/partner_chains/what_are_partner_chains", // new URL
+ permanent: true, // permanent 308
+ },
];
},
diff --git a/pages/_meta.json b/pages/_meta.json
index ba3583fc..5c3f5c70 100644
--- a/pages/_meta.json
+++ b/pages/_meta.json
@@ -142,8 +142,8 @@
"pagination": false
}
},
- "sidechains": {
- "title": "Sidechains",
+ "partner_chains": {
+ "title": "Partner Chains",
"theme": {
"breadcrumb": true,
"sidebar": true,
diff --git a/pages/all_pages.mdx b/pages/all_pages.mdx
index 34be01e2..c6b216b0 100644
--- a/pages/all_pages.mdx
+++ b/pages/all_pages.mdx
@@ -77,9 +77,9 @@ Explore guides, projects, and tools in the Cardano ecosystem. 🌎🌍🌏
- [Network Activity](https://www.adastack.io/on_chain_metrics/network_activity)
- [Decentralization Metrics](https://www.adastack.io/on_chain_metrics/decentralization_metrics)
-#### Sidechains
+#### Partner Chains
-- [What are Sidechains?](https://www.adastack.io/sidechains/what_are_sidechains)
+- [What are Partner Chains?](https://www.adastack.io/partner_chains/what_are_partner_chains)
#### Layer 2s
diff --git a/pages/partner_chains/_meta.json b/pages/partner_chains/_meta.json
new file mode 100644
index 00000000..68dab5c0
--- /dev/null
+++ b/pages/partner_chains/_meta.json
@@ -0,0 +1,32 @@
+{
+ "what_are_partner_chains": {
+ "title": "What are Partner Chains?",
+ "theme": {
+ "breadcrumb": true,
+ "sidebar": true,
+ "toc": true,
+ "footer": true,
+ "pagination": false
+ }
+ },
+ "partner_chain_explorers": {
+ "title": "Partner Chain Explorers ",
+ "theme": {
+ "breadcrumb": true,
+ "sidebar": true,
+ "toc": true,
+ "footer": true,
+ "pagination": false
+ }
+ },
+ "cardano_partner_chains": {
+ "title": "All Partner Chains ",
+ "theme": {
+ "breadcrumb": true,
+ "sidebar": true,
+ "toc": true,
+ "footer": true,
+ "pagination": false
+ }
+ }
+}
diff --git a/pages/sidechains/other_sidechains.mdx b/pages/partner_chains/cardano_partner_chains.mdx
similarity index 100%
rename from pages/sidechains/other_sidechains.mdx
rename to pages/partner_chains/cardano_partner_chains.mdx
diff --git a/pages/sidechains/world_mobile.mdx b/pages/partner_chains/partner_chain_explorers.mdx
similarity index 89%
rename from pages/sidechains/world_mobile.mdx
rename to pages/partner_chains/partner_chain_explorers.mdx
index 1aad3b7b..7f484be5 100644
--- a/pages/sidechains/world_mobile.mdx
+++ b/pages/partner_chains/partner_chain_explorers.mdx
@@ -1,10 +1,10 @@
---
-seo_title: World Mobile
+seo_title: Partner Chain Explorers
seo_description:
toc: false
---
-# World Mobile
+# Partner Chain Explorers
This content is being peer reviewed & formally verified. Check back soon!
diff --git a/pages/sidechains/what_are_sidechains.mdx b/pages/partner_chains/what_are_partner_chains.mdx
similarity index 95%
rename from pages/sidechains/what_are_sidechains.mdx
rename to pages/partner_chains/what_are_partner_chains.mdx
index 5548671f..68fab1cf 100644
--- a/pages/sidechains/what_are_sidechains.mdx
+++ b/pages/partner_chains/what_are_partner_chains.mdx
@@ -1,10 +1,10 @@
---
-seo_title: What are Sidechains?
+seo_title: What are Partner Chains?
seo_description: Sidechains are separate blockchains that connect to Cardano. They enable fast transactions, low fees, custom features, scalability, and interoperability.
toc: false
---
-# What are Sidechains?
+# What are Partner Chains?
Sidechains are separate blockchains that connect with Cardano. They enable unique blockchains to connect together. Users can transfer digital assets securely between these linked networks.
diff --git a/pages/sidechains/_meta.json b/pages/sidechains/_meta.json
deleted file mode 100644
index 59d5e54b..00000000
--- a/pages/sidechains/_meta.json
+++ /dev/null
@@ -1,62 +0,0 @@
-{
- "what_are_sidechains": {
- "title": "What are Sidechains?",
- "theme": {
- "breadcrumb": true,
- "sidebar": true,
- "toc": true,
- "footer": true,
- "pagination": false
- }
- },
- "midnight": {
- "title": "Midnight ",
- "theme": {
- "breadcrumb": true,
- "sidebar": true,
- "toc": true,
- "footer": true,
- "pagination": false
- }
- },
- "world_mobile": {
- "title": "World Mobile ",
- "theme": {
- "breadcrumb": true,
- "sidebar": true,
- "toc": true,
- "footer": true,
- "pagination": false
- }
- },
- "singularitynet": {
- "title": "SingularityNet ",
- "theme": {
- "breadcrumb": true,
- "sidebar": true,
- "toc": true,
- "footer": true,
- "pagination": false
- }
- },
- "milkomeda": {
- "title": "Milkomeda ",
- "theme": {
- "breadcrumb": true,
- "sidebar": true,
- "toc": true,
- "footer": true,
- "pagination": false
- }
- },
- "other_sidechains": {
- "title": "Other Sidechains ",
- "theme": {
- "breadcrumb": true,
- "sidebar": true,
- "toc": true,
- "footer": true,
- "pagination": false
- }
- }
-}
diff --git a/pages/sidechains/midnight.mdx b/pages/sidechains/midnight.mdx
deleted file mode 100644
index 3389b000..00000000
--- a/pages/sidechains/midnight.mdx
+++ /dev/null
@@ -1,18 +0,0 @@
----
-seo_title: Midnight
-seo_description:
-toc: false
----
-
-# Midnight
-
-This content is being peer reviewed & formally verified. Check back soon!
-
-In the meantime, explore other Cardano collections:
-
-- [YouTube Channels](https://www.adastack.io/community/youtube)
-- [Development Firms](https://www.adastack.io/development/dev_teams)
-- [Newsletters](https://www.adastack.io/community/newsletters)
-- [News and Blogs](https://www.adastack.io/community/news_and_blogs)
-
-[Back to Full Library →](https://www.adastack.io/all_pages)
diff --git a/pages/sidechains/milkomeda.mdx b/pages/sidechains/milkomeda.mdx
deleted file mode 100644
index efcac58a..00000000
--- a/pages/sidechains/milkomeda.mdx
+++ /dev/null
@@ -1,18 +0,0 @@
----
-seo_title: Milkomeda
-seo_description:
-toc: false
----
-
-# Milkomeda
-
-This content is being peer reviewed & formally verified. Check back soon!
-
-In the meantime, explore other Cardano collections:
-
-- [YouTube Channels](https://www.adastack.io/community/youtube)
-- [Development Firms](https://www.adastack.io/development/dev_teams)
-- [Newsletters](https://www.adastack.io/community/newsletters)
-- [News and Blogs](https://www.adastack.io/community/news_and_blogs)
-
-[Back to Full Library →](https://www.adastack.io/all_pages)
diff --git a/pages/sidechains/singularitynet.mdx b/pages/sidechains/singularitynet.mdx
deleted file mode 100644
index 494b4c9f..00000000
--- a/pages/sidechains/singularitynet.mdx
+++ /dev/null
@@ -1,18 +0,0 @@
----
-seo_title: SingularityNet
-seo_description:
-toc: false
----
-
-# SingularityNet
-
-This content is being peer reviewed & formally verified. Check back soon!
-
-In the meantime, explore other Cardano collections:
-
-- [YouTube Channels](https://www.adastack.io/community/youtube)
-- [Development Firms](https://www.adastack.io/development/dev_teams)
-- [Newsletters](https://www.adastack.io/community/newsletters)
-- [News and Blogs](https://www.adastack.io/community/news_and_blogs)
-
-[Back to Full Library →](https://www.adastack.io/all_pages)
From e2b1c3b6abccbb3991ebd2ce9979b4d28ebe19d4 Mon Sep 17 00:00:00 2001
From: tuckpuck
Date: Thu, 5 Dec 2024 11:49:03 +0100
Subject: [PATCH 023/111] add builder team
---
pages/api/open_source_builders.ts | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/pages/api/open_source_builders.ts b/pages/api/open_source_builders.ts
index 195228a9..2c4f0b3e 100644
--- a/pages/api/open_source_builders.ts
+++ b/pages/api/open_source_builders.ts
@@ -1201,6 +1201,12 @@ export const openSourceBuildersData = [
teamGithubURL: "https://github.com/cardano-mercury",
tags: ["dApp"],
},
+ {
+ name: "Paideia",
+ website: "https://www.paideia.im/",
+ teamGithubURL: "https://github.com/paideiadao/",
+ tags: ["Tools"],
+ },
];
export default function handler(req: NextApiRequest, res: NextApiResponse) {
From 576301f0c3e5420dd7ff184fa2b607827c955120 Mon Sep 17 00:00:00 2001
From: tuckpuck
Date: Thu, 5 Dec 2024 15:10:45 +0100
Subject: [PATCH 024/111] expand intro section of pool_monitoring_tools
---
pages/staking/pool_monitoring_tools.mdx | 45 ++++++++++++++++---------
1 file changed, 30 insertions(+), 15 deletions(-)
diff --git a/pages/staking/pool_monitoring_tools.mdx b/pages/staking/pool_monitoring_tools.mdx
index 5e87dc31..4ba09631 100644
--- a/pages/staking/pool_monitoring_tools.mdx
+++ b/pages/staking/pool_monitoring_tools.mdx
@@ -5,26 +5,40 @@ toc: false
---
# Stake Pool Monitoring Tools
-Stake pools require ongoing monitoring to ensure they are always performing well. These tools help stake pool operators (SPOs) manage, troubleshoot, and optimize their pools on Cardano.
-### Monitoring your Stake Pool independently
+Stake pools benefit from ongoing monitoring to ensure they always perform well. These tools help stake pool operators (SPOs) manage, troubleshoot, and optimize their pools on Cardano.
-Although a bit time-consuming to setup initially, an independent solution to monitoring key metrics for your Stake Pool is something to be . Cardano-node outputs a number of useful metrics to Prometheus, and these can be captured and visualized via Grafana.
+### Monitoring with Prometheus and Grafana
-Both Prometheus and Grafana are very powerful tool stacks in active development, supported by easy-to-follow and up-to-date documentation.
+Prometheus and Grafana combined is the primary way to way to capture and visualize stake pool metrics on Cardano.
-Note that Grafana Cloud is free to use if the number of metrics is low enough. This is almost always the case for a Cardano Stake Pool. The on-call stack is also very helpful.
+**Prometheus** is a data tool that gathers and stores metrics from Cardano nodes including performance, network status, and system resources.
-* [Prometheus](https://prometheus.io/)
- [Getting started with Prometheus](https://prometheus.io/docs/prometheus/latest/getting_started/)
- [Sending metrics to Grafana Cloud](https://grafana.com/docs/grafana-cloud/send-data/metrics/metrics-prometheus/)
-- [Grafana](https://developers.cardano.org/docs/operate-a-stake-pool/grafana-dashboard-tutorial/)
- - [https://github.com/grafana/](https://github.com/grafana/)
- - [Grafana Labs](https://grafana.com/)
- - [Grafana alert manager and on-call stack](https://grafana.com/products/cloud/oncall/)
-- [Armada Alliance Grafana Dashboards](https://github.com/armada-alliance/dashboards)
- - [https://github.com/armada-alliance](https://github.com/armada-alliance)
-### Third Party tools
+**Grafana** is a visualization platform that creates interactive dashboards using the data collected by Prometheus.
+
+Both are in active development, supported by easy-to-follow and up-to-date documentation. Note that Grafana Cloud is free to use if the number of metrics is low enough. This is almost always the case for a Cardano Stake Pool. Grafana also provides notification features with their OnCall service.
+
+- [Prometheus](https://prometheus.io/)
+ - [Getting started with Prometheus](https://prometheus.io/docs/prometheus/latest/getting_started/)
+ - [Installing Prometheus for Cardano](https://cardano-course.gitbook.io/cardano-course/handbook/monitoring-our-nodes)
+ - [Send metrics to Grafana Cloud](https://grafana.com/docs/grafana-cloud/send-data/metrics/metrics-prometheus/)
+- [Grafana](https://grafana.com/)
+ - [Grafana Dashboard Tutorial](https://developers.cardano.org/docs/operate-a-stake-pool/grafana-dashboard-tutorial/)
+ - [Improve Grafana Security](https://developers.cardano.org/docs/operate-a-stake-pool/improve-grafana-security/)
+ - [Grafana OnCall for Notifications](https://grafana.com/products/cloud/oncall/)
+
+**Full Setup Guides**
+- [CoinCashew Installing Prometheus and Grafana](https://www.coincashew.com/coins/overview-ada/guide-how-to-build-a-haskell-stakepool-node/part-iii-operation/setting-up-dashboards)
+- [Guild Operators Monitoring Guide](https://cardano-community.github.io/guild-operators/Appendix/monitoring/?h=promet)
+- [EDEN Prometheus and Grafana Video Tutorial](https://youtu.be/oImqk-eubfs)
+- [Monitoring blockchain node with Prometheus and Grafana](https://www.youtube.com/watch?v=opSlGGa6lLg)
+
+**Grafana Dashboards**
+ - [Armada Alliance Grafana Dashboards](https://github.com/armada-alliance/dashboards)
+ - [Kirael Grafana Dashboard](https://github.com/Kirael12/Cardano-Grafana-Dashboards)
+ - [Carpool Grafana Dashboard](https://github.com/CardenPool/Cardano-Stake-Pool-Grafana-Dashboard)
+
+### Other Monitoring Tools
Please note that these tools might no longer be in development. Exposing Stake Pool metrics should be done with care, DYOR.
@@ -58,6 +72,7 @@ Please note that these tools might no longer be in development. Exposing Stake P
- [Cardano Node Audit](https://github.com/Kirael12/cardano-node-audit)
- [https://github.com/Kirael12/](https://github.com/Kirael12/)
+
### More information
* Get started with CNtools
From 9aca481f6fc1b73ac48dfd96435399aca4af4f54 Mon Sep 17 00:00:00 2001
From: tuckpuck
Date: Thu, 5 Dec 2024 16:28:00 +0100
Subject: [PATCH 025/111] create OSS component badge and add OSS and
descriptions to Stake Monitoring Tools
---
assets/icons/oss.svg | 2 +-
components/badges/OSS.tsx | 15 +++++++
pages/staking/pool_monitoring_tools.mdx | 56 ++++++++++---------------
3 files changed, 37 insertions(+), 36 deletions(-)
create mode 100644 components/badges/OSS.tsx
diff --git a/assets/icons/oss.svg b/assets/icons/oss.svg
index 3c7642e6..99d1f83a 100644
--- a/assets/icons/oss.svg
+++ b/assets/icons/oss.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/components/badges/OSS.tsx b/components/badges/OSS.tsx
new file mode 100644
index 00000000..11cdd983
--- /dev/null
+++ b/components/badges/OSS.tsx
@@ -0,0 +1,15 @@
+import { OSIcon } from '../../assets/icons'
+
+const OSS = ({ repoURL, className }) => {
+ if (!repoURL) return null;
+
+ return (
+
+
+
+
+
+ );
+}
+
+export default OSS;
diff --git a/pages/staking/pool_monitoring_tools.mdx b/pages/staking/pool_monitoring_tools.mdx
index 4ba09631..46787d66 100644
--- a/pages/staking/pool_monitoring_tools.mdx
+++ b/pages/staking/pool_monitoring_tools.mdx
@@ -3,12 +3,13 @@ seo_title: Stake Pool Monitoring Tools
seo_description:
toc: false
---
+import OSS from '../../components/badges/OSS.tsx'
# Stake Pool Monitoring Tools
Stake pools benefit from ongoing monitoring to ensure they always perform well. These tools help stake pool operators (SPOs) manage, troubleshoot, and optimize their pools on Cardano.
-### Monitoring with Prometheus and Grafana
+### Prometheus and Grafana Stake Pool Monitoring
Prometheus and Grafana combined is the primary way to way to capture and visualize stake pool metrics on Cardano.
@@ -18,11 +19,11 @@ Prometheus and Grafana combined is the primary way to way to capture and visuali
Both are in active development, supported by easy-to-follow and up-to-date documentation. Note that Grafana Cloud is free to use if the number of metrics is low enough. This is almost always the case for a Cardano Stake Pool. Grafana also provides notification features with their OnCall service.
-- [Prometheus](https://prometheus.io/)
+- [Prometheus](https://prometheus.io/)
- [Getting started with Prometheus](https://prometheus.io/docs/prometheus/latest/getting_started/)
- [Installing Prometheus for Cardano](https://cardano-course.gitbook.io/cardano-course/handbook/monitoring-our-nodes)
- [Send metrics to Grafana Cloud](https://grafana.com/docs/grafana-cloud/send-data/metrics/metrics-prometheus/)
-- [Grafana](https://grafana.com/)
+- [Grafana](https://grafana.com/)
- [Grafana Dashboard Tutorial](https://developers.cardano.org/docs/operate-a-stake-pool/grafana-dashboard-tutorial/)
- [Improve Grafana Security](https://developers.cardano.org/docs/operate-a-stake-pool/improve-grafana-security/)
- [Grafana OnCall for Notifications](https://grafana.com/products/cloud/oncall/)
@@ -31,47 +32,32 @@ Both are in active development, supported by easy-to-follow and up-to-date docum
- [CoinCashew Installing Prometheus and Grafana](https://www.coincashew.com/coins/overview-ada/guide-how-to-build-a-haskell-stakepool-node/part-iii-operation/setting-up-dashboards)
- [Guild Operators Monitoring Guide](https://cardano-community.github.io/guild-operators/Appendix/monitoring/?h=promet)
- [EDEN Prometheus and Grafana Video Tutorial](https://youtu.be/oImqk-eubfs)
-- [Monitoring blockchain node with Prometheus and Grafana](https://www.youtube.com/watch?v=opSlGGa6lLg)
+- [CodiLime Monitoring Node with Prometheus and Grafana Video](https://www.youtube.com/watch?v=opSlGGa6lLg)
**Grafana Dashboards**
- [Armada Alliance Grafana Dashboards](https://github.com/armada-alliance/dashboards)
- [Kirael Grafana Dashboard](https://github.com/Kirael12/Cardano-Grafana-Dashboards)
- [Carpool Grafana Dashboard](https://github.com/CardenPool/Cardano-Stake-Pool-Grafana-Dashboard)
-### Other Monitoring Tools
+### Other Stake Pool Monitoring Tools
Please note that these tools might no longer be in development. Exposing Stake Pool metrics should be done with care, DYOR.
-- [Watchtower Tools](https://watchtower.tools/): Mobile app for SPOs and bring all useful metrics together and has push notifications.
-
- - [https://github.com/bkvpool](https://github.com/bkvpool)
-- [RT View](https://github.com/IntersectMBO/cardano-node/blob/master/cardano-tracer/docs/cardano-rtview.md/) [https://docs.cardano.org/cardano-components/cardano-rtview/](https://docs.cardano.org/cardano-components/cardano-rtview/)
-
- - [https://github.com/IntersectMBO](https://github.com/IntersectMBO)
-- [Jormanager](https://bitbucket.org/muamw10/jormanager/src/develop/)
-
- - [https://bitbucket.org/muamw10/](https://bitbucket.org/muamw10/)
-- [Nview](https://github.com/blinklabs-io/nview)
-
- - [https://github.com/blinklabs-io](https://github.com/blinklabs-io)
-- [CNTools](https://cardano-community.github.io/guild-operators/Scripts/cntools/)
-
- - [https://github.com/cardano-community](https://github.com/cardano-community)
-- [Cardano Light Tools](https://github.com/orpheus-antpool/cardano-light-tools)
-
- - [https://github.com/orpheus-antpool](https://github.com/orpheus-antpool)
-- [gLiveView](https://developers.cardano.org/docs/operate-a-stake-pool/monitoring-gliveview/): A script that displays live information about the node and the network, such as CPU usage, memory usage, slot number, epoch number, block height, and peers. It also shows the status of the stake pool, such as active stake, live stake, rewards, and performance.
-
- - No Github
-- [Cncli](https://github.com/cardano-community/cncli): A community-built command-line tool for interacting with the Cardano node. It provides features such as syncing the ledger state, calculating the leader schedule, sending tip information to pooltool.io, and generating pool reports.
-
- - [https://github.com/cardano-community](https://github.com/cardano-community)
-- [Pool.vet](https://pool.vet/): See if your Cardano stake pool is working or find out why it might not be.
-
- - No Github
-- [Cardano Node Audit](https://github.com/Kirael12/cardano-node-audit)
-
- - [https://github.com/Kirael12/](https://github.com/Kirael12/)
+- [RT View](https://github.com/IntersectMBO/cardano-node/blob/master/cardano-tracer/docs/cardano-rtview.md/) : RTView is an optional part of cardano-tracer service. It is a real-time monitoring tool for Cardano nodes (RTView is an abbreviation for "Real Time View"). It provides an interactive web page where you can see different kinds of information about connected nodes.
+
+- [Nview](https://github.com/blinklabs-io/nview) : Provides a TUI (terminal user interface) of a running node from the command line.
+
+- [Koios gLiveView](https://developers.cardano.org/docs/operate-a-stake-pool/monitoring-gliveview/): A script that displays live information about the node and the network, such as CPU usage, memory usage, slot number, epoch number, block height, and peers. It also shows the status of the stake pool, such as active stake, live stake, rewards, and performance.
+
+- [Cardano Light Tools](https://github.com/orpheus-antpool/cardano-light-tools) : Provides a simple monitoring script that logs relevant metrics directly into a text file in human-readable form.
+-
+- [Cardano Node Audit](https://github.com/Kirael12/cardano-node-audit) : CLI Tool to check the health of a stake pool.
+
+- [Jormanager](https://bitbucket.org/muamw10/jormanager/wiki/Home)
+
+- [Pool.vet](https://pool.vet/): Website to check if your Cardano stake pool is working and identify issues.
+
+
### More information
From 31d59cde918f7a56d8be72e633caf7fae036e039 Mon Sep 17 00:00:00 2001
From: tuckpuck
Date: Fri, 6 Dec 2024 15:20:37 +0100
Subject: [PATCH 026/111] improve content and add more OSS badges
---
pages/staking/pool_monitoring_tools.mdx | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/pages/staking/pool_monitoring_tools.mdx b/pages/staking/pool_monitoring_tools.mdx
index 46787d66..9183e812 100644
--- a/pages/staking/pool_monitoring_tools.mdx
+++ b/pages/staking/pool_monitoring_tools.mdx
@@ -50,23 +50,16 @@ Please note that these tools might no longer be in development. Exposing Stake P
- [Koios gLiveView](https://developers.cardano.org/docs/operate-a-stake-pool/monitoring-gliveview/): A script that displays live information about the node and the network, such as CPU usage, memory usage, slot number, epoch number, block height, and peers. It also shows the status of the stake pool, such as active stake, live stake, rewards, and performance.
- [Cardano Light Tools](https://github.com/orpheus-antpool/cardano-light-tools) : Provides a simple monitoring script that logs relevant metrics directly into a text file in human-readable form.
--
+
- [Cardano Node Audit](https://github.com/Kirael12/cardano-node-audit) : CLI Tool to check the health of a stake pool.
- [Jormanager](https://bitbucket.org/muamw10/jormanager/wiki/Home)
- [Pool.vet](https://pool.vet/): Website to check if your Cardano stake pool is working and identify issues.
-
-
### More information
-* Get started with CNtools
- * [https://developers.cardano.org/docs/operate-a-stake-pool/guild-ops-suite/](https://developers.cardano.org/docs/operate-a-stake-pool/guild-ops-suite/)
-* Monitoring your nodes
- * [https://docs.cardano.org/development-guidelines/node-monitoring/](https://docs.cardano.org/development-guidelines/node-monitoring/)
-* Basic Pool checklists
- * [https://blockchainlens.gitbook.io/cardano-spot-check](https://blockchainlens.gitbook.io/cardano-spot-check)
-* About Guild Operators
- * [https://cardano-community.github.io/guild-operators/build/](https://cardano-community.github.io/guild-operators/build/)
-[Back to Full Library →](https://www.adastack.io/all_pages)
+- [Cardano Spot Check Guide](https://blockchainlens.gitbook.io/cardano-spot-check/basic-checks/advanced)
+- [Cardano Docs: Stake Pool Monitoring](https://docs.cardano.org/stake-pool-operators/monitoring/)
+- [Cardano Developer Docs: Operator Tools](https://github.com/cardano-foundation/developer-portal)
+- [Guild Operators Tools](https://cardano-community.github.io/guild-operators/build/)
From f05ee6ac7e7f0b077a8a5c751ca3fb94e8c2186f Mon Sep 17 00:00:00 2001
From: tuckpuck
Date: Fri, 6 Dec 2024 18:50:37 +0100
Subject: [PATCH 027/111] add 'not maintained' note to Lucid, and re-order by
stars
---
pages/development/code_libraries.mdx | 172 +++++++++++++--------------
1 file changed, 86 insertions(+), 86 deletions(-)
diff --git a/pages/development/code_libraries.mdx b/pages/development/code_libraries.mdx
index a61bc472..ec8a6afb 100644
--- a/pages/development/code_libraries.mdx
+++ b/pages/development/code_libraries.mdx
@@ -12,7 +12,7 @@ Libraries to connect to the Cardano blockchain and build applications.
Off-chain libraries provide abstractions for developers to build transactions and submit them on the Cardano blockchain. These libraries enable connecting to a node, querying the blockchain, asset transfer, and interaction with smart contracts.
-#### Lucid
+#### Lucid [Not Maintained]
Lucid is a library to build Cardano transactions and write off-chain code in JavaScript and Typescript. It is designed for simplicity, allowing developers to describe actions at a high level.
@@ -63,25 +63,26 @@ Mesh is a Cardano off-chain framework that provides cardano-cli like transaction
-#### Cardano-js-sdk
+#### PyCardano
-Cardano-js-sdk is a JavaScript toolkit to build applications that interact with the Cardano blockchain. It provides a set of tools and functions for wallets, keys, transactions, and more.
+PyCardano is a lightweight, standalone Cardano client library written in Python. It enables developers to create and sign transactions on the Cardano blockchain without relying on third-party serialization tools.
-- [Cardano-js-sdk GitHub](https://github.com/input-output-hk/cardano-js-sdk)
-- [Cardano-js-sdk Documentation](https://input-output-hk.github.io/cardano-js-sdk/)
-- [Cardano-js-sdk Getting Started](https://github.com/input-output-hk/cardano-js-sdk/blob/master/GETTING_STARTED.md)
-- [IOG Technical Community Discord](https://discord.gg/inputoutput)
+- [PyCardano GitHub](https://github.com/Python-Cardano/pycardano)
+- [PyCardano Documentation](https://pycardano.readthedocs.io/en/latest/)
+- [Awesome PyCardano](https://github.com/B3nac/awesome-pycardano)
+- [PyCardano Discord](https://discord.gg/MazZyMPjC6)
+- [TxPipe Discord](https://discord.gg/sJ2D3g33Qp): Pycardano channel
-
+
@@ -89,26 +90,25 @@ Cardano-js-sdk is a JavaScript toolkit to build applications that interact with
-#### Lucid Evolution
-
-Lucid Evolution is a TypeScript library derived from the popular Lucid library. Lucid Evolution is actively maintained with a focus on type safety, scalability, and effective side-effect management.
-
-- [Lucid Evolution GitHub](https://github.com/Anastasia-Labs/lucid-evolution)
-- [Lucid Evolution Documentation](https://anastasia-labs.github.io/lucid-evolution)
-- [Lucid Evolution Catalyst Proposal](https://www.lidonation.com/index.php/en/proposals/anastasia-labs-lucid-evolution-redefining-off-chain-transactions-in-cardano-f11)
-
-
-
-
-
-
-
-
-
-
#### Cardano-transactions
Haskell library utilities for constructing and signing Cardano transactions. The library also includes a small command-line interface for transaction creation in the terminal.
@@ -531,22 +531,22 @@ SC-Tools is a collection of Haskell libraries for building Cardano applications
-#### CAB
+#### Cardano-C
-CAB (Cardano Application Backend) is a TypeScript library with a suite of tools including wallet and account management, custom blockchain data sources, cryptographic utilities, and CIP-30 dApp connector helpers.
+Cardano-C is a C library designed for building transactions and interacting with the Cardano blockchain. It is compliant with MISRA standards.
-- [CAB GitHub](https://github.com/WingRiders/cab)
-- [Wingriders Discord](https://discord.com/invite/t7CdyhK8JA)
+- [Cardano-C GitHub](https://github.com/Biglup/cardano-c)
+- [Cardano-C Documentation](https://cardano-c.readthedocs.io/en/latest/)
-
+
@@ -554,22 +554,22 @@ CAB (Cardano Application Backend) is a TypeScript library with a suite of tools
@@ -53,13 +49,8 @@ Mesh is a Cardano off-chain framework that provides cardano-cli like transaction
class="shields_io_button"
alt="TypeScript Programming Language Badge"
/>
-
-
-
+
+
@@ -80,13 +71,7 @@ PyCardano is a lightweight, standalone Cardano client library written in Python.
alt="Python Programming Language Badge"
/>
-
-
-
+
@@ -106,13 +91,7 @@ Cardano-js-sdk is a JavaScript toolkit to build applications that interact with
alt="TypeScript Programming Language Badge"
/>
-
-
-
+
@@ -130,13 +109,7 @@ Cardano-CLI JS is a TypeScript library that wraps the Cardano-CLI, providing dev
alt="TypeScript Programming Language Badge"
/>
-
-
-
+
@@ -156,13 +129,7 @@ Plu-ts is a TypeScript library designed for building Cardano dApps. It can be us
alt="TypeScript Programming Language Badge"
/>
-
-
-
+
@@ -181,13 +148,7 @@ Cardano Client Lib is a Java library that makes it easy to interact with the Car
alt="Java Programming Language Badge"
/>
-
-
-
+
@@ -206,13 +167,7 @@ CardanoSharp Wallet is a .NET library for creating keys and addresses, managing
alt="C# Programming Language Badge"
/>
-
-
-
+
@@ -231,13 +186,7 @@ Cardano-transaction-lib (CTL) is a Purescript library for building smart contrac
alt="PureScript Programming Language Badge"
/>
-
-
-
+
@@ -255,13 +204,7 @@ gOuroboros is a Go library to build applications interacting with the Cardano bl
alt="Go Programming Language Badge"
/>
-
-
-
+
@@ -280,13 +223,7 @@ Atlas is a Haskell library designed to be an application backend for Plutus smar
alt="Haskell Programming Language Badge"
/>
-
-
-
+
@@ -305,13 +242,7 @@ TyphonJS is a TypeScript library designed for working with the Cardano blockchai
alt="TypeScript Programming Language Badge"
/>
-
-
-
+
@@ -330,13 +261,7 @@ Blaze allows you to create Cardano transactions and off-chain code in TypeScript
alt="TypeScript Programming Language Badge"
/>
-
-
-
+
@@ -355,13 +280,7 @@ Lucid Evolution is a TypeScript library derived from the popular Lucid library.
alt="TypeScript Programming Language Badge"
/>
-
-
-
+
@@ -380,13 +299,7 @@ Kuber is an Haskell library with a user-friendly JSON API to compose transaction
alt="Haskell Programming Language Badge"
/>
-
-
-
+
@@ -406,13 +319,7 @@ CardanoWeb3js is a TypeScript library to integrate with the Cardano blockchain.
alt="TypeScript Programming Language Badge"
/>
-
-
-
+
@@ -428,13 +335,8 @@ Haskell library utilities for constructing and signing Cardano transactions. The
class="shields_io_button"
alt="Haskell Programming Language Badge"
/>
-
-
-
+
+
@@ -451,13 +353,8 @@ Apollo provides Golang building blocks for Cardano including serialization and t
class="shields_io_button"
alt="Go Programming Language Badge"
/>
-
-
-
+
+
@@ -474,13 +371,8 @@ The elm-cardano library is a tool that allows developers to write off-chain code
class="shields_io_button"
alt="Elm Programming Language Badge"
/>
-
-
-
+
+
@@ -498,13 +390,8 @@ A Rust library for easy Cardano transaction building and unit testing. It provid
class="shields_io_button"
alt="Rust Programming Language Badge"
/>
-
-
-
+
+
@@ -521,13 +408,8 @@ SC-Tools is a collection of Haskell libraries for building Cardano applications
class="shields_io_button"
alt="Haskell Programming Language Badge"
/>
-
-
-
+
+
@@ -544,13 +426,8 @@ Cardano-C is a C library designed for building transactions and interacting with
class="shields_io_button"
alt="C Programming Language Badge"
/>
-
-
-
+
+
@@ -567,13 +444,8 @@ CAB (Cardano Application Backend) is a TypeScript library with a suite of tools
class="shields_io_button"
alt="TypeScript Programming Language Badge"
/>
-
-
-
+
+
@@ -590,13 +462,8 @@ This C++ library provide an interfaces to integrate Cardano capabilities into a
class="shields_io_button"
alt="C++ Programming Language Badge"
/>
-
-
-
+
+
@@ -619,13 +486,8 @@ Mesh is a website framework that allows you to integrate new or existing website
class="shields_io_button"
alt="TypeScript Programming Language Badge"
/>
-
-
-
+
+
@@ -643,13 +505,7 @@ JavaScript and TypeScript functions to simplify the dApp development. Provides h
alt="TypeScript Programming Language Badge"
/>
-
-
-
+
@@ -667,13 +523,7 @@ CardanoPress connects a WordPress website to the Cardano blockchain. Features in
alt="PHP Programming Language Badge"
/>
-
-
-
+
@@ -692,13 +542,7 @@ Use-cardano is a react context, hook, and set of components that makes interacti
alt="TypeScript Programming Language Badge"
/>
-
-
-
+
@@ -715,13 +559,7 @@ CardanoSharp Blazor is a component library for C# devs to develop dApps on Carda
alt="C# Programming Language Badge"
/>
-
-
-
+
@@ -739,13 +577,7 @@ Web component for connecting to Cardano wallets. The component provides a button
alt="HTML5 Badge"
/>
-
-
-
+
@@ -763,13 +595,7 @@ Cardano-peer-connect aims to provide simple interfaces to implement CIP-0045 for
alt="TypeScript Programming Language Badge"
/>
-
-
-
+
@@ -787,13 +613,7 @@ Cardano-dApp-JS is a library that with wallet connection and wallet styling.
alt="JavaScript Programming Language Badge"
/>
-
-
-
+
@@ -810,13 +630,7 @@ The Cardano wallet dApp connector library provides components, hooks, and utilit
alt="TypeScript Programming Language Badge"
/>
-
-
-
+
@@ -833,13 +647,7 @@ Cardano-connect is a WordPress plugin providing Cardano Web3 wallet connections
alt="TypeScript Programming Language Badge"
/>
-
-
-
+
@@ -861,13 +669,7 @@ Library that provides essential tools for managing Cardano addresses and mnemoni
alt="Haskell Programming Language Badge"
/>
-
-
-
+
@@ -884,13 +686,7 @@ Command-line interface tool that extends the official Cardano-CLI, providing the
alt="TypeScript Programming Language Badge"
/>
-
-
-
+
@@ -908,13 +704,7 @@ CNCLI (Cardano Node CLI) is a community-developed command-line tool that extends
alt="Rust Programming Language Badge"
/>
-
-
-
+
@@ -932,13 +722,7 @@ A small CLI program to convert to and from bech32 strings. This can be useful wh
alt="Haskell Programming Language Badge"
/>
-
-
-
+
@@ -956,13 +740,7 @@ Cardano-CLI is a core command-line tool for interacting with a Cardano node. It
alt="Haskell Programming Language Badge"
/>
-
-
-
+
@@ -979,13 +757,7 @@ The Cardano Signer library is a versatile tool for signing and verifying using
alt="JavaScript Programming Language Badge"
/>
-
-
-
+
@@ -1003,13 +775,7 @@ Nview is a monitoring tool that gives a view of a running node from the command
alt="Go Programming Language Badge"
/>
-
-
-
+
@@ -1027,13 +793,7 @@ Txtop is a tool to inspect the mempool of a Cardano node, which can be useful to
alt="Go Programming Language Badge"
/>
-
-
-
+
@@ -1051,13 +811,7 @@ Cardano-up is a line utility for managing Cardano services. It allows you to ins
alt="Go Programming Language Badge"
/>
-
-
-
+
@@ -1074,13 +828,7 @@ Command-line version manager for Cardano. Install, uninstall, and update Cardano
alt="Rust Programming Language Badge"
/>
-
-
-
+
@@ -1097,13 +845,7 @@ Gastronomy is a UPLC debugger that allows you to step forward and backward throu
alt="Rust Programming Language Badge"
/>
-
-
-
+
@@ -1120,13 +862,7 @@ Cardano-skepsis-toolbox is a python-based utility designed for interacting with
alt="Python Programming Language Badge"
/>
-
-
-
+
@@ -1148,13 +884,7 @@ The Cardano node is the core component to participate in the Cardano blockchain.
alt="Haskell Programming Language Badge"
/>
-
-
-
+
@@ -1173,13 +903,7 @@ A lightweight bridge between the Cardano node and client applications, enabling
alt="Haskell Programming Language Badge"
/>
-
-
-
+
@@ -1198,13 +922,7 @@ Dolos is a specialized Cardano data node, designed to maintain an up-to-date cop
alt="Rust Programming Language Badge"
/>
-
-
-
+
@@ -1222,13 +940,7 @@ Cardano Node Tests is a library provides system and end-to-end (E2E) tests for c
alt="Python Programming Language Badge"
/>
-
-
-
+
@@ -1247,13 +959,7 @@ Amaru is a Cardano node client written in Rust. It aims to bring more node dive
alt="Rust Programming Language Badge"
/>
-
-
-
+
@@ -1271,13 +977,7 @@ Yaci allows connection and interaction with Cardano nodes directly. The library
alt="Java Programming Language Badge"
/>
-
-
-
+
@@ -1301,13 +1001,7 @@ Cardano-DB-Sync is a tool that continuously syncs the Cardano blockchain with a
alt="Haskell Programming Language Badge"
/>
-
-
-
+
@@ -1326,13 +1020,7 @@ Oura is CLI tool that monitors the Cardano blockchain in real-time. It allows fi
alt="Rust Programming Language Badge"
/>
-
-
-
+
@@ -1350,13 +1038,7 @@ Kupo is a lightweight chain-indexing tool for the Cardano blockchain. It quickly
alt="Haskell Programming Language Badge"
/>
-
-
-
+
@@ -1374,13 +1056,7 @@ Carp is an indexer, built in Rust, that syncs blockchain data into a PostgreSQL
alt="Rust Programming Language Badge"
/>
-
-
-
+
@@ -1398,13 +1074,7 @@ Scrolls is a Rust-based library designed for building and managing read-optimize
alt="Rust Programming Language Badge"
/>
-
-
-
+
@@ -1423,13 +1093,7 @@ Adder is a tool that monitors the Cardano blockchain and emits events as blocks
alt="Go Programming Language Badge"
/>
-
-
-
+
@@ -1447,13 +1111,7 @@ LedgerSync is a Java application for indexing Cardano blockchain data. It reads
alt="Java Programming Language Badge"
/>
-
-
-
+
@@ -1472,13 +1130,7 @@ Yaci Store is a modular indexer library written in Java for the Cardano blockcha
alt="Java Programming Language Badge"
/>
-
-
-
+
@@ -1496,13 +1148,7 @@ Marconi is a lightweight, customizable framework for indexing and querying Carda
alt="Haskell Programming Language Badge"
/>
-
-
-
+
@@ -1519,13 +1165,7 @@ Mafoc is a Haskell framework for developing custom blockchain indexers, using an
alt="Haskell Programming Language Badge"
/>
-
-
-
+
@@ -1542,13 +1182,7 @@ Argus is a .NET library that simplifies indexing that provides a framework. It p
alt="C# Programming Language Badge"
/>
-
-
-
+
@@ -1570,13 +1204,7 @@ Cardano Serialization Library, written in Rust, serializes and deserializes data
alt="Rust Programming Language Badge"
/>
-
-
-
+
@@ -1594,13 +1222,7 @@ This multi-platform Rust library provides serialization and deserialization of c
alt="Rust Programming Language Badge"
/>
-
-
-
+
@@ -1617,13 +1239,7 @@ Golang library for serialization and deserialization of Cardano data structures.
alt="Go Programming Language Badge"
/>
-
-
-
+
@@ -1645,13 +1261,7 @@ Naumachia is a framework for creating and testing smart contracts that offers a
alt="Rust Programming Language Badge"
/>
-
-
-
+
@@ -1668,13 +1278,7 @@ QuickCheck-dynamic is a Haskell library designed for testing stateful systems, i
alt="Haskell Programming Language Badge"
/>
-
-
-
+
@@ -1691,13 +1295,7 @@ Test and benchmark Plutus Smart Contracts.
alt="Python Programming Language Badge"
/>
-
-
-
+
@@ -1715,13 +1313,7 @@ Vodka is a Cardano development toolkit designed to use with Aiken. It includes u
alt="Gleam Programming Language Badge"
/>
-
-
-
+
@@ -1741,15 +1333,9 @@ The Cardano token registry is where token creators submit verified information a
src="https://img.shields.io/badge/Nix-ffffff?style=flat&logo=nixos&logoColor=5277C3"
class="shields_io_button"
alt="Nix Package Manager Badge"
-/>
+/>
-
-
-
+
@@ -1764,15 +1350,9 @@ The Offchain Data Registry maps dApps to their script addresses. They also maint
src="https://img.shields.io/badge/JSON-ffffff?style=flat&logo=json&logoColor=000000"
class="shields_io_button"
alt="JSON Data Badge"
-/>
+/>
-
-
-
+
@@ -1789,13 +1369,7 @@ A registry maintaining information about dApps on the Cardano blockchain, used b
alt="JavaScript Programming Language Badge"
/>
-
-
-
+
@@ -1814,13 +1388,7 @@ Cardano shield is a registry of known scammers, collected to provide protection
alt="Python Programming Language Badge"
/>
-
-
-
+
@@ -1836,15 +1404,9 @@ Eternl Guard is a repository designed to gather domain names and asset of known
src="https://img.shields.io/badge/JSON-ffffff?style=flat&logo=json&logoColor=000000"
class="shields_io_button"
alt="JSON Data Badge"
-/>
+/>
-
-
-
+
@@ -1862,12 +1424,6 @@ Cardano Scam Token Registry is a list of scam tokens. To find the scam tokens,
alt="Python Programming Language Badge"
/>
-
-
-
+
From 3cb18d4104e1e3da8196cc71ed056ea5fa47bde4 Mon Sep 17 00:00:00 2001
From: tuckpuck
Date: Fri, 6 Dec 2024 20:07:55 +0100
Subject: [PATCH 031/111] rename language badge
---
.../{CodeLanguageShieldIoBadge.tsx => LanguageShieldIo.tsx} | 6 +++---
components/tables/OpenSourceBuildersTable.jsx | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
rename components/badges/shield_io_badges/{CodeLanguageShieldIoBadge.tsx => LanguageShieldIo.tsx} (95%)
diff --git a/components/badges/shield_io_badges/CodeLanguageShieldIoBadge.tsx b/components/badges/shield_io_badges/LanguageShieldIo.tsx
similarity index 95%
rename from components/badges/shield_io_badges/CodeLanguageShieldIoBadge.tsx
rename to components/badges/shield_io_badges/LanguageShieldIo.tsx
index cd0abc2c..1a883258 100644
--- a/components/badges/shield_io_badges/CodeLanguageShieldIoBadge.tsx
+++ b/components/badges/shield_io_badges/LanguageShieldIo.tsx
@@ -1,6 +1,6 @@
import React from "react";
-const CodeLanguageShieldIoBadge = ({ language }) => {
+const LanguageShieldIo = ({ language }) => {
if (!language) return null;
// Convert language name to lowercase and handle special cases
@@ -98,10 +98,10 @@ const CodeLanguageShieldIoBadge = ({ language }) => {
>
);
};
-export default CodeLanguageShieldIoBadge;
+export default LanguageShieldIo;
diff --git a/components/tables/OpenSourceBuildersTable.jsx b/components/tables/OpenSourceBuildersTable.jsx
index e5b922b4..f925e8fb 100644
--- a/components/tables/OpenSourceBuildersTable.jsx
+++ b/components/tables/OpenSourceBuildersTable.jsx
@@ -2,7 +2,7 @@ import React from "react";
import { Table, Tag, Typography, Tooltip, Button, Card, Space } from "antd";
import { StarIcon } from "../../assets/icons";
import TeamGithubBadge from "@components/badges/TeamGithubBadge";
-import CodeLanguageShieldIoBadge from "@components/badges/shield_io_badges/CodeLanguageShieldIoBadge";
+import LanguageShieldIo from "@components/badges/shield_io_badges/LanguageShieldIo";
import Favicon from "@components/badges/Favicon";
import LatestCommitBadge from "@components/badges/LatestCommitBadge";
import MostStarredRepoBadge from "@components/badges/MostStarredRepoBadge";
@@ -53,7 +53,7 @@ const RepoInfoTooltip = ({ repo, children }) => {
>
Stack:
-
+
@@ -44,12 +40,7 @@ Mesh is a Cardano off-chain framework that provides cardano-cli like transaction
- [TxPipe Discord](https://discord.gg/sJ2D3g33Qp): Mesh channel
-
-
+
@@ -65,12 +56,7 @@ PyCardano is a lightweight, standalone Cardano client library written in Python.
- [TxPipe Discord](https://discord.gg/sJ2D3g33Qp): Pycardano channel
-
-
+
@@ -85,12 +71,7 @@ Cardano-js-sdk is a JavaScript toolkit to build applications that interact with
- [IOG Technical Community Discord](https://discord.gg/inputoutput)
-
-
+
@@ -103,12 +84,7 @@ Cardano-CLI JS is a TypeScript library that wraps the Cardano-CLI, providing dev
- [Cardano.org Cardano-cli](https://developers.cardano.org/docs/get-started/cardanocli-js/)
-
-
+
@@ -123,12 +99,7 @@ Plu-ts is a TypeScript library designed for building Cardano dApps. It can be us
- [Harmonic Labs Discord](https://discord.gg/P6fbZSA85f)
-
-
+
@@ -142,12 +113,7 @@ Cardano Client Lib is a Java library that makes it easy to interact with the Car
- [Roasted Bean Alliance Discord](https://discord.com/invite/JtQ54MSw6p)
-
-
+
@@ -161,12 +127,7 @@ CardanoSharp Wallet is a .NET library for creating keys and addresses, managing
- [CardanoSharp Discord](https://discord.com/invite/WRAySDD2Kk)
-
-
+
@@ -180,12 +141,7 @@ Cardano-transaction-lib (CTL) is a Purescript library for building smart contrac
- [Plutonomicon Discord](https://discord.gg/JhbexnV9Pc)
-
-
+
@@ -198,12 +154,7 @@ gOuroboros is a Go library to build applications interacting with the Cardano bl
- [Blink Labs Discord](https://discord.gg/jx9dxarjyv)
-
-
+
@@ -217,12 +168,7 @@ Atlas is a Haskell library designed to be an application backend for Plutus smar
- [GeniusYield Discord](https://discord.gg/TNHf4fs626)
-
-
+
@@ -236,12 +182,7 @@ TyphonJS is a TypeScript library designed for working with the Cardano blockchai
- [Strica Discord](https://discord.com/invite/WQFPHNXcz8)
-
-
+
@@ -255,12 +196,7 @@ Blaze allows you to create Cardano transactions and off-chain code in TypeScript
- [TxPipe Discord](https://discord.gg/sJ2D3g33Qp): Blaze channel
-
-
+
@@ -274,12 +210,7 @@ Lucid Evolution is a TypeScript library derived from the popular Lucid library.
- [Lucid Evolution Catalyst Proposal](https://www.lidonation.com/index.php/en/proposals/anastasia-labs-lucid-evolution-redefining-off-chain-transactions-in-cardano-f11)
-
-
+
@@ -293,12 +224,7 @@ Kuber is an Haskell library with a user-friendly JSON API to compose transaction
- [Kuber Discord](https://discord.gg/xDSmAX6MXC)
-
-
+
@@ -313,12 +239,7 @@ CardanoWeb3js is a TypeScript library to integrate with the Cardano blockchain.
- [Xray Discord](https://discord.gg/zdbYrmxevp)
-
-
+
@@ -330,12 +251,7 @@ Haskell library utilities for constructing and signing Cardano transactions. The
- [Cardano-transactions GitHub](https://github.com/IntersectMBO/cardano-transactions)
-
-
+
@@ -348,12 +264,7 @@ Apollo provides Golang building blocks for Cardano including serialization and t
- [Apollo Discord](https://discord.com/invite/MH4CmJcg49)
-
-
+
@@ -366,12 +277,7 @@ The elm-cardano library is a tool that allows developers to write off-chain code
- [TxPipe Discord](https://discord.gg/sJ2D3g33Qp): Elm channel
-
-
+
@@ -385,12 +291,7 @@ A Rust library for easy Cardano transaction building and unit testing. It provid
- [Whisky Course on Andamio](https://www.andamio.io/course/whisky)
-
-
+
@@ -403,12 +304,7 @@ SC-Tools is a collection of Haskell libraries for building Cardano applications
- [SC-Tools Documentation](https://j-mueller.github.io/sc-tools/)
-
-
+
@@ -421,12 +317,7 @@ Cardano-C is a C library designed for building transactions and interacting with
- [Cardano-C Documentation](https://cardano-c.readthedocs.io/en/latest/)
-
-
+
@@ -439,12 +330,7 @@ CAB (Cardano Application Backend) is a TypeScript library with a suite of tools
- [Wingriders Discord](https://discord.com/invite/t7CdyhK8JA)
-
-
+
@@ -457,12 +343,7 @@ This C++ library provide an interfaces to integrate Cardano capabilities into a
- [libcardano Documentation](https://viperscience.gitlab.io/libcardano/)
-
-
+
@@ -481,12 +362,7 @@ Mesh is a website framework that allows you to integrate new or existing website
- [TxPipe Discord](https://discord.gg/sJ2D3g33Qp): Mesh channel
-
-
+
@@ -499,12 +375,7 @@ JavaScript and TypeScript functions to simplify the dApp development. Provides h
- [Cardano-connect-with-wallet Documentation](https://cardano-foundation.github.io/cardano-connect-with-wallet/react-storybook/)
-
-
+
@@ -517,12 +388,7 @@ CardanoPress connects a WordPress website to the Cardano blockchain. Features in
- [CardanoPress Website](https://cardanopress.io/)
-
-
+
@@ -536,12 +402,7 @@ Use-cardano is a react context, hook, and set of components that makes interacti
- [Starter Kit Demo](https://cardano-starter-kit.alangaming.com/)
-
-
+
@@ -553,12 +414,7 @@ CardanoSharp Blazor is a component library for C# devs to develop dApps on Carda
- [CardanoSharp Blazor GitHub](https://github.com/CardanoSharp/cardanosharp-blazor)
-
-
+
@@ -571,12 +427,7 @@ Web component for connecting to Cardano wallets. The component provides a button
- [Cardano-connect Documentation](https://github.com/osc707/cardano-connect/blob/main/custom-elements.md)
-
-
+
@@ -589,12 +440,7 @@ Cardano-peer-connect aims to provide simple interfaces to implement CIP-0045 for
- [Cardano-peer-connect Demo Implementation](https://github.com/fabianbormann/cip-0045-demo-implementation)
-
-
+
@@ -607,12 +453,7 @@ Cardano-dApp-JS is a library that with wallet connection and wallet styling.
- [Wild Tangz Discord](https://discord.com/invite/wildtangz)
-
-
+
@@ -641,12 +477,7 @@ Cardano-connect is a WordPress plugin providing Cardano Web3 wallet connections
- [Cardano-connect GitHub](https://github.com/devhalls/cardano-connect)
-
-
+
@@ -663,12 +494,7 @@ Library that provides essential tools for managing Cardano addresses and mnemoni
- [Cardano-addresses Documentation](https://intersectmbo.github.io/cardano-addresses/haddock/)
-
-
+
@@ -680,12 +506,7 @@ Command-line interface tool that extends the official Cardano-CLI, providing the
- [Cardano-hw-cli GitHub](https://github.com/vacuumlabs/cardano-hw-cli)
-
-
+
@@ -698,12 +519,7 @@ CNCLI (Cardano Node CLI) is a community-developed command-line tool that extends
- [Cncli Documentation](https://github.com/cardano-community/cncli/blob/develop/USAGE.md)
-
-
+
@@ -716,12 +532,7 @@ A small CLI program to convert to and from bech32 strings. This can be useful wh
- [Bech32 Documentation](https://github.com/IntersectMBO/bech32)
-
-
+
@@ -734,12 +545,7 @@ Cardano-CLI is a core command-line tool for interacting with a Cardano node. It
- [Cardano-CLI Documentation](https://github.com/IntersectMBO/cardano-cli/blob/main/cardano-cli/test/cardano-cli-golden/files/golden/help.cli)
-
-
+
@@ -751,12 +557,7 @@ The Cardano Signer library is a versatile tool for signing and verifying using
- [Cardano-Signer GitHub](https://github.com/gitmachtl/cardano-signer)
-
-
+
@@ -769,12 +570,7 @@ Nview is a monitoring tool that gives a view of a running node from the command
- [Blink Labs Discord](https://discord.gg/jx9dxarjyv): Nview channel
-
-
+
@@ -787,12 +583,7 @@ Txtop is a tool to inspect the mempool of a Cardano node, which can be useful to
- [Blink Labs Discord](https://discord.com/invite/5fPRZnX4qW)
-
-
+
@@ -805,12 +596,7 @@ Cardano-up is a line utility for managing Cardano services. It allows you to ins
- [Blink Labs Discord](https://discord.com/invite/5fPRZnX4qW): Cardano-up channel
-
-
+
@@ -822,12 +608,7 @@ Command-line version manager for Cardano. Install, uninstall, and update Cardano
- [Hyper Jump GitHub](https://github.com/falcucci/hyper-jump)
-
-
+
@@ -839,12 +620,7 @@ Gastronomy is a UPLC debugger that allows you to step forward and backward throu
- [Gastronomy GitHub](https://github.com/SundaeSwap-finance/gastronomy)
-
-
+
@@ -856,12 +632,7 @@ Cardano-skepsis-toolbox is a python-based utility designed for interacting with
- [Cardano-skepsis-toolbox GitHub](https://github.com/chrispalaskas/cardano-skepsis-toolbox)
-
-
+
@@ -878,12 +649,7 @@ The Cardano node is the core component to participate in the Cardano blockchain.
- [Intersect Discord](https://discord.gg/7bQtEy3pyG): Node-working-group channel
-
-
+
@@ -897,12 +663,7 @@ A lightweight bridge between the Cardano node and client applications, enabling
- [IOG Technical Community Discord](https://discord.gg/inputoutput): Ogmios channel
-
-
+
@@ -916,12 +677,7 @@ Dolos is a specialized Cardano data node, designed to maintain an up-to-date cop
- [TxPipe Discord](https://discord.gg/sJ2D3g33Qp): Dolos channel
-
-
+
@@ -934,12 +690,7 @@ Cardano Node Tests is a library provides system and end-to-end (E2E) tests for c
- [Cardano-node-tests Documentation](https://tests.cardano.intersectmbo.org/)
-
-
+
@@ -953,12 +704,7 @@ Amaru is a Cardano node client written in Rust. It aims to bring more node dive
- [Pragma Discord](https://discord.gg/M65GBpkGjK): Amaru channel
-
-
+
@@ -971,12 +717,7 @@ Yaci allows connection and interaction with Cardano nodes directly. The library
- [Roasted Bean Alliance Discord](https://discord.com/invite/JtQ54MSw6p)
-
-
+
@@ -995,12 +736,7 @@ Cardano-DB-Sync is a tool that continuously syncs the Cardano blockchain with a
- [Intersect Discord](https://discord.gg/7bQtEy3pyG): DB-Sync Working Group Channel
-
-
+
@@ -1014,12 +750,7 @@ Oura is CLI tool that monitors the Cardano blockchain in real-time. It allows fi
- [TxPipe Discord](https://discord.gg/9vJnnW6vDP): Oura channel
-
-
+
@@ -1032,12 +763,7 @@ Kupo is a lightweight chain-indexing tool for the Cardano blockchain. It quickly
- [TxPipe Discord](https://discord.gg/9vJnnW6vDP): Kupo channel
-
-
+
@@ -1050,12 +776,7 @@ Carp is an indexer, built in Rust, that syncs blockchain data into a PostgreSQL
- [Carp Documentation](https://dcspark.github.io/carp/docs/intro/)
-
-
+
@@ -1068,12 +789,7 @@ Scrolls is a Rust-based library designed for building and managing read-optimize
- [TxPipe Discord](https://discord.gg/GgZbKGFeUx)
-
-
+
@@ -1087,12 +803,7 @@ Adder is a tool that monitors the Cardano blockchain and emits events as blocks
- [Blink Labs Discord](https://discord.gg/msgxSvq4Ez): Adder channel
-
-
+
@@ -1105,12 +816,7 @@ LedgerSync is a Java application for indexing Cardano blockchain data. It reads
- [LedgerSync Documentation](https://cardano-foundation.github.io/cf-ledger-sync)
-
-
+
@@ -1124,12 +830,7 @@ Yaci Store is a modular indexer library written in Java for the Cardano blockcha
- [Roasted Bean Alliance Discord](https://discord.com/invite/JtQ54MSw6p)
-
-
+
@@ -1142,12 +843,7 @@ Marconi is a lightweight, customizable framework for indexing and querying Carda
- [IOG Technical Community Discord](https://discord.gg/inputoutput)
-
-
+
@@ -1159,12 +855,7 @@ Mafoc is a Haskell framework for developing custom blockchain indexers, using an
- [Mafoc GitHub](https://github.com/eyeinsky/mafoc/)
-
-
+
@@ -1176,12 +867,7 @@ Argus is a .NET library that simplifies indexing that provides a framework. It p
- [Argus GitHub](https://github.com/SAIB-Inc/Argus)
-
-
+
@@ -1198,12 +884,7 @@ Cardano Serialization Library, written in Rust, serializes and deserializes data
- [Cardano Serialization Lib Documentation](https://developers.cardano.org/docs/get-started/cardano-serialization-lib/overview/)
-
-
+
@@ -1216,12 +897,7 @@ This multi-platform Rust library provides serialization and deserialization of c
- [DcSpark Discord](https://discord.gg/UX62bjCxVg)
-
-
+
@@ -1233,12 +909,7 @@ Golang library for serialization and deserialization of Cardano data structures.
- [Go Cardano Serialization GitHub](https://github.com/fivebinaries/go-cardano-serialization)
-
-
+
@@ -1255,12 +926,7 @@ Naumachia is a framework for creating and testing smart contracts that offers a
- [TxPipe Discord](https://discord.gg/sJ2D3g33Qp): Naumanchia channel
-
-
+
@@ -1272,12 +938,7 @@ QuickCheck-dynamic is a Haskell library designed for testing stateful systems, i
- [Quickcheck Dynamic GitHub](https://github.com/input-output-hk/quickcheck-dynamic)
-
-
+
@@ -1289,12 +950,7 @@ Test and benchmark Plutus Smart Contracts.
- [Plutus Bench GitHub](https://github.com/OpShin/plutus-bench)
-
-
+
@@ -1307,12 +963,7 @@ Vodka is a Cardano development toolkit designed to use with Aiken. It includes u
- [Vodka Documentation](https://sidan-lab.github.io/vodka/)
-
-
+
@@ -1329,12 +980,7 @@ The Cardano token registry is where token creators submit verified information a
- [Cardano Token Registry Guide and FAQ](https://github.com/cardano-foundation/cardano-token-registry/wiki)
-
-
+
@@ -1346,12 +992,7 @@ The Offchain Data Registry maps dApps to their script addresses. They also maint
- [Offchain Data Registry GitHub](https://github.com/Cardano-Fans/crfa-offchain-data-registry)
-
-
+
@@ -1363,12 +1004,7 @@ A registry maintaining information about dApps on the Cardano blockchain, used b
- [Cardano Contracts Registry GitHub](https://github.com/StricaHQ/cardano-contracts-registry)
-
-
+
@@ -1382,12 +1018,7 @@ Cardano shield is a registry of known scammers, collected to provide protection
- [Cardano Shield Blacklist](https://github.com/adabox-aio/cardano-shield/blob/main/config/blacklist.json)
-
-
+
@@ -1400,12 +1031,7 @@ Eternl Guard is a repository designed to gather domain names and asset of known
- [Eternl Guard Blacklist](https://github.com/Tastenkunst/eternl-guard/tree/main/src/entries)
-
-
+
@@ -1418,12 +1044,7 @@ Cardano Scam Token Registry is a list of scam tokens. To find the scam tokens,
- [Cardano Scam Token Registry Blacklist](https://github.com/BrockCruess/Cardano-Scam-Token-Registry/blob/main/scam-token-list)
-
-
+
From da3d6d23d90e7c15764fcba654c81c5d04e2056a Mon Sep 17 00:00:00 2001
From: tuckpuck
Date: Fri, 6 Dec 2024 22:28:17 +0100
Subject: [PATCH 033/111] remove unused demo components
---
components/demo_components/blackhole.js | 33398 ----------------
.../demo_components/counters.module.css | 6 -
components/demo_components/counters.tsx | 24 -
components/demo_components/galaxy.js | 176 -
.../demo_components/tableofcontents.tsx | 14 -
5 files changed, 33618 deletions(-)
delete mode 100644 components/demo_components/blackhole.js
delete mode 100644 components/demo_components/counters.module.css
delete mode 100644 components/demo_components/counters.tsx
delete mode 100644 components/demo_components/galaxy.js
delete mode 100644 components/demo_components/tableofcontents.tsx
diff --git a/components/demo_components/blackhole.js b/components/demo_components/blackhole.js
deleted file mode 100644
index e64abdef..00000000
--- a/components/demo_components/blackhole.js
+++ /dev/null
@@ -1,33398 +0,0 @@
-import React, { useEffect } from "react";
-import * as THREE from "three";
-import { OrbitControls } from "three/examples/jsm/controls/OrbitControls.js";
-function Blackhole() {
- useEffect(() => {
- var lu = Object.defineProperty;
- var cu = (r, e, t) =>
- e in r
- ? lu(r, e, {
- enumerable: !0,
- configurable: !0,
- writable: !0,
- value: t,
- })
- : (r[e] = t);
- var Xr = (r, e, t) => (cu(r, typeof e != "symbol" ? e + "" : e, t), t);
- const hu = function () {
- const e = document.createElement("link").relList;
- if (e && e.supports && e.supports("modulepreload")) return;
- for (const i of document.querySelectorAll('link[rel="modulepreload"]'))
- n(i);
- new MutationObserver((i) => {
- for (const s of i)
- if (s.type === "childList")
- for (const a of s.addedNodes)
- a.tagName === "LINK" && a.rel === "modulepreload" && n(a);
- }).observe(document, { childList: !0, subtree: !0 });
- function t(i) {
- const s = {};
- return (
- i.integrity && (s.integrity = i.integrity),
- i.referrerpolicy && (s.referrerPolicy = i.referrerpolicy),
- i.crossorigin === "use-credentials"
- ? (s.credentials = "include")
- : i.crossorigin === "anonymous"
- ? (s.credentials = "omit")
- : (s.credentials = "same-origin"),
- s
- );
- }
- function n(i) {
- if (i.ep) return;
- i.ep = !0;
- const s = t(i);
- fetch(i.href, s);
- }
- };
- hu();
- /**
- * @license
- * Copyright 2010-2022 Three.js Authors
- * SPDX-License-Identifier: MIT
- */ const to = "141",
- mi = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 },
- gi = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 },
- uu = 0,
- Io = 1,
- du = 2,
- Cc = 1,
- Lc = 2,
- _s = 3,
- ki = 0,
- qt = 1,
- cn = 2,
- fu = 1,
- Un = 0,
- zi = 1,
- Sr = 2,
- Fo = 3,
- No = 4,
- pu = 5,
- Di = 100,
- mu = 101,
- gu = 102,
- zo = 103,
- Oo = 104,
- vu = 200,
- _u = 201,
- xu = 202,
- yu = 203,
- Rc = 204,
- Pc = 205,
- Mu = 206,
- wu = 207,
- bu = 208,
- Su = 209,
- Tu = 210,
- Eu = 0,
- Au = 1,
- Cu = 2,
- Fa = 3,
- Lu = 4,
- Ru = 5,
- Pu = 6,
- Du = 7,
- zr = 0,
- Iu = 1,
- Fu = 2,
- $t = 0,
- Dc = 1,
- Ic = 2,
- Fc = 3,
- Nc = 4,
- Nu = 5,
- zc = 300,
- Ui = 301,
- Bi = 302,
- Tr = 303,
- Na = 304,
- Or = 306,
- hn = 1e3,
- gt = 1001,
- Er = 1002,
- ft = 1003,
- za = 1004,
- Oa = 1005,
- $e = 1006,
- Oc = 1007,
- li = 1008,
- oi = 1009,
- zu = 1010,
- Ou = 1011,
- kc = 1012,
- ku = 1013,
- ii = 1014,
- Ft = 1015,
- Mn = 1016,
- Uu = 1017,
- Bu = 1018,
- Oi = 1020,
- Vu = 1021,
- Gu = 1022,
- Nt = 1023,
- Hu = 1024,
- Wu = 1025,
- ri = 1026,
- Vi = 1027,
- Uc = 1028,
- ju = 1029,
- Xu = 1030,
- qu = 1031,
- $u = 1033,
- qr = 33776,
- $r = 33777,
- Yr = 33778,
- Kr = 33779,
- ko = 35840,
- Uo = 35841,
- Bo = 35842,
- Vo = 35843,
- Yu = 36196,
- Go = 37492,
- Ho = 37496,
- Wo = 37808,
- jo = 37809,
- Xo = 37810,
- qo = 37811,
- $o = 37812,
- Yo = 37813,
- Ko = 37814,
- Zo = 37815,
- Jo = 37816,
- Qo = 37817,
- el = 37818,
- tl = 37819,
- nl = 37820,
- il = 37821,
- sl = 36492,
- Es = 2300,
- Gi = 2301,
- Zr = 2302,
- rl = 2400,
- al = 2401,
- ol = 2402,
- Ku = 2500,
- Zu = 2501,
- Ju = 1,
- Bc = 2,
- Vn = 3e3,
- Pe = 3001,
- Qu = 3200,
- ed = 3201,
- ci = 0,
- td = 1,
- yn = "srgb",
- si = "srgb-linear",
- Jr = 7680,
- nd = 519,
- ka = 35044,
- Tn = "300 es",
- Ua = 1035;
- class hi {
- addEventListener(e, t) {
- this._listeners === void 0 && (this._listeners = {});
- const n = this._listeners;
- n[e] === void 0 && (n[e] = []),
- n[e].indexOf(t) === -1 && n[e].push(t);
- }
- hasEventListener(e, t) {
- if (this._listeners === void 0) return !1;
- const n = this._listeners;
- return n[e] !== void 0 && n[e].indexOf(t) !== -1;
- }
- removeEventListener(e, t) {
- if (this._listeners === void 0) return;
- const i = this._listeners[e];
- if (i !== void 0) {
- const s = i.indexOf(t);
- s !== -1 && i.splice(s, 1);
- }
- }
- dispatchEvent(e) {
- if (this._listeners === void 0) return;
- const n = this._listeners[e.type];
- if (n !== void 0) {
- e.target = this;
- const i = n.slice(0);
- for (let s = 0, a = i.length; s < a; s++) i[s].call(this, e);
- e.target = null;
- }
- }
- }
- const dt = [];
- for (let r = 0; r < 256; r++)
- dt[r] = (r < 16 ? "0" : "") + r.toString(16);
- let ll = 1234567;
- const ys = Math.PI / 180,
- As = 180 / Math.PI;
- function Yt() {
- const r = (Math.random() * 4294967295) | 0,
- e = (Math.random() * 4294967295) | 0,
- t = (Math.random() * 4294967295) | 0,
- n = (Math.random() * 4294967295) | 0;
- return (
- dt[r & 255] +
- dt[(r >> 8) & 255] +
- dt[(r >> 16) & 255] +
- dt[(r >> 24) & 255] +
- "-" +
- dt[e & 255] +
- dt[(e >> 8) & 255] +
- "-" +
- dt[((e >> 16) & 15) | 64] +
- dt[(e >> 24) & 255] +
- "-" +
- dt[(t & 63) | 128] +
- dt[(t >> 8) & 255] +
- "-" +
- dt[(t >> 16) & 255] +
- dt[(t >> 24) & 255] +
- dt[n & 255] +
- dt[(n >> 8) & 255] +
- dt[(n >> 16) & 255] +
- dt[(n >> 24) & 255]
- ).toLowerCase();
- }
- function at(r, e, t) {
- return Math.max(e, Math.min(t, r));
- }
- function no(r, e) {
- return ((r % e) + e) % e;
- }
- function id(r, e, t, n, i) {
- return n + ((r - e) * (i - n)) / (t - e);
- }
- function sd(r, e, t) {
- return r !== e ? (t - r) / (e - r) : 0;
- }
- function Ms(r, e, t) {
- return (1 - t) * r + t * e;
- }
- function rd(r, e, t, n) {
- return Ms(r, e, 1 - Math.exp(-t * n));
- }
- function ad(r, e = 1) {
- return e - Math.abs(no(r, e * 2) - e);
- }
- function od(r, e, t) {
- return r <= e
- ? 0
- : r >= t
- ? 1
- : ((r = (r - e) / (t - e)), r * r * (3 - 2 * r));
- }
- function ld(r, e, t) {
- return r <= e
- ? 0
- : r >= t
- ? 1
- : ((r = (r - e) / (t - e)), r * r * r * (r * (r * 6 - 15) + 10));
- }
- function cd(r, e) {
- return r + Math.floor(Math.random() * (e - r + 1));
- }
- function hd(r, e) {
- return r + Math.random() * (e - r);
- }
- function ud(r) {
- return r * (0.5 - Math.random());
- }
- function dd(r) {
- r !== void 0 && (ll = r);
- let e = (ll += 1831565813);
- return (
- (e = Math.imul(e ^ (e >>> 15), e | 1)),
- (e ^= e + Math.imul(e ^ (e >>> 7), e | 61)),
- ((e ^ (e >>> 14)) >>> 0) / 4294967296
- );
- }
- function fd(r) {
- return r * ys;
- }
- function pd(r) {
- return r * As;
- }
- function Ba(r) {
- return (r & (r - 1)) === 0 && r !== 0;
- }
- function Vc(r) {
- return Math.pow(2, Math.ceil(Math.log(r) / Math.LN2));
- }
- function Ar(r) {
- return Math.pow(2, Math.floor(Math.log(r) / Math.LN2));
- }
- function md(r, e, t, n, i) {
- const s = Math.cos,
- a = Math.sin,
- o = s(t / 2),
- l = a(t / 2),
- c = s((e + n) / 2),
- u = a((e + n) / 2),
- h = s((e - n) / 2),
- d = a((e - n) / 2),
- f = s((n - e) / 2),
- g = a((n - e) / 2);
- switch (i) {
- case "XYX":
- r.set(o * u, l * h, l * d, o * c);
- break;
- case "YZY":
- r.set(l * d, o * u, l * h, o * c);
- break;
- case "ZXZ":
- r.set(l * h, l * d, o * u, o * c);
- break;
- case "XZX":
- r.set(o * u, l * g, l * f, o * c);
- break;
- case "YXY":
- r.set(l * f, o * u, l * g, o * c);
- break;
- case "ZYZ":
- r.set(l * g, l * f, o * u, o * c);
- break;
- default:
- console.warn(
- "THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: " +
- i
- );
- }
- }
- function gd(r, e) {
- switch (e.constructor) {
- case Float32Array:
- return r;
- case Uint16Array:
- return r / 65535;
- case Uint8Array:
- return r / 255;
- case Int16Array:
- return Math.max(r / 32767, -1);
- case Int8Array:
- return Math.max(r / 127, -1);
- default:
- throw new Error("Invalid component type.");
- }
- }
- function vd(r, e) {
- switch (e.constructor) {
- case Float32Array:
- return r;
- case Uint16Array:
- return Math.round(r * 65535);
- case Uint8Array:
- return Math.round(r * 255);
- case Int16Array:
- return Math.round(r * 32767);
- case Int8Array:
- return Math.round(r * 127);
- default:
- throw new Error("Invalid component type.");
- }
- }
- var jt = Object.freeze({
- __proto__: null,
- DEG2RAD: ys,
- RAD2DEG: As,
- generateUUID: Yt,
- clamp: at,
- euclideanModulo: no,
- mapLinear: id,
- inverseLerp: sd,
- lerp: Ms,
- damp: rd,
- pingpong: ad,
- smoothstep: od,
- smootherstep: ld,
- randInt: cd,
- randFloat: hd,
- randFloatSpread: ud,
- seededRandom: dd,
- degToRad: fd,
- radToDeg: pd,
- isPowerOfTwo: Ba,
- ceilPowerOfTwo: Vc,
- floorPowerOfTwo: Ar,
- setQuaternionFromProperEuler: md,
- normalize: vd,
- denormalize: gd,
- });
- class ve {
- constructor(e = 0, t = 0) {
- (this.isVector2 = !0), (this.x = e), (this.y = t);
- }
- get width() {
- return this.x;
- }
- set width(e) {
- this.x = e;
- }
- get height() {
- return this.y;
- }
- set height(e) {
- this.y = e;
- }
- set(e, t) {
- return (this.x = e), (this.y = t), this;
- }
- setScalar(e) {
- return (this.x = e), (this.y = e), this;
- }
- setX(e) {
- return (this.x = e), this;
- }
- setY(e) {
- return (this.y = e), this;
- }
- setComponent(e, t) {
- switch (e) {
- case 0:
- this.x = t;
- break;
- case 1:
- this.y = t;
- break;
- default:
- throw new Error("index is out of range: " + e);
- }
- return this;
- }
- getComponent(e) {
- switch (e) {
- case 0:
- return this.x;
- case 1:
- return this.y;
- default:
- throw new Error("index is out of range: " + e);
- }
- }
- clone() {
- return new this.constructor(this.x, this.y);
- }
- copy(e) {
- return (this.x = e.x), (this.y = e.y), this;
- }
- add(e, t) {
- return t !== void 0
- ? (console.warn(
- "THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."
- ),
- this.addVectors(e, t))
- : ((this.x += e.x), (this.y += e.y), this);
- }
- addScalar(e) {
- return (this.x += e), (this.y += e), this;
- }
- addVectors(e, t) {
- return (this.x = e.x + t.x), (this.y = e.y + t.y), this;
- }
- addScaledVector(e, t) {
- return (this.x += e.x * t), (this.y += e.y * t), this;
- }
- sub(e, t) {
- return t !== void 0
- ? (console.warn(
- "THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."
- ),
- this.subVectors(e, t))
- : ((this.x -= e.x), (this.y -= e.y), this);
- }
- subScalar(e) {
- return (this.x -= e), (this.y -= e), this;
- }
- subVectors(e, t) {
- return (this.x = e.x - t.x), (this.y = e.y - t.y), this;
- }
- multiply(e) {
- return (this.x *= e.x), (this.y *= e.y), this;
- }
- multiplyScalar(e) {
- return (this.x *= e), (this.y *= e), this;
- }
- divide(e) {
- return (this.x /= e.x), (this.y /= e.y), this;
- }
- divideScalar(e) {
- return this.multiplyScalar(1 / e);
- }
- applyMatrix3(e) {
- const t = this.x,
- n = this.y,
- i = e.elements;
- return (
- (this.x = i[0] * t + i[3] * n + i[6]),
- (this.y = i[1] * t + i[4] * n + i[7]),
- this
- );
- }
- min(e) {
- return (
- (this.x = Math.min(this.x, e.x)),
- (this.y = Math.min(this.y, e.y)),
- this
- );
- }
- max(e) {
- return (
- (this.x = Math.max(this.x, e.x)),
- (this.y = Math.max(this.y, e.y)),
- this
- );
- }
- clamp(e, t) {
- return (
- (this.x = Math.max(e.x, Math.min(t.x, this.x))),
- (this.y = Math.max(e.y, Math.min(t.y, this.y))),
- this
- );
- }
- clampScalar(e, t) {
- return (
- (this.x = Math.max(e, Math.min(t, this.x))),
- (this.y = Math.max(e, Math.min(t, this.y))),
- this
- );
- }
- clampLength(e, t) {
- const n = this.length();
- return this.divideScalar(n || 1).multiplyScalar(
- Math.max(e, Math.min(t, n))
- );
- }
- floor() {
- return (
- (this.x = Math.floor(this.x)), (this.y = Math.floor(this.y)), this
- );
- }
- ceil() {
- return (
- (this.x = Math.ceil(this.x)), (this.y = Math.ceil(this.y)), this
- );
- }
- round() {
- return (
- (this.x = Math.round(this.x)), (this.y = Math.round(this.y)), this
- );
- }
- roundToZero() {
- return (
- (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)),
- (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)),
- this
- );
- }
- negate() {
- return (this.x = -this.x), (this.y = -this.y), this;
- }
- dot(e) {
- return this.x * e.x + this.y * e.y;
- }
- cross(e) {
- return this.x * e.y - this.y * e.x;
- }
- lengthSq() {
- return this.x * this.x + this.y * this.y;
- }
- length() {
- return Math.sqrt(this.x * this.x + this.y * this.y);
- }
- manhattanLength() {
- return Math.abs(this.x) + Math.abs(this.y);
- }
- normalize() {
- return this.divideScalar(this.length() || 1);
- }
- angle() {
- return Math.atan2(-this.y, -this.x) + Math.PI;
- }
- distanceTo(e) {
- return Math.sqrt(this.distanceToSquared(e));
- }
- distanceToSquared(e) {
- const t = this.x - e.x,
- n = this.y - e.y;
- return t * t + n * n;
- }
- manhattanDistanceTo(e) {
- return Math.abs(this.x - e.x) + Math.abs(this.y - e.y);
- }
- setLength(e) {
- return this.normalize().multiplyScalar(e);
- }
- lerp(e, t) {
- return (
- (this.x += (e.x - this.x) * t), (this.y += (e.y - this.y) * t), this
- );
- }
- lerpVectors(e, t, n) {
- return (
- (this.x = e.x + (t.x - e.x) * n),
- (this.y = e.y + (t.y - e.y) * n),
- this
- );
- }
- equals(e) {
- return e.x === this.x && e.y === this.y;
- }
- fromArray(e, t = 0) {
- return (this.x = e[t]), (this.y = e[t + 1]), this;
- }
- toArray(e = [], t = 0) {
- return (e[t] = this.x), (e[t + 1] = this.y), e;
- }
- fromBufferAttribute(e, t, n) {
- return (
- n !== void 0 &&
- console.warn(
- "THREE.Vector2: offset has been removed from .fromBufferAttribute()."
- ),
- (this.x = e.getX(t)),
- (this.y = e.getY(t)),
- this
- );
- }
- rotateAround(e, t) {
- const n = Math.cos(t),
- i = Math.sin(t),
- s = this.x - e.x,
- a = this.y - e.y;
- return (
- (this.x = s * n - a * i + e.x), (this.y = s * i + a * n + e.y), this
- );
- }
- random() {
- return (this.x = Math.random()), (this.y = Math.random()), this;
- }
- *[Symbol.iterator]() {
- yield this.x, yield this.y;
- }
- }
- class Xt {
- constructor() {
- (this.isMatrix3 = !0),
- (this.elements = [1, 0, 0, 0, 1, 0, 0, 0, 1]),
- arguments.length > 0 &&
- console.error(
- "THREE.Matrix3: the constructor no longer reads arguments. use .set() instead."
- );
- }
- set(e, t, n, i, s, a, o, l, c) {
- const u = this.elements;
- return (
- (u[0] = e),
- (u[1] = i),
- (u[2] = o),
- (u[3] = t),
- (u[4] = s),
- (u[5] = l),
- (u[6] = n),
- (u[7] = a),
- (u[8] = c),
- this
- );
- }
- identity() {
- return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this;
- }
- copy(e) {
- const t = this.elements,
- n = e.elements;
- return (
- (t[0] = n[0]),
- (t[1] = n[1]),
- (t[2] = n[2]),
- (t[3] = n[3]),
- (t[4] = n[4]),
- (t[5] = n[5]),
- (t[6] = n[6]),
- (t[7] = n[7]),
- (t[8] = n[8]),
- this
- );
- }
- extractBasis(e, t, n) {
- return (
- e.setFromMatrix3Column(this, 0),
- t.setFromMatrix3Column(this, 1),
- n.setFromMatrix3Column(this, 2),
- this
- );
- }
- setFromMatrix4(e) {
- const t = e.elements;
- return (
- this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
- this
- );
- }
- multiply(e) {
- return this.multiplyMatrices(this, e);
- }
- premultiply(e) {
- return this.multiplyMatrices(e, this);
- }
- multiplyMatrices(e, t) {
- const n = e.elements,
- i = t.elements,
- s = this.elements,
- a = n[0],
- o = n[3],
- l = n[6],
- c = n[1],
- u = n[4],
- h = n[7],
- d = n[2],
- f = n[5],
- g = n[8],
- m = i[0],
- p = i[3],
- v = i[6],
- M = i[1],
- x = i[4],
- w = i[7],
- y = i[2],
- A = i[5],
- L = i[8];
- return (
- (s[0] = a * m + o * M + l * y),
- (s[3] = a * p + o * x + l * A),
- (s[6] = a * v + o * w + l * L),
- (s[1] = c * m + u * M + h * y),
- (s[4] = c * p + u * x + h * A),
- (s[7] = c * v + u * w + h * L),
- (s[2] = d * m + f * M + g * y),
- (s[5] = d * p + f * x + g * A),
- (s[8] = d * v + f * w + g * L),
- this
- );
- }
- multiplyScalar(e) {
- const t = this.elements;
- return (
- (t[0] *= e),
- (t[3] *= e),
- (t[6] *= e),
- (t[1] *= e),
- (t[4] *= e),
- (t[7] *= e),
- (t[2] *= e),
- (t[5] *= e),
- (t[8] *= e),
- this
- );
- }
- determinant() {
- const e = this.elements,
- t = e[0],
- n = e[1],
- i = e[2],
- s = e[3],
- a = e[4],
- o = e[5],
- l = e[6],
- c = e[7],
- u = e[8];
- return (
- t * a * u -
- t * o * c -
- n * s * u +
- n * o * l +
- i * s * c -
- i * a * l
- );
- }
- invert() {
- const e = this.elements,
- t = e[0],
- n = e[1],
- i = e[2],
- s = e[3],
- a = e[4],
- o = e[5],
- l = e[6],
- c = e[7],
- u = e[8],
- h = u * a - o * c,
- d = o * l - u * s,
- f = c * s - a * l,
- g = t * h + n * d + i * f;
- if (g === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);
- const m = 1 / g;
- return (
- (e[0] = h * m),
- (e[1] = (i * c - u * n) * m),
- (e[2] = (o * n - i * a) * m),
- (e[3] = d * m),
- (e[4] = (u * t - i * l) * m),
- (e[5] = (i * s - o * t) * m),
- (e[6] = f * m),
- (e[7] = (n * l - c * t) * m),
- (e[8] = (a * t - n * s) * m),
- this
- );
- }
- transpose() {
- let e;
- const t = this.elements;
- return (
- (e = t[1]),
- (t[1] = t[3]),
- (t[3] = e),
- (e = t[2]),
- (t[2] = t[6]),
- (t[6] = e),
- (e = t[5]),
- (t[5] = t[7]),
- (t[7] = e),
- this
- );
- }
- getNormalMatrix(e) {
- return this.setFromMatrix4(e).invert().transpose();
- }
- transposeIntoArray(e) {
- const t = this.elements;
- return (
- (e[0] = t[0]),
- (e[1] = t[3]),
- (e[2] = t[6]),
- (e[3] = t[1]),
- (e[4] = t[4]),
- (e[5] = t[7]),
- (e[6] = t[2]),
- (e[7] = t[5]),
- (e[8] = t[8]),
- this
- );
- }
- setUvTransform(e, t, n, i, s, a, o) {
- const l = Math.cos(s),
- c = Math.sin(s);
- return (
- this.set(
- n * l,
- n * c,
- -n * (l * a + c * o) + a + e,
- -i * c,
- i * l,
- -i * (-c * a + l * o) + o + t,
- 0,
- 0,
- 1
- ),
- this
- );
- }
- scale(e, t) {
- const n = this.elements;
- return (
- (n[0] *= e),
- (n[3] *= e),
- (n[6] *= e),
- (n[1] *= t),
- (n[4] *= t),
- (n[7] *= t),
- this
- );
- }
- rotate(e) {
- const t = Math.cos(e),
- n = Math.sin(e),
- i = this.elements,
- s = i[0],
- a = i[3],
- o = i[6],
- l = i[1],
- c = i[4],
- u = i[7];
- return (
- (i[0] = t * s + n * l),
- (i[3] = t * a + n * c),
- (i[6] = t * o + n * u),
- (i[1] = -n * s + t * l),
- (i[4] = -n * a + t * c),
- (i[7] = -n * o + t * u),
- this
- );
- }
- translate(e, t) {
- const n = this.elements;
- return (
- (n[0] += e * n[2]),
- (n[3] += e * n[5]),
- (n[6] += e * n[8]),
- (n[1] += t * n[2]),
- (n[4] += t * n[5]),
- (n[7] += t * n[8]),
- this
- );
- }
- equals(e) {
- const t = this.elements,
- n = e.elements;
- for (let i = 0; i < 9; i++) if (t[i] !== n[i]) return !1;
- return !0;
- }
- fromArray(e, t = 0) {
- for (let n = 0; n < 9; n++) this.elements[n] = e[n + t];
- return this;
- }
- toArray(e = [], t = 0) {
- const n = this.elements;
- return (
- (e[t] = n[0]),
- (e[t + 1] = n[1]),
- (e[t + 2] = n[2]),
- (e[t + 3] = n[3]),
- (e[t + 4] = n[4]),
- (e[t + 5] = n[5]),
- (e[t + 6] = n[6]),
- (e[t + 7] = n[7]),
- (e[t + 8] = n[8]),
- e
- );
- }
- clone() {
- return new this.constructor().fromArray(this.elements);
- }
- }
- function Gc(r) {
- for (let e = r.length - 1; e >= 0; --e) if (r[e] > 65535) return !0;
- return !1;
- }
- function Cs(r) {
- return document.createElementNS("http://www.w3.org/1999/xhtml", r);
- }
- function ai(r) {
- return r < 0.04045
- ? r * 0.0773993808
- : Math.pow(r * 0.9478672986 + 0.0521327014, 2.4);
- }
- function vr(r) {
- return r < 0.0031308 ? r * 12.92 : 1.055 * Math.pow(r, 0.41666) - 0.055;
- }
- const Qr = { [yn]: { [si]: ai }, [si]: { [yn]: vr } },
- Ut = {
- legacyMode: !0,
- get workingColorSpace() {
- return si;
- },
- set workingColorSpace(r) {
- console.warn(
- "THREE.ColorManagement: .workingColorSpace is readonly."
- );
- },
- convert: function (r, e, t) {
- if (this.legacyMode || e === t || !e || !t) return r;
- if (Qr[e] && Qr[e][t] !== void 0) {
- const n = Qr[e][t];
- return (r.r = n(r.r)), (r.g = n(r.g)), (r.b = n(r.b)), r;
- }
- throw new Error("Unsupported color space conversion.");
- },
- fromWorkingColorSpace: function (r, e) {
- return this.convert(r, this.workingColorSpace, e);
- },
- toWorkingColorSpace: function (r, e) {
- return this.convert(r, e, this.workingColorSpace);
- },
- },
- Hc = {
- aliceblue: 15792383,
- antiquewhite: 16444375,
- aqua: 65535,
- aquamarine: 8388564,
- azure: 15794175,
- beige: 16119260,
- bisque: 16770244,
- black: 0,
- blanchedalmond: 16772045,
- blue: 255,
- blueviolet: 9055202,
- brown: 10824234,
- burlywood: 14596231,
- cadetblue: 6266528,
- chartreuse: 8388352,
- chocolate: 13789470,
- coral: 16744272,
- cornflowerblue: 6591981,
- cornsilk: 16775388,
- crimson: 14423100,
- cyan: 65535,
- darkblue: 139,
- darkcyan: 35723,
- darkgoldenrod: 12092939,
- darkgray: 11119017,
- darkgreen: 25600,
- darkgrey: 11119017,
- darkkhaki: 12433259,
- darkmagenta: 9109643,
- darkolivegreen: 5597999,
- darkorange: 16747520,
- darkorchid: 10040012,
- darkred: 9109504,
- darksalmon: 15308410,
- darkseagreen: 9419919,
- darkslateblue: 4734347,
- darkslategray: 3100495,
- darkslategrey: 3100495,
- darkturquoise: 52945,
- darkviolet: 9699539,
- deeppink: 16716947,
- deepskyblue: 49151,
- dimgray: 6908265,
- dimgrey: 6908265,
- dodgerblue: 2003199,
- firebrick: 11674146,
- floralwhite: 16775920,
- forestgreen: 2263842,
- fuchsia: 16711935,
- gainsboro: 14474460,
- ghostwhite: 16316671,
- gold: 16766720,
- goldenrod: 14329120,
- gray: 8421504,
- green: 32768,
- greenyellow: 11403055,
- grey: 8421504,
- honeydew: 15794160,
- hotpink: 16738740,
- indianred: 13458524,
- indigo: 4915330,
- ivory: 16777200,
- khaki: 15787660,
- lavender: 15132410,
- lavenderblush: 16773365,
- lawngreen: 8190976,
- lemonchiffon: 16775885,
- lightblue: 11393254,
- lightcoral: 15761536,
- lightcyan: 14745599,
- lightgoldenrodyellow: 16448210,
- lightgray: 13882323,
- lightgreen: 9498256,
- lightgrey: 13882323,
- lightpink: 16758465,
- lightsalmon: 16752762,
- lightseagreen: 2142890,
- lightskyblue: 8900346,
- lightslategray: 7833753,
- lightslategrey: 7833753,
- lightsteelblue: 11584734,
- lightyellow: 16777184,
- lime: 65280,
- limegreen: 3329330,
- linen: 16445670,
- magenta: 16711935,
- maroon: 8388608,
- mediumaquamarine: 6737322,
- mediumblue: 205,
- mediumorchid: 12211667,
- mediumpurple: 9662683,
- mediumseagreen: 3978097,
- mediumslateblue: 8087790,
- mediumspringgreen: 64154,
- mediumturquoise: 4772300,
- mediumvioletred: 13047173,
- midnightblue: 1644912,
- mintcream: 16121850,
- mistyrose: 16770273,
- moccasin: 16770229,
- navajowhite: 16768685,
- navy: 128,
- oldlace: 16643558,
- olive: 8421376,
- olivedrab: 7048739,
- orange: 16753920,
- orangered: 16729344,
- orchid: 14315734,
- palegoldenrod: 15657130,
- palegreen: 10025880,
- paleturquoise: 11529966,
- palevioletred: 14381203,
- papayawhip: 16773077,
- peachpuff: 16767673,
- peru: 13468991,
- pink: 16761035,
- plum: 14524637,
- powderblue: 11591910,
- purple: 8388736,
- rebeccapurple: 6697881,
- red: 16711680,
- rosybrown: 12357519,
- royalblue: 4286945,
- saddlebrown: 9127187,
- salmon: 16416882,
- sandybrown: 16032864,
- seagreen: 3050327,
- seashell: 16774638,
- sienna: 10506797,
- silver: 12632256,
- skyblue: 8900331,
- slateblue: 6970061,
- slategray: 7372944,
- slategrey: 7372944,
- snow: 16775930,
- springgreen: 65407,
- steelblue: 4620980,
- tan: 13808780,
- teal: 32896,
- thistle: 14204888,
- tomato: 16737095,
- turquoise: 4251856,
- violet: 15631086,
- wheat: 16113331,
- white: 16777215,
- whitesmoke: 16119285,
- yellow: 16776960,
- yellowgreen: 10145074,
- },
- rt = { r: 0, g: 0, b: 0 },
- Bt = { h: 0, s: 0, l: 0 },
- js = { h: 0, s: 0, l: 0 };
- function ea(r, e, t) {
- return (
- t < 0 && (t += 1),
- t > 1 && (t -= 1),
- t < 1 / 6
- ? r + (e - r) * 6 * t
- : t < 1 / 2
- ? e
- : t < 2 / 3
- ? r + (e - r) * 6 * (2 / 3 - t)
- : r
- );
- }
- function Xs(r, e) {
- return (e.r = r.r), (e.g = r.g), (e.b = r.b), e;
- }
- class de {
- constructor(e, t, n) {
- return (
- (this.isColor = !0),
- (this.r = 1),
- (this.g = 1),
- (this.b = 1),
- t === void 0 && n === void 0 ? this.set(e) : this.setRGB(e, t, n)
- );
- }
- set(e) {
- return (
- e && e.isColor
- ? this.copy(e)
- : typeof e == "number"
- ? this.setHex(e)
- : typeof e == "string" && this.setStyle(e),
- this
- );
- }
- setScalar(e) {
- return (this.r = e), (this.g = e), (this.b = e), this;
- }
- setHex(e, t = yn) {
- return (
- (e = Math.floor(e)),
- (this.r = ((e >> 16) & 255) / 255),
- (this.g = ((e >> 8) & 255) / 255),
- (this.b = (e & 255) / 255),
- Ut.toWorkingColorSpace(this, t),
- this
- );
- }
- setRGB(e, t, n, i = si) {
- return (
- (this.r = e),
- (this.g = t),
- (this.b = n),
- Ut.toWorkingColorSpace(this, i),
- this
- );
- }
- setHSL(e, t, n, i = si) {
- if (((e = no(e, 1)), (t = at(t, 0, 1)), (n = at(n, 0, 1)), t === 0))
- this.r = this.g = this.b = n;
- else {
- const s = n <= 0.5 ? n * (1 + t) : n + t - n * t,
- a = 2 * n - s;
- (this.r = ea(a, s, e + 1 / 3)),
- (this.g = ea(a, s, e)),
- (this.b = ea(a, s, e - 1 / 3));
- }
- return Ut.toWorkingColorSpace(this, i), this;
- }
- setStyle(e, t = yn) {
- function n(s) {
- s !== void 0 &&
- parseFloat(s) < 1 &&
- console.warn(
- "THREE.Color: Alpha component of " + e + " will be ignored."
- );
- }
- let i;
- if ((i = /^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e))) {
- let s;
- const a = i[1],
- o = i[2];
- switch (a) {
- case "rgb":
- case "rgba":
- if (
- (s =
- /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(
- o
- ))
- )
- return (
- (this.r = Math.min(255, parseInt(s[1], 10)) / 255),
- (this.g = Math.min(255, parseInt(s[2], 10)) / 255),
- (this.b = Math.min(255, parseInt(s[3], 10)) / 255),
- Ut.toWorkingColorSpace(this, t),
- n(s[4]),
- this
- );
- if (
- (s =
- /^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(
- o
- ))
- )
- return (
- (this.r = Math.min(100, parseInt(s[1], 10)) / 100),
- (this.g = Math.min(100, parseInt(s[2], 10)) / 100),
- (this.b = Math.min(100, parseInt(s[3], 10)) / 100),
- Ut.toWorkingColorSpace(this, t),
- n(s[4]),
- this
- );
- break;
- case "hsl":
- case "hsla":
- if (
- (s =
- /^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(
- o
- ))
- ) {
- const l = parseFloat(s[1]) / 360,
- c = parseInt(s[2], 10) / 100,
- u = parseInt(s[3], 10) / 100;
- return n(s[4]), this.setHSL(l, c, u, t);
- }
- break;
- }
- } else if ((i = /^\#([A-Fa-f\d]+)$/.exec(e))) {
- const s = i[1],
- a = s.length;
- if (a === 3)
- return (
- (this.r = parseInt(s.charAt(0) + s.charAt(0), 16) / 255),
- (this.g = parseInt(s.charAt(1) + s.charAt(1), 16) / 255),
- (this.b = parseInt(s.charAt(2) + s.charAt(2), 16) / 255),
- Ut.toWorkingColorSpace(this, t),
- this
- );
- if (a === 6)
- return (
- (this.r = parseInt(s.charAt(0) + s.charAt(1), 16) / 255),
- (this.g = parseInt(s.charAt(2) + s.charAt(3), 16) / 255),
- (this.b = parseInt(s.charAt(4) + s.charAt(5), 16) / 255),
- Ut.toWorkingColorSpace(this, t),
- this
- );
- }
- return e && e.length > 0 ? this.setColorName(e, t) : this;
- }
- setColorName(e, t = yn) {
- const n = Hc[e.toLowerCase()];
- return (
- n !== void 0
- ? this.setHex(n, t)
- : console.warn("THREE.Color: Unknown color " + e),
- this
- );
- }
- clone() {
- return new this.constructor(this.r, this.g, this.b);
- }
- copy(e) {
- return (this.r = e.r), (this.g = e.g), (this.b = e.b), this;
- }
- copySRGBToLinear(e) {
- return (
- (this.r = ai(e.r)), (this.g = ai(e.g)), (this.b = ai(e.b)), this
- );
- }
- copyLinearToSRGB(e) {
- return (
- (this.r = vr(e.r)), (this.g = vr(e.g)), (this.b = vr(e.b)), this
- );
- }
- convertSRGBToLinear() {
- return this.copySRGBToLinear(this), this;
- }
- convertLinearToSRGB() {
- return this.copyLinearToSRGB(this), this;
- }
- getHex(e = yn) {
- return (
- Ut.fromWorkingColorSpace(Xs(this, rt), e),
- (at(rt.r * 255, 0, 255) << 16) ^
- (at(rt.g * 255, 0, 255) << 8) ^
- (at(rt.b * 255, 0, 255) << 0)
- );
- }
- getHexString(e = yn) {
- return ("000000" + this.getHex(e).toString(16)).slice(-6);
- }
- getHSL(e, t = si) {
- Ut.fromWorkingColorSpace(Xs(this, rt), t);
- const n = rt.r,
- i = rt.g,
- s = rt.b,
- a = Math.max(n, i, s),
- o = Math.min(n, i, s);
- let l, c;
- const u = (o + a) / 2;
- if (o === a) (l = 0), (c = 0);
- else {
- const h = a - o;
- switch (((c = u <= 0.5 ? h / (a + o) : h / (2 - a - o)), a)) {
- case n:
- l = (i - s) / h + (i < s ? 6 : 0);
- break;
- case i:
- l = (s - n) / h + 2;
- break;
- case s:
- l = (n - i) / h + 4;
- break;
- }
- l /= 6;
- }
- return (e.h = l), (e.s = c), (e.l = u), e;
- }
- getRGB(e, t = si) {
- return (
- Ut.fromWorkingColorSpace(Xs(this, rt), t),
- (e.r = rt.r),
- (e.g = rt.g),
- (e.b = rt.b),
- e
- );
- }
- getStyle(e = yn) {
- return (
- Ut.fromWorkingColorSpace(Xs(this, rt), e),
- e !== yn
- ? `color(${e} ${rt.r} ${rt.g} ${rt.b})`
- : `rgb(${(rt.r * 255) | 0},${(rt.g * 255) | 0},${
- (rt.b * 255) | 0
- })`
- );
- }
- offsetHSL(e, t, n) {
- return (
- this.getHSL(Bt),
- (Bt.h += e),
- (Bt.s += t),
- (Bt.l += n),
- this.setHSL(Bt.h, Bt.s, Bt.l),
- this
- );
- }
- add(e) {
- return (this.r += e.r), (this.g += e.g), (this.b += e.b), this;
- }
- addColors(e, t) {
- return (
- (this.r = e.r + t.r),
- (this.g = e.g + t.g),
- (this.b = e.b + t.b),
- this
- );
- }
- addScalar(e) {
- return (this.r += e), (this.g += e), (this.b += e), this;
- }
- sub(e) {
- return (
- (this.r = Math.max(0, this.r - e.r)),
- (this.g = Math.max(0, this.g - e.g)),
- (this.b = Math.max(0, this.b - e.b)),
- this
- );
- }
- multiply(e) {
- return (this.r *= e.r), (this.g *= e.g), (this.b *= e.b), this;
- }
- multiplyScalar(e) {
- return (this.r *= e), (this.g *= e), (this.b *= e), this;
- }
- lerp(e, t) {
- return (
- (this.r += (e.r - this.r) * t),
- (this.g += (e.g - this.g) * t),
- (this.b += (e.b - this.b) * t),
- this
- );
- }
- lerpColors(e, t, n) {
- return (
- (this.r = e.r + (t.r - e.r) * n),
- (this.g = e.g + (t.g - e.g) * n),
- (this.b = e.b + (t.b - e.b) * n),
- this
- );
- }
- lerpHSL(e, t) {
- this.getHSL(Bt), e.getHSL(js);
- const n = Ms(Bt.h, js.h, t),
- i = Ms(Bt.s, js.s, t),
- s = Ms(Bt.l, js.l, t);
- return this.setHSL(n, i, s), this;
- }
- equals(e) {
- return e.r === this.r && e.g === this.g && e.b === this.b;
- }
- fromArray(e, t = 0) {
- return (
- (this.r = e[t]), (this.g = e[t + 1]), (this.b = e[t + 2]), this
- );
- }
- toArray(e = [], t = 0) {
- return (e[t] = this.r), (e[t + 1] = this.g), (e[t + 2] = this.b), e;
- }
- fromBufferAttribute(e, t) {
- return (
- (this.r = e.getX(t)),
- (this.g = e.getY(t)),
- (this.b = e.getZ(t)),
- e.normalized === !0 &&
- ((this.r /= 255), (this.g /= 255), (this.b /= 255)),
- this
- );
- }
- toJSON() {
- return this.getHex();
- }
- *[Symbol.iterator]() {
- yield this.r, yield this.g, yield this.b;
- }
- }
- de.NAMES = Hc;
- let vi;
- class Wc {
- static getDataURL(e) {
- if (/^data:/i.test(e.src) || typeof HTMLCanvasElement == "undefined")
- return e.src;
- let t;
- if (e instanceof HTMLCanvasElement) t = e;
- else {
- vi === void 0 && (vi = Cs("canvas")),
- (vi.width = e.width),
- (vi.height = e.height);
- const n = vi.getContext("2d");
- e instanceof ImageData
- ? n.putImageData(e, 0, 0)
- : n.drawImage(e, 0, 0, e.width, e.height),
- (t = vi);
- }
- return t.width > 2048 || t.height > 2048
- ? (console.warn(
- "THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",
- e
- ),
- t.toDataURL("image/jpeg", 0.6))
- : t.toDataURL("image/png");
- }
- static sRGBToLinear(e) {
- if (
- (typeof HTMLImageElement != "undefined" &&
- e instanceof HTMLImageElement) ||
- (typeof HTMLCanvasElement != "undefined" &&
- e instanceof HTMLCanvasElement) ||
- (typeof ImageBitmap != "undefined" && e instanceof ImageBitmap)
- ) {
- const t = Cs("canvas");
- (t.width = e.width), (t.height = e.height);
- const n = t.getContext("2d");
- n.drawImage(e, 0, 0, e.width, e.height);
- const i = n.getImageData(0, 0, e.width, e.height),
- s = i.data;
- for (let a = 0; a < s.length; a++) s[a] = ai(s[a] / 255) * 255;
- return n.putImageData(i, 0, 0), t;
- } else if (e.data) {
- const t = e.data.slice(0);
- for (let n = 0; n < t.length; n++)
- t instanceof Uint8Array || t instanceof Uint8ClampedArray
- ? (t[n] = Math.floor(ai(t[n] / 255) * 255))
- : (t[n] = ai(t[n]));
- return { data: t, width: e.width, height: e.height };
- } else
- return (
- console.warn(
- "THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."
- ),
- e
- );
- }
- }
- class jc {
- constructor(e = null) {
- (this.isSource = !0),
- (this.uuid = Yt()),
- (this.data = e),
- (this.version = 0);
- }
- set needsUpdate(e) {
- e === !0 && this.version++;
- }
- toJSON(e) {
- const t = e === void 0 || typeof e == "string";
- if (!t && e.images[this.uuid] !== void 0) return e.images[this.uuid];
- const n = { uuid: this.uuid, url: "" },
- i = this.data;
- if (i !== null) {
- let s;
- if (Array.isArray(i)) {
- s = [];
- for (let a = 0, o = i.length; a < o; a++)
- i[a].isDataTexture ? s.push(ta(i[a].image)) : s.push(ta(i[a]));
- } else s = ta(i);
- n.url = s;
- }
- return t || (e.images[this.uuid] = n), n;
- }
- }
- function ta(r) {
- return (typeof HTMLImageElement != "undefined" &&
- r instanceof HTMLImageElement) ||
- (typeof HTMLCanvasElement != "undefined" &&
- r instanceof HTMLCanvasElement) ||
- (typeof ImageBitmap != "undefined" && r instanceof ImageBitmap)
- ? Wc.getDataURL(r)
- : r.data
- ? {
- data: Array.prototype.slice.call(r.data),
- width: r.width,
- height: r.height,
- type: r.data.constructor.name,
- }
- : (console.warn("THREE.Texture: Unable to serialize Texture."), {});
- }
- let _d = 0;
- class nt extends hi {
- constructor(
- e = nt.DEFAULT_IMAGE,
- t = nt.DEFAULT_MAPPING,
- n = gt,
- i = gt,
- s = $e,
- a = li,
- o = Nt,
- l = oi,
- c = 1,
- u = Vn
- ) {
- super(),
- (this.isTexture = !0),
- Object.defineProperty(this, "id", { value: _d++ }),
- (this.uuid = Yt()),
- (this.name = ""),
- (this.source = new jc(e)),
- (this.mipmaps = []),
- (this.mapping = t),
- (this.wrapS = n),
- (this.wrapT = i),
- (this.magFilter = s),
- (this.minFilter = a),
- (this.anisotropy = c),
- (this.format = o),
- (this.internalFormat = null),
- (this.type = l),
- (this.offset = new ve(0, 0)),
- (this.repeat = new ve(1, 1)),
- (this.center = new ve(0, 0)),
- (this.rotation = 0),
- (this.matrixAutoUpdate = !0),
- (this.matrix = new Xt()),
- (this.generateMipmaps = !0),
- (this.premultiplyAlpha = !1),
- (this.flipY = !0),
- (this.unpackAlignment = 4),
- (this.encoding = u),
- (this.userData = {}),
- (this.version = 0),
- (this.onUpdate = null),
- (this.isRenderTargetTexture = !1),
- (this.needsPMREMUpdate = !1);
- }
- get image() {
- return this.source.data;
- }
- set image(e) {
- this.source.data = e;
- }
- updateMatrix() {
- this.matrix.setUvTransform(
- this.offset.x,
- this.offset.y,
- this.repeat.x,
- this.repeat.y,
- this.rotation,
- this.center.x,
- this.center.y
- );
- }
- clone() {
- return new this.constructor().copy(this);
- }
- copy(e) {
- return (
- (this.name = e.name),
- (this.source = e.source),
- (this.mipmaps = e.mipmaps.slice(0)),
- (this.mapping = e.mapping),
- (this.wrapS = e.wrapS),
- (this.wrapT = e.wrapT),
- (this.magFilter = e.magFilter),
- (this.minFilter = e.minFilter),
- (this.anisotropy = e.anisotropy),
- (this.format = e.format),
- (this.internalFormat = e.internalFormat),
- (this.type = e.type),
- this.offset.copy(e.offset),
- this.repeat.copy(e.repeat),
- this.center.copy(e.center),
- (this.rotation = e.rotation),
- (this.matrixAutoUpdate = e.matrixAutoUpdate),
- this.matrix.copy(e.matrix),
- (this.generateMipmaps = e.generateMipmaps),
- (this.premultiplyAlpha = e.premultiplyAlpha),
- (this.flipY = e.flipY),
- (this.unpackAlignment = e.unpackAlignment),
- (this.encoding = e.encoding),
- (this.userData = JSON.parse(JSON.stringify(e.userData))),
- (this.needsUpdate = !0),
- this
- );
- }
- toJSON(e) {
- const t = e === void 0 || typeof e == "string";
- if (!t && e.textures[this.uuid] !== void 0)
- return e.textures[this.uuid];
- const n = {
- metadata: {
- version: 4.5,
- type: "Texture",
- generator: "Texture.toJSON",
- },
- uuid: this.uuid,
- name: this.name,
- image: this.source.toJSON(e).uuid,
- mapping: this.mapping,
- repeat: [this.repeat.x, this.repeat.y],
- offset: [this.offset.x, this.offset.y],
- center: [this.center.x, this.center.y],
- rotation: this.rotation,
- wrap: [this.wrapS, this.wrapT],
- format: this.format,
- type: this.type,
- encoding: this.encoding,
- minFilter: this.minFilter,
- magFilter: this.magFilter,
- anisotropy: this.anisotropy,
- flipY: this.flipY,
- premultiplyAlpha: this.premultiplyAlpha,
- unpackAlignment: this.unpackAlignment,
- };
- return (
- JSON.stringify(this.userData) !== "{}" &&
- (n.userData = this.userData),
- t || (e.textures[this.uuid] = n),
- n
- );
- }
- dispose() {
- this.dispatchEvent({ type: "dispose" });
- }
- transformUv(e) {
- if (this.mapping !== zc) return e;
- if ((e.applyMatrix3(this.matrix), e.x < 0 || e.x > 1))
- switch (this.wrapS) {
- case hn:
- e.x = e.x - Math.floor(e.x);
- break;
- case gt:
- e.x = e.x < 0 ? 0 : 1;
- break;
- case Er:
- Math.abs(Math.floor(e.x) % 2) === 1
- ? (e.x = Math.ceil(e.x) - e.x)
- : (e.x = e.x - Math.floor(e.x));
- break;
- }
- if (e.y < 0 || e.y > 1)
- switch (this.wrapT) {
- case hn:
- e.y = e.y - Math.floor(e.y);
- break;
- case gt:
- e.y = e.y < 0 ? 0 : 1;
- break;
- case Er:
- Math.abs(Math.floor(e.y) % 2) === 1
- ? (e.y = Math.ceil(e.y) - e.y)
- : (e.y = e.y - Math.floor(e.y));
- break;
- }
- return this.flipY && (e.y = 1 - e.y), e;
- }
- set needsUpdate(e) {
- e === !0 && (this.version++, (this.source.needsUpdate = !0));
- }
- }
- nt.DEFAULT_IMAGE = null;
- nt.DEFAULT_MAPPING = zc;
- class Ue {
- constructor(e = 0, t = 0, n = 0, i = 1) {
- (this.isVector4 = !0),
- (this.x = e),
- (this.y = t),
- (this.z = n),
- (this.w = i);
- }
- get width() {
- return this.z;
- }
- set width(e) {
- this.z = e;
- }
- get height() {
- return this.w;
- }
- set height(e) {
- this.w = e;
- }
- set(e, t, n, i) {
- return (this.x = e), (this.y = t), (this.z = n), (this.w = i), this;
- }
- setScalar(e) {
- return (this.x = e), (this.y = e), (this.z = e), (this.w = e), this;
- }
- setX(e) {
- return (this.x = e), this;
- }
- setY(e) {
- return (this.y = e), this;
- }
- setZ(e) {
- return (this.z = e), this;
- }
- setW(e) {
- return (this.w = e), this;
- }
- setComponent(e, t) {
- switch (e) {
- case 0:
- this.x = t;
- break;
- case 1:
- this.y = t;
- break;
- case 2:
- this.z = t;
- break;
- case 3:
- this.w = t;
- break;
- default:
- throw new Error("index is out of range: " + e);
- }
- return this;
- }
- getComponent(e) {
- switch (e) {
- case 0:
- return this.x;
- case 1:
- return this.y;
- case 2:
- return this.z;
- case 3:
- return this.w;
- default:
- throw new Error("index is out of range: " + e);
- }
- }
- clone() {
- return new this.constructor(this.x, this.y, this.z, this.w);
- }
- copy(e) {
- return (
- (this.x = e.x),
- (this.y = e.y),
- (this.z = e.z),
- (this.w = e.w !== void 0 ? e.w : 1),
- this
- );
- }
- add(e, t) {
- return t !== void 0
- ? (console.warn(
- "THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."
- ),
- this.addVectors(e, t))
- : ((this.x += e.x),
- (this.y += e.y),
- (this.z += e.z),
- (this.w += e.w),
- this);
- }
- addScalar(e) {
- return (
- (this.x += e), (this.y += e), (this.z += e), (this.w += e), this
- );
- }
- addVectors(e, t) {
- return (
- (this.x = e.x + t.x),
- (this.y = e.y + t.y),
- (this.z = e.z + t.z),
- (this.w = e.w + t.w),
- this
- );
- }
- addScaledVector(e, t) {
- return (
- (this.x += e.x * t),
- (this.y += e.y * t),
- (this.z += e.z * t),
- (this.w += e.w * t),
- this
- );
- }
- sub(e, t) {
- return t !== void 0
- ? (console.warn(
- "THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."
- ),
- this.subVectors(e, t))
- : ((this.x -= e.x),
- (this.y -= e.y),
- (this.z -= e.z),
- (this.w -= e.w),
- this);
- }
- subScalar(e) {
- return (
- (this.x -= e), (this.y -= e), (this.z -= e), (this.w -= e), this
- );
- }
- subVectors(e, t) {
- return (
- (this.x = e.x - t.x),
- (this.y = e.y - t.y),
- (this.z = e.z - t.z),
- (this.w = e.w - t.w),
- this
- );
- }
- multiply(e) {
- return (
- (this.x *= e.x),
- (this.y *= e.y),
- (this.z *= e.z),
- (this.w *= e.w),
- this
- );
- }
- multiplyScalar(e) {
- return (
- (this.x *= e), (this.y *= e), (this.z *= e), (this.w *= e), this
- );
- }
- applyMatrix4(e) {
- const t = this.x,
- n = this.y,
- i = this.z,
- s = this.w,
- a = e.elements;
- return (
- (this.x = a[0] * t + a[4] * n + a[8] * i + a[12] * s),
- (this.y = a[1] * t + a[5] * n + a[9] * i + a[13] * s),
- (this.z = a[2] * t + a[6] * n + a[10] * i + a[14] * s),
- (this.w = a[3] * t + a[7] * n + a[11] * i + a[15] * s),
- this
- );
- }
- divideScalar(e) {
- return this.multiplyScalar(1 / e);
- }
- setAxisAngleFromQuaternion(e) {
- this.w = 2 * Math.acos(e.w);
- const t = Math.sqrt(1 - e.w * e.w);
- return (
- t < 1e-4
- ? ((this.x = 1), (this.y = 0), (this.z = 0))
- : ((this.x = e.x / t), (this.y = e.y / t), (this.z = e.z / t)),
- this
- );
- }
- setAxisAngleFromRotationMatrix(e) {
- let t, n, i, s;
- const l = e.elements,
- c = l[0],
- u = l[4],
- h = l[8],
- d = l[1],
- f = l[5],
- g = l[9],
- m = l[2],
- p = l[6],
- v = l[10];
- if (
- Math.abs(u - d) < 0.01 &&
- Math.abs(h - m) < 0.01 &&
- Math.abs(g - p) < 0.01
- ) {
- if (
- Math.abs(u + d) < 0.1 &&
- Math.abs(h + m) < 0.1 &&
- Math.abs(g + p) < 0.1 &&
- Math.abs(c + f + v - 3) < 0.1
- )
- return this.set(1, 0, 0, 0), this;
- t = Math.PI;
- const x = (c + 1) / 2,
- w = (f + 1) / 2,
- y = (v + 1) / 2,
- A = (u + d) / 4,
- L = (h + m) / 4,
- _ = (g + p) / 4;
- return (
- x > w && x > y
- ? x < 0.01
- ? ((n = 0), (i = 0.707106781), (s = 0.707106781))
- : ((n = Math.sqrt(x)), (i = A / n), (s = L / n))
- : w > y
- ? w < 0.01
- ? ((n = 0.707106781), (i = 0), (s = 0.707106781))
- : ((i = Math.sqrt(w)), (n = A / i), (s = _ / i))
- : y < 0.01
- ? ((n = 0.707106781), (i = 0.707106781), (s = 0))
- : ((s = Math.sqrt(y)), (n = L / s), (i = _ / s)),
- this.set(n, i, s, t),
- this
- );
- }
- let M = Math.sqrt(
- (p - g) * (p - g) + (h - m) * (h - m) + (d - u) * (d - u)
- );
- return (
- Math.abs(M) < 0.001 && (M = 1),
- (this.x = (p - g) / M),
- (this.y = (h - m) / M),
- (this.z = (d - u) / M),
- (this.w = Math.acos((c + f + v - 1) / 2)),
- this
- );
- }
- min(e) {
- return (
- (this.x = Math.min(this.x, e.x)),
- (this.y = Math.min(this.y, e.y)),
- (this.z = Math.min(this.z, e.z)),
- (this.w = Math.min(this.w, e.w)),
- this
- );
- }
- max(e) {
- return (
- (this.x = Math.max(this.x, e.x)),
- (this.y = Math.max(this.y, e.y)),
- (this.z = Math.max(this.z, e.z)),
- (this.w = Math.max(this.w, e.w)),
- this
- );
- }
- clamp(e, t) {
- return (
- (this.x = Math.max(e.x, Math.min(t.x, this.x))),
- (this.y = Math.max(e.y, Math.min(t.y, this.y))),
- (this.z = Math.max(e.z, Math.min(t.z, this.z))),
- (this.w = Math.max(e.w, Math.min(t.w, this.w))),
- this
- );
- }
- clampScalar(e, t) {
- return (
- (this.x = Math.max(e, Math.min(t, this.x))),
- (this.y = Math.max(e, Math.min(t, this.y))),
- (this.z = Math.max(e, Math.min(t, this.z))),
- (this.w = Math.max(e, Math.min(t, this.w))),
- this
- );
- }
- clampLength(e, t) {
- const n = this.length();
- return this.divideScalar(n || 1).multiplyScalar(
- Math.max(e, Math.min(t, n))
- );
- }
- floor() {
- return (
- (this.x = Math.floor(this.x)),
- (this.y = Math.floor(this.y)),
- (this.z = Math.floor(this.z)),
- (this.w = Math.floor(this.w)),
- this
- );
- }
- ceil() {
- return (
- (this.x = Math.ceil(this.x)),
- (this.y = Math.ceil(this.y)),
- (this.z = Math.ceil(this.z)),
- (this.w = Math.ceil(this.w)),
- this
- );
- }
- round() {
- return (
- (this.x = Math.round(this.x)),
- (this.y = Math.round(this.y)),
- (this.z = Math.round(this.z)),
- (this.w = Math.round(this.w)),
- this
- );
- }
- roundToZero() {
- return (
- (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)),
- (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)),
- (this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z)),
- (this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w)),
- this
- );
- }
- negate() {
- return (
- (this.x = -this.x),
- (this.y = -this.y),
- (this.z = -this.z),
- (this.w = -this.w),
- this
- );
- }
- dot(e) {
- return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w;
- }
- lengthSq() {
- return (
- this.x * this.x +
- this.y * this.y +
- this.z * this.z +
- this.w * this.w
- );
- }
- length() {
- return Math.sqrt(
- this.x * this.x +
- this.y * this.y +
- this.z * this.z +
- this.w * this.w
- );
- }
- manhattanLength() {
- return (
- Math.abs(this.x) +
- Math.abs(this.y) +
- Math.abs(this.z) +
- Math.abs(this.w)
- );
- }
- normalize() {
- return this.divideScalar(this.length() || 1);
- }
- setLength(e) {
- return this.normalize().multiplyScalar(e);
- }
- lerp(e, t) {
- return (
- (this.x += (e.x - this.x) * t),
- (this.y += (e.y - this.y) * t),
- (this.z += (e.z - this.z) * t),
- (this.w += (e.w - this.w) * t),
- this
- );
- }
- lerpVectors(e, t, n) {
- return (
- (this.x = e.x + (t.x - e.x) * n),
- (this.y = e.y + (t.y - e.y) * n),
- (this.z = e.z + (t.z - e.z) * n),
- (this.w = e.w + (t.w - e.w) * n),
- this
- );
- }
- equals(e) {
- return (
- e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
- );
- }
- fromArray(e, t = 0) {
- return (
- (this.x = e[t]),
- (this.y = e[t + 1]),
- (this.z = e[t + 2]),
- (this.w = e[t + 3]),
- this
- );
- }
- toArray(e = [], t = 0) {
- return (
- (e[t] = this.x),
- (e[t + 1] = this.y),
- (e[t + 2] = this.z),
- (e[t + 3] = this.w),
- e
- );
- }
- fromBufferAttribute(e, t, n) {
- return (
- n !== void 0 &&
- console.warn(
- "THREE.Vector4: offset has been removed from .fromBufferAttribute()."
- ),
- (this.x = e.getX(t)),
- (this.y = e.getY(t)),
- (this.z = e.getZ(t)),
- (this.w = e.getW(t)),
- this
- );
- }
- random() {
- return (
- (this.x = Math.random()),
- (this.y = Math.random()),
- (this.z = Math.random()),
- (this.w = Math.random()),
- this
- );
- }
- *[Symbol.iterator]() {
- yield this.x, yield this.y, yield this.z, yield this.w;
- }
- }
- class Kt extends hi {
- constructor(e, t, n = {}) {
- super(),
- (this.isWebGLRenderTarget = !0),
- (this.width = e),
- (this.height = t),
- (this.depth = 1),
- (this.scissor = new Ue(0, 0, e, t)),
- (this.scissorTest = !1),
- (this.viewport = new Ue(0, 0, e, t));
- const i = { width: e, height: t, depth: 1 };
- (this.texture = new nt(
- i,
- n.mapping,
- n.wrapS,
- n.wrapT,
- n.magFilter,
- n.minFilter,
- n.format,
- n.type,
- n.anisotropy,
- n.encoding
- )),
- (this.texture.isRenderTargetTexture = !0),
- (this.texture.flipY = !1),
- (this.texture.generateMipmaps =
- n.generateMipmaps !== void 0 ? n.generateMipmaps : !1),
- (this.texture.internalFormat =
- n.internalFormat !== void 0 ? n.internalFormat : null),
- (this.texture.minFilter =
- n.minFilter !== void 0 ? n.minFilter : $e),
- (this.depthBuffer = n.depthBuffer !== void 0 ? n.depthBuffer : !0),
- (this.stencilBuffer =
- n.stencilBuffer !== void 0 ? n.stencilBuffer : !1),
- (this.depthTexture =
- n.depthTexture !== void 0 ? n.depthTexture : null),
- (this.samples = n.samples !== void 0 ? n.samples : 0);
- }
- setSize(e, t, n = 1) {
- (this.width !== e || this.height !== t || this.depth !== n) &&
- ((this.width = e),
- (this.height = t),
- (this.depth = n),
- (this.texture.image.width = e),
- (this.texture.image.height = t),
- (this.texture.image.depth = n),
- this.dispose()),
- this.viewport.set(0, 0, e, t),
- this.scissor.set(0, 0, e, t);
- }
- clone() {
- return new this.constructor().copy(this);
- }
- copy(e) {
- (this.width = e.width),
- (this.height = e.height),
- (this.depth = e.depth),
- this.viewport.copy(e.viewport),
- (this.texture = e.texture.clone()),
- (this.texture.isRenderTargetTexture = !0);
- const t = Object.assign({}, e.texture.image);
- return (
- (this.texture.source = new jc(t)),
- (this.depthBuffer = e.depthBuffer),
- (this.stencilBuffer = e.stencilBuffer),
- e.depthTexture !== null &&
- (this.depthTexture = e.depthTexture.clone()),
- (this.samples = e.samples),
- this
- );
- }
- dispose() {
- this.dispatchEvent({ type: "dispose" });
- }
- }
- class Xc extends nt {
- constructor(e = null, t = 1, n = 1, i = 1) {
- super(null),
- (this.isDataArrayTexture = !0),
- (this.image = { data: e, width: t, height: n, depth: i }),
- (this.magFilter = ft),
- (this.minFilter = ft),
- (this.wrapR = gt),
- (this.generateMipmaps = !1),
- (this.flipY = !1),
- (this.unpackAlignment = 1);
- }
- }
- class xd extends nt {
- constructor(e = null, t = 1, n = 1, i = 1) {
- super(null),
- (this.isData3DTexture = !0),
- (this.image = { data: e, width: t, height: n, depth: i }),
- (this.magFilter = ft),
- (this.minFilter = ft),
- (this.wrapR = gt),
- (this.generateMipmaps = !1),
- (this.flipY = !1),
- (this.unpackAlignment = 1);
- }
- }
- class Mt {
- constructor(e = 0, t = 0, n = 0, i = 1) {
- (this.isQuaternion = !0),
- (this._x = e),
- (this._y = t),
- (this._z = n),
- (this._w = i);
- }
- static slerp(e, t, n, i) {
- return (
- console.warn(
- "THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."
- ),
- n.slerpQuaternions(e, t, i)
- );
- }
- static slerpFlat(e, t, n, i, s, a, o) {
- let l = n[i + 0],
- c = n[i + 1],
- u = n[i + 2],
- h = n[i + 3];
- const d = s[a + 0],
- f = s[a + 1],
- g = s[a + 2],
- m = s[a + 3];
- if (o === 0) {
- (e[t + 0] = l), (e[t + 1] = c), (e[t + 2] = u), (e[t + 3] = h);
- return;
- }
- if (o === 1) {
- (e[t + 0] = d), (e[t + 1] = f), (e[t + 2] = g), (e[t + 3] = m);
- return;
- }
- if (h !== m || l !== d || c !== f || u !== g) {
- let p = 1 - o;
- const v = l * d + c * f + u * g + h * m,
- M = v >= 0 ? 1 : -1,
- x = 1 - v * v;
- if (x > Number.EPSILON) {
- const y = Math.sqrt(x),
- A = Math.atan2(y, v * M);
- (p = Math.sin(p * A) / y), (o = Math.sin(o * A) / y);
- }
- const w = o * M;
- if (
- ((l = l * p + d * w),
- (c = c * p + f * w),
- (u = u * p + g * w),
- (h = h * p + m * w),
- p === 1 - o)
- ) {
- const y = 1 / Math.sqrt(l * l + c * c + u * u + h * h);
- (l *= y), (c *= y), (u *= y), (h *= y);
- }
- }
- (e[t] = l), (e[t + 1] = c), (e[t + 2] = u), (e[t + 3] = h);
- }
- static multiplyQuaternionsFlat(e, t, n, i, s, a) {
- const o = n[i],
- l = n[i + 1],
- c = n[i + 2],
- u = n[i + 3],
- h = s[a],
- d = s[a + 1],
- f = s[a + 2],
- g = s[a + 3];
- return (
- (e[t] = o * g + u * h + l * f - c * d),
- (e[t + 1] = l * g + u * d + c * h - o * f),
- (e[t + 2] = c * g + u * f + o * d - l * h),
- (e[t + 3] = u * g - o * h - l * d - c * f),
- e
- );
- }
- get x() {
- return this._x;
- }
- set x(e) {
- (this._x = e), this._onChangeCallback();
- }
- get y() {
- return this._y;
- }
- set y(e) {
- (this._y = e), this._onChangeCallback();
- }
- get z() {
- return this._z;
- }
- set z(e) {
- (this._z = e), this._onChangeCallback();
- }
- get w() {
- return this._w;
- }
- set w(e) {
- (this._w = e), this._onChangeCallback();
- }
- set(e, t, n, i) {
- return (
- (this._x = e),
- (this._y = t),
- (this._z = n),
- (this._w = i),
- this._onChangeCallback(),
- this
- );
- }
- clone() {
- return new this.constructor(this._x, this._y, this._z, this._w);
- }
- copy(e) {
- return (
- (this._x = e.x),
- (this._y = e.y),
- (this._z = e.z),
- (this._w = e.w),
- this._onChangeCallback(),
- this
- );
- }
- setFromEuler(e, t) {
- if (!(e && e.isEuler))
- throw new Error(
- "THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order."
- );
- const n = e._x,
- i = e._y,
- s = e._z,
- a = e._order,
- o = Math.cos,
- l = Math.sin,
- c = o(n / 2),
- u = o(i / 2),
- h = o(s / 2),
- d = l(n / 2),
- f = l(i / 2),
- g = l(s / 2);
- switch (a) {
- case "XYZ":
- (this._x = d * u * h + c * f * g),
- (this._y = c * f * h - d * u * g),
- (this._z = c * u * g + d * f * h),
- (this._w = c * u * h - d * f * g);
- break;
- case "YXZ":
- (this._x = d * u * h + c * f * g),
- (this._y = c * f * h - d * u * g),
- (this._z = c * u * g - d * f * h),
- (this._w = c * u * h + d * f * g);
- break;
- case "ZXY":
- (this._x = d * u * h - c * f * g),
- (this._y = c * f * h + d * u * g),
- (this._z = c * u * g + d * f * h),
- (this._w = c * u * h - d * f * g);
- break;
- case "ZYX":
- (this._x = d * u * h - c * f * g),
- (this._y = c * f * h + d * u * g),
- (this._z = c * u * g - d * f * h),
- (this._w = c * u * h + d * f * g);
- break;
- case "YZX":
- (this._x = d * u * h + c * f * g),
- (this._y = c * f * h + d * u * g),
- (this._z = c * u * g - d * f * h),
- (this._w = c * u * h - d * f * g);
- break;
- case "XZY":
- (this._x = d * u * h - c * f * g),
- (this._y = c * f * h - d * u * g),
- (this._z = c * u * g + d * f * h),
- (this._w = c * u * h + d * f * g);
- break;
- default:
- console.warn(
- "THREE.Quaternion: .setFromEuler() encountered an unknown order: " +
- a
- );
- }
- return t !== !1 && this._onChangeCallback(), this;
- }
- setFromAxisAngle(e, t) {
- const n = t / 2,
- i = Math.sin(n);
- return (
- (this._x = e.x * i),
- (this._y = e.y * i),
- (this._z = e.z * i),
- (this._w = Math.cos(n)),
- this._onChangeCallback(),
- this
- );
- }
- setFromRotationMatrix(e) {
- const t = e.elements,
- n = t[0],
- i = t[4],
- s = t[8],
- a = t[1],
- o = t[5],
- l = t[9],
- c = t[2],
- u = t[6],
- h = t[10],
- d = n + o + h;
- if (d > 0) {
- const f = 0.5 / Math.sqrt(d + 1);
- (this._w = 0.25 / f),
- (this._x = (u - l) * f),
- (this._y = (s - c) * f),
- (this._z = (a - i) * f);
- } else if (n > o && n > h) {
- const f = 2 * Math.sqrt(1 + n - o - h);
- (this._w = (u - l) / f),
- (this._x = 0.25 * f),
- (this._y = (i + a) / f),
- (this._z = (s + c) / f);
- } else if (o > h) {
- const f = 2 * Math.sqrt(1 + o - n - h);
- (this._w = (s - c) / f),
- (this._x = (i + a) / f),
- (this._y = 0.25 * f),
- (this._z = (l + u) / f);
- } else {
- const f = 2 * Math.sqrt(1 + h - n - o);
- (this._w = (a - i) / f),
- (this._x = (s + c) / f),
- (this._y = (l + u) / f),
- (this._z = 0.25 * f);
- }
- return this._onChangeCallback(), this;
- }
- setFromUnitVectors(e, t) {
- let n = e.dot(t) + 1;
- return (
- n < Number.EPSILON
- ? ((n = 0),
- Math.abs(e.x) > Math.abs(e.z)
- ? ((this._x = -e.y),
- (this._y = e.x),
- (this._z = 0),
- (this._w = n))
- : ((this._x = 0),
- (this._y = -e.z),
- (this._z = e.y),
- (this._w = n)))
- : ((this._x = e.y * t.z - e.z * t.y),
- (this._y = e.z * t.x - e.x * t.z),
- (this._z = e.x * t.y - e.y * t.x),
- (this._w = n)),
- this.normalize()
- );
- }
- angleTo(e) {
- return 2 * Math.acos(Math.abs(at(this.dot(e), -1, 1)));
- }
- rotateTowards(e, t) {
- const n = this.angleTo(e);
- if (n === 0) return this;
- const i = Math.min(1, t / n);
- return this.slerp(e, i), this;
- }
- identity() {
- return this.set(0, 0, 0, 1);
- }
- invert() {
- return this.conjugate();
- }
- conjugate() {
- return (
- (this._x *= -1),
- (this._y *= -1),
- (this._z *= -1),
- this._onChangeCallback(),
- this
- );
- }
- dot(e) {
- return (
- this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
- );
- }
- lengthSq() {
- return (
- this._x * this._x +
- this._y * this._y +
- this._z * this._z +
- this._w * this._w
- );
- }
- length() {
- return Math.sqrt(
- this._x * this._x +
- this._y * this._y +
- this._z * this._z +
- this._w * this._w
- );
- }
- normalize() {
- let e = this.length();
- return (
- e === 0
- ? ((this._x = 0), (this._y = 0), (this._z = 0), (this._w = 1))
- : ((e = 1 / e),
- (this._x = this._x * e),
- (this._y = this._y * e),
- (this._z = this._z * e),
- (this._w = this._w * e)),
- this._onChangeCallback(),
- this
- );
- }
- multiply(e, t) {
- return t !== void 0
- ? (console.warn(
- "THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."
- ),
- this.multiplyQuaternions(e, t))
- : this.multiplyQuaternions(this, e);
- }
- premultiply(e) {
- return this.multiplyQuaternions(e, this);
- }
- multiplyQuaternions(e, t) {
- const n = e._x,
- i = e._y,
- s = e._z,
- a = e._w,
- o = t._x,
- l = t._y,
- c = t._z,
- u = t._w;
- return (
- (this._x = n * u + a * o + i * c - s * l),
- (this._y = i * u + a * l + s * o - n * c),
- (this._z = s * u + a * c + n * l - i * o),
- (this._w = a * u - n * o - i * l - s * c),
- this._onChangeCallback(),
- this
- );
- }
- slerp(e, t) {
- if (t === 0) return this;
- if (t === 1) return this.copy(e);
- const n = this._x,
- i = this._y,
- s = this._z,
- a = this._w;
- let o = a * e._w + n * e._x + i * e._y + s * e._z;
- if (
- (o < 0
- ? ((this._w = -e._w),
- (this._x = -e._x),
- (this._y = -e._y),
- (this._z = -e._z),
- (o = -o))
- : this.copy(e),
- o >= 1)
- )
- return (
- (this._w = a), (this._x = n), (this._y = i), (this._z = s), this
- );
- const l = 1 - o * o;
- if (l <= Number.EPSILON) {
- const f = 1 - t;
- return (
- (this._w = f * a + t * this._w),
- (this._x = f * n + t * this._x),
- (this._y = f * i + t * this._y),
- (this._z = f * s + t * this._z),
- this.normalize(),
- this._onChangeCallback(),
- this
- );
- }
- const c = Math.sqrt(l),
- u = Math.atan2(c, o),
- h = Math.sin((1 - t) * u) / c,
- d = Math.sin(t * u) / c;
- return (
- (this._w = a * h + this._w * d),
- (this._x = n * h + this._x * d),
- (this._y = i * h + this._y * d),
- (this._z = s * h + this._z * d),
- this._onChangeCallback(),
- this
- );
- }
- slerpQuaternions(e, t, n) {
- return this.copy(e).slerp(t, n);
- }
- random() {
- const e = Math.random(),
- t = Math.sqrt(1 - e),
- n = Math.sqrt(e),
- i = 2 * Math.PI * Math.random(),
- s = 2 * Math.PI * Math.random();
- return this.set(
- t * Math.cos(i),
- n * Math.sin(s),
- n * Math.cos(s),
- t * Math.sin(i)
- );
- }
- equals(e) {
- return (
- e._x === this._x &&
- e._y === this._y &&
- e._z === this._z &&
- e._w === this._w
- );
- }
- fromArray(e, t = 0) {
- return (
- (this._x = e[t]),
- (this._y = e[t + 1]),
- (this._z = e[t + 2]),
- (this._w = e[t + 3]),
- this._onChangeCallback(),
- this
- );
- }
- toArray(e = [], t = 0) {
- return (
- (e[t] = this._x),
- (e[t + 1] = this._y),
- (e[t + 2] = this._z),
- (e[t + 3] = this._w),
- e
- );
- }
- fromBufferAttribute(e, t) {
- return (
- (this._x = e.getX(t)),
- (this._y = e.getY(t)),
- (this._z = e.getZ(t)),
- (this._w = e.getW(t)),
- this
- );
- }
- _onChange(e) {
- return (this._onChangeCallback = e), this;
- }
- _onChangeCallback() {}
- *[Symbol.iterator]() {
- yield this._x, yield this._y, yield this._z, yield this._w;
- }
- }
- class P {
- constructor(e = 0, t = 0, n = 0) {
- (this.isVector3 = !0), (this.x = e), (this.y = t), (this.z = n);
- }
- set(e, t, n) {
- return (
- n === void 0 && (n = this.z),
- (this.x = e),
- (this.y = t),
- (this.z = n),
- this
- );
- }
- setScalar(e) {
- return (this.x = e), (this.y = e), (this.z = e), this;
- }
- setX(e) {
- return (this.x = e), this;
- }
- setY(e) {
- return (this.y = e), this;
- }
- setZ(e) {
- return (this.z = e), this;
- }
- setComponent(e, t) {
- switch (e) {
- case 0:
- this.x = t;
- break;
- case 1:
- this.y = t;
- break;
- case 2:
- this.z = t;
- break;
- default:
- throw new Error("index is out of range: " + e);
- }
- return this;
- }
- getComponent(e) {
- switch (e) {
- case 0:
- return this.x;
- case 1:
- return this.y;
- case 2:
- return this.z;
- default:
- throw new Error("index is out of range: " + e);
- }
- }
- clone() {
- return new this.constructor(this.x, this.y, this.z);
- }
- copy(e) {
- return (this.x = e.x), (this.y = e.y), (this.z = e.z), this;
- }
- add(e, t) {
- return t !== void 0
- ? (console.warn(
- "THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."
- ),
- this.addVectors(e, t))
- : ((this.x += e.x), (this.y += e.y), (this.z += e.z), this);
- }
- addScalar(e) {
- return (this.x += e), (this.y += e), (this.z += e), this;
- }
- addVectors(e, t) {
- return (
- (this.x = e.x + t.x),
- (this.y = e.y + t.y),
- (this.z = e.z + t.z),
- this
- );
- }
- addScaledVector(e, t) {
- return (
- (this.x += e.x * t), (this.y += e.y * t), (this.z += e.z * t), this
- );
- }
- sub(e, t) {
- return t !== void 0
- ? (console.warn(
- "THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."
- ),
- this.subVectors(e, t))
- : ((this.x -= e.x), (this.y -= e.y), (this.z -= e.z), this);
- }
- subScalar(e) {
- return (this.x -= e), (this.y -= e), (this.z -= e), this;
- }
- subVectors(e, t) {
- return (
- (this.x = e.x - t.x),
- (this.y = e.y - t.y),
- (this.z = e.z - t.z),
- this
- );
- }
- multiply(e, t) {
- return t !== void 0
- ? (console.warn(
- "THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."
- ),
- this.multiplyVectors(e, t))
- : ((this.x *= e.x), (this.y *= e.y), (this.z *= e.z), this);
- }
- multiplyScalar(e) {
- return (this.x *= e), (this.y *= e), (this.z *= e), this;
- }
- multiplyVectors(e, t) {
- return (
- (this.x = e.x * t.x),
- (this.y = e.y * t.y),
- (this.z = e.z * t.z),
- this
- );
- }
- applyEuler(e) {
- return (
- (e && e.isEuler) ||
- console.error(
- "THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."
- ),
- this.applyQuaternion(cl.setFromEuler(e))
- );
- }
- applyAxisAngle(e, t) {
- return this.applyQuaternion(cl.setFromAxisAngle(e, t));
- }
- applyMatrix3(e) {
- const t = this.x,
- n = this.y,
- i = this.z,
- s = e.elements;
- return (
- (this.x = s[0] * t + s[3] * n + s[6] * i),
- (this.y = s[1] * t + s[4] * n + s[7] * i),
- (this.z = s[2] * t + s[5] * n + s[8] * i),
- this
- );
- }
- applyNormalMatrix(e) {
- return this.applyMatrix3(e).normalize();
- }
- applyMatrix4(e) {
- const t = this.x,
- n = this.y,
- i = this.z,
- s = e.elements,
- a = 1 / (s[3] * t + s[7] * n + s[11] * i + s[15]);
- return (
- (this.x = (s[0] * t + s[4] * n + s[8] * i + s[12]) * a),
- (this.y = (s[1] * t + s[5] * n + s[9] * i + s[13]) * a),
- (this.z = (s[2] * t + s[6] * n + s[10] * i + s[14]) * a),
- this
- );
- }
- applyQuaternion(e) {
- const t = this.x,
- n = this.y,
- i = this.z,
- s = e.x,
- a = e.y,
- o = e.z,
- l = e.w,
- c = l * t + a * i - o * n,
- u = l * n + o * t - s * i,
- h = l * i + s * n - a * t,
- d = -s * t - a * n - o * i;
- return (
- (this.x = c * l + d * -s + u * -o - h * -a),
- (this.y = u * l + d * -a + h * -s - c * -o),
- (this.z = h * l + d * -o + c * -a - u * -s),
- this
- );
- }
- project(e) {
- return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(
- e.projectionMatrix
- );
- }
- unproject(e) {
- return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(
- e.matrixWorld
- );
- }
- transformDirection(e) {
- const t = this.x,
- n = this.y,
- i = this.z,
- s = e.elements;
- return (
- (this.x = s[0] * t + s[4] * n + s[8] * i),
- (this.y = s[1] * t + s[5] * n + s[9] * i),
- (this.z = s[2] * t + s[6] * n + s[10] * i),
- this.normalize()
- );
- }
- divide(e) {
- return (this.x /= e.x), (this.y /= e.y), (this.z /= e.z), this;
- }
- divideScalar(e) {
- return this.multiplyScalar(1 / e);
- }
- min(e) {
- return (
- (this.x = Math.min(this.x, e.x)),
- (this.y = Math.min(this.y, e.y)),
- (this.z = Math.min(this.z, e.z)),
- this
- );
- }
- max(e) {
- return (
- (this.x = Math.max(this.x, e.x)),
- (this.y = Math.max(this.y, e.y)),
- (this.z = Math.max(this.z, e.z)),
- this
- );
- }
- clamp(e, t) {
- return (
- (this.x = Math.max(e.x, Math.min(t.x, this.x))),
- (this.y = Math.max(e.y, Math.min(t.y, this.y))),
- (this.z = Math.max(e.z, Math.min(t.z, this.z))),
- this
- );
- }
- clampScalar(e, t) {
- return (
- (this.x = Math.max(e, Math.min(t, this.x))),
- (this.y = Math.max(e, Math.min(t, this.y))),
- (this.z = Math.max(e, Math.min(t, this.z))),
- this
- );
- }
- clampLength(e, t) {
- const n = this.length();
- return this.divideScalar(n || 1).multiplyScalar(
- Math.max(e, Math.min(t, n))
- );
- }
- floor() {
- return (
- (this.x = Math.floor(this.x)),
- (this.y = Math.floor(this.y)),
- (this.z = Math.floor(this.z)),
- this
- );
- }
- ceil() {
- return (
- (this.x = Math.ceil(this.x)),
- (this.y = Math.ceil(this.y)),
- (this.z = Math.ceil(this.z)),
- this
- );
- }
- round() {
- return (
- (this.x = Math.round(this.x)),
- (this.y = Math.round(this.y)),
- (this.z = Math.round(this.z)),
- this
- );
- }
- roundToZero() {
- return (
- (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)),
- (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)),
- (this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z)),
- this
- );
- }
- negate() {
- return (
- (this.x = -this.x), (this.y = -this.y), (this.z = -this.z), this
- );
- }
- dot(e) {
- return this.x * e.x + this.y * e.y + this.z * e.z;
- }
- lengthSq() {
- return this.x * this.x + this.y * this.y + this.z * this.z;
- }
- length() {
- return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
- }
- manhattanLength() {
- return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z);
- }
- normalize() {
- return this.divideScalar(this.length() || 1);
- }
- setLength(e) {
- return this.normalize().multiplyScalar(e);
- }
- lerp(e, t) {
- return (
- (this.x += (e.x - this.x) * t),
- (this.y += (e.y - this.y) * t),
- (this.z += (e.z - this.z) * t),
- this
- );
- }
- lerpVectors(e, t, n) {
- return (
- (this.x = e.x + (t.x - e.x) * n),
- (this.y = e.y + (t.y - e.y) * n),
- (this.z = e.z + (t.z - e.z) * n),
- this
- );
- }
- cross(e, t) {
- return t !== void 0
- ? (console.warn(
- "THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."
- ),
- this.crossVectors(e, t))
- : this.crossVectors(this, e);
- }
- crossVectors(e, t) {
- const n = e.x,
- i = e.y,
- s = e.z,
- a = t.x,
- o = t.y,
- l = t.z;
- return (
- (this.x = i * l - s * o),
- (this.y = s * a - n * l),
- (this.z = n * o - i * a),
- this
- );
- }
- projectOnVector(e) {
- const t = e.lengthSq();
- if (t === 0) return this.set(0, 0, 0);
- const n = e.dot(this) / t;
- return this.copy(e).multiplyScalar(n);
- }
- projectOnPlane(e) {
- return na.copy(this).projectOnVector(e), this.sub(na);
- }
- reflect(e) {
- return this.sub(na.copy(e).multiplyScalar(2 * this.dot(e)));
- }
- angleTo(e) {
- const t = Math.sqrt(this.lengthSq() * e.lengthSq());
- if (t === 0) return Math.PI / 2;
- const n = this.dot(e) / t;
- return Math.acos(at(n, -1, 1));
- }
- distanceTo(e) {
- return Math.sqrt(this.distanceToSquared(e));
- }
- distanceToSquared(e) {
- const t = this.x - e.x,
- n = this.y - e.y,
- i = this.z - e.z;
- return t * t + n * n + i * i;
- }
- manhattanDistanceTo(e) {
- return (
- Math.abs(this.x - e.x) +
- Math.abs(this.y - e.y) +
- Math.abs(this.z - e.z)
- );
- }
- setFromSpherical(e) {
- return this.setFromSphericalCoords(e.radius, e.phi, e.theta);
- }
- setFromSphericalCoords(e, t, n) {
- const i = Math.sin(t) * e;
- return (
- (this.x = i * Math.sin(n)),
- (this.y = Math.cos(t) * e),
- (this.z = i * Math.cos(n)),
- this
- );
- }
- setFromCylindrical(e) {
- return this.setFromCylindricalCoords(e.radius, e.theta, e.y);
- }
- setFromCylindricalCoords(e, t, n) {
- return (
- (this.x = e * Math.sin(t)),
- (this.y = n),
- (this.z = e * Math.cos(t)),
- this
- );
- }
- setFromMatrixPosition(e) {
- const t = e.elements;
- return (this.x = t[12]), (this.y = t[13]), (this.z = t[14]), this;
- }
- setFromMatrixScale(e) {
- const t = this.setFromMatrixColumn(e, 0).length(),
- n = this.setFromMatrixColumn(e, 1).length(),
- i = this.setFromMatrixColumn(e, 2).length();
- return (this.x = t), (this.y = n), (this.z = i), this;
- }
- setFromMatrixColumn(e, t) {
- return this.fromArray(e.elements, t * 4);
- }
- setFromMatrix3Column(e, t) {
- return this.fromArray(e.elements, t * 3);
- }
- setFromEuler(e) {
- return (this.x = e._x), (this.y = e._y), (this.z = e._z), this;
- }
- equals(e) {
- return e.x === this.x && e.y === this.y && e.z === this.z;
- }
- fromArray(e, t = 0) {
- return (
- (this.x = e[t]), (this.y = e[t + 1]), (this.z = e[t + 2]), this
- );
- }
- toArray(e = [], t = 0) {
- return (e[t] = this.x), (e[t + 1] = this.y), (e[t + 2] = this.z), e;
- }
- fromBufferAttribute(e, t, n) {
- return (
- n !== void 0 &&
- console.warn(
- "THREE.Vector3: offset has been removed from .fromBufferAttribute()."
- ),
- (this.x = e.getX(t)),
- (this.y = e.getY(t)),
- (this.z = e.getZ(t)),
- this
- );
- }
- random() {
- return (
- (this.x = Math.random()),
- (this.y = Math.random()),
- (this.z = Math.random()),
- this
- );
- }
- randomDirection() {
- const e = (Math.random() - 0.5) * 2,
- t = Math.random() * Math.PI * 2,
- n = Math.sqrt(1 - e ** 2);
- return (
- (this.x = n * Math.cos(t)),
- (this.y = n * Math.sin(t)),
- (this.z = e),
- this
- );
- }
- *[Symbol.iterator]() {
- yield this.x, yield this.y, yield this.z;
- }
- }
- const na = new P(),
- cl = new Mt();
- class Ki {
- constructor(
- e = new P(1 / 0, 1 / 0, 1 / 0),
- t = new P(-1 / 0, -1 / 0, -1 / 0)
- ) {
- (this.isBox3 = !0), (this.min = e), (this.max = t);
- }
- set(e, t) {
- return this.min.copy(e), this.max.copy(t), this;
- }
- setFromArray(e) {
- let t = 1 / 0,
- n = 1 / 0,
- i = 1 / 0,
- s = -1 / 0,
- a = -1 / 0,
- o = -1 / 0;
- for (let l = 0, c = e.length; l < c; l += 3) {
- const u = e[l],
- h = e[l + 1],
- d = e[l + 2];
- u < t && (t = u),
- h < n && (n = h),
- d < i && (i = d),
- u > s && (s = u),
- h > a && (a = h),
- d > o && (o = d);
- }
- return this.min.set(t, n, i), this.max.set(s, a, o), this;
- }
- setFromBufferAttribute(e) {
- let t = 1 / 0,
- n = 1 / 0,
- i = 1 / 0,
- s = -1 / 0,
- a = -1 / 0,
- o = -1 / 0;
- for (let l = 0, c = e.count; l < c; l++) {
- const u = e.getX(l),
- h = e.getY(l),
- d = e.getZ(l);
- u < t && (t = u),
- h < n && (n = h),
- d < i && (i = d),
- u > s && (s = u),
- h > a && (a = h),
- d > o && (o = d);
- }
- return this.min.set(t, n, i), this.max.set(s, a, o), this;
- }
- setFromPoints(e) {
- this.makeEmpty();
- for (let t = 0, n = e.length; t < n; t++) this.expandByPoint(e[t]);
- return this;
- }
- setFromCenterAndSize(e, t) {
- const n = Kn.copy(t).multiplyScalar(0.5);
- return this.min.copy(e).sub(n), this.max.copy(e).add(n), this;
- }
- setFromObject(e, t = !1) {
- return this.makeEmpty(), this.expandByObject(e, t);
- }
- clone() {
- return new this.constructor().copy(this);
- }
- copy(e) {
- return this.min.copy(e.min), this.max.copy(e.max), this;
- }
- makeEmpty() {
- return (
- (this.min.x = this.min.y = this.min.z = 1 / 0),
- (this.max.x = this.max.y = this.max.z = -1 / 0),
- this
- );
- }
- isEmpty() {
- return (
- this.max.x < this.min.x ||
- this.max.y < this.min.y ||
- this.max.z < this.min.z
- );
- }
- getCenter(e) {
- return this.isEmpty()
- ? e.set(0, 0, 0)
- : e.addVectors(this.min, this.max).multiplyScalar(0.5);
- }
- getSize(e) {
- return this.isEmpty()
- ? e.set(0, 0, 0)
- : e.subVectors(this.max, this.min);
- }
- expandByPoint(e) {
- return this.min.min(e), this.max.max(e), this;
- }
- expandByVector(e) {
- return this.min.sub(e), this.max.add(e), this;
- }
- expandByScalar(e) {
- return this.min.addScalar(-e), this.max.addScalar(e), this;
- }
- expandByObject(e, t = !1) {
- e.updateWorldMatrix(!1, !1);
- const n = e.geometry;
- if (n !== void 0)
- if (t && n.attributes != null && n.attributes.position !== void 0) {
- const s = n.attributes.position;
- for (let a = 0, o = s.count; a < o; a++)
- Kn.fromBufferAttribute(s, a).applyMatrix4(e.matrixWorld),
- this.expandByPoint(Kn);
- } else
- n.boundingBox === null && n.computeBoundingBox(),
- ia.copy(n.boundingBox),
- ia.applyMatrix4(e.matrixWorld),
- this.union(ia);
- const i = e.children;
- for (let s = 0, a = i.length; s < a; s++)
- this.expandByObject(i[s], t);
- return this;
- }
- containsPoint(e) {
- return !(
- e.x < this.min.x ||
- e.x > this.max.x ||
- e.y < this.min.y ||
- e.y > this.max.y ||
- e.z < this.min.z ||
- e.z > this.max.z
- );
- }
- containsBox(e) {
- return (
- this.min.x <= e.min.x &&
- e.max.x <= this.max.x &&
- this.min.y <= e.min.y &&
- e.max.y <= this.max.y &&
- this.min.z <= e.min.z &&
- e.max.z <= this.max.z
- );
- }
- getParameter(e, t) {
- return t.set(
- (e.x - this.min.x) / (this.max.x - this.min.x),
- (e.y - this.min.y) / (this.max.y - this.min.y),
- (e.z - this.min.z) / (this.max.z - this.min.z)
- );
- }
- intersectsBox(e) {
- return !(
- e.max.x < this.min.x ||
- e.min.x > this.max.x ||
- e.max.y < this.min.y ||
- e.min.y > this.max.y ||
- e.max.z < this.min.z ||
- e.min.z > this.max.z
- );
- }
- intersectsSphere(e) {
- return (
- this.clampPoint(e.center, Kn),
- Kn.distanceToSquared(e.center) <= e.radius * e.radius
- );
- }
- intersectsPlane(e) {
- let t, n;
- return (
- e.normal.x > 0
- ? ((t = e.normal.x * this.min.x), (n = e.normal.x * this.max.x))
- : ((t = e.normal.x * this.max.x), (n = e.normal.x * this.min.x)),
- e.normal.y > 0
- ? ((t += e.normal.y * this.min.y), (n += e.normal.y * this.max.y))
- : ((t += e.normal.y * this.max.y),
- (n += e.normal.y * this.min.y)),
- e.normal.z > 0
- ? ((t += e.normal.z * this.min.z), (n += e.normal.z * this.max.z))
- : ((t += e.normal.z * this.max.z),
- (n += e.normal.z * this.min.z)),
- t <= -e.constant && n >= -e.constant
- );
- }
- intersectsTriangle(e) {
- if (this.isEmpty()) return !1;
- this.getCenter(ds),
- qs.subVectors(this.max, ds),
- _i.subVectors(e.a, ds),
- xi.subVectors(e.b, ds),
- yi.subVectors(e.c, ds),
- Rn.subVectors(xi, _i),
- Pn.subVectors(yi, xi),
- Zn.subVectors(_i, yi);
- let t = [
- 0,
- -Rn.z,
- Rn.y,
- 0,
- -Pn.z,
- Pn.y,
- 0,
- -Zn.z,
- Zn.y,
- Rn.z,
- 0,
- -Rn.x,
- Pn.z,
- 0,
- -Pn.x,
- Zn.z,
- 0,
- -Zn.x,
- -Rn.y,
- Rn.x,
- 0,
- -Pn.y,
- Pn.x,
- 0,
- -Zn.y,
- Zn.x,
- 0,
- ];
- return !sa(t, _i, xi, yi, qs) ||
- ((t = [1, 0, 0, 0, 1, 0, 0, 0, 1]), !sa(t, _i, xi, yi, qs))
- ? !1
- : ($s.crossVectors(Rn, Pn),
- (t = [$s.x, $s.y, $s.z]),
- sa(t, _i, xi, yi, qs));
- }
- clampPoint(e, t) {
- return t.copy(e).clamp(this.min, this.max);
- }
- distanceToPoint(e) {
- return Kn.copy(e).clamp(this.min, this.max).sub(e).length();
- }
- getBoundingSphere(e) {
- return (
- this.getCenter(e.center),
- (e.radius = this.getSize(Kn).length() * 0.5),
- e
- );
- }
- intersect(e) {
- return (
- this.min.max(e.min),
- this.max.min(e.max),
- this.isEmpty() && this.makeEmpty(),
- this
- );
- }
- union(e) {
- return this.min.min(e.min), this.max.max(e.max), this;
- }
- applyMatrix4(e) {
- return this.isEmpty()
- ? this
- : (fn[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e),
- fn[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e),
- fn[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e),
- fn[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e),
- fn[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e),
- fn[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e),
- fn[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e),
- fn[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e),
- this.setFromPoints(fn),
- this);
- }
- translate(e) {
- return this.min.add(e), this.max.add(e), this;
- }
- equals(e) {
- return e.min.equals(this.min) && e.max.equals(this.max);
- }
- }
- const fn = [
- new P(),
- new P(),
- new P(),
- new P(),
- new P(),
- new P(),
- new P(),
- new P(),
- ],
- Kn = new P(),
- ia = new Ki(),
- _i = new P(),
- xi = new P(),
- yi = new P(),
- Rn = new P(),
- Pn = new P(),
- Zn = new P(),
- ds = new P(),
- qs = new P(),
- $s = new P(),
- Jn = new P();
- function sa(r, e, t, n, i) {
- for (let s = 0, a = r.length - 3; s <= a; s += 3) {
- Jn.fromArray(r, s);
- const o =
- i.x * Math.abs(Jn.x) +
- i.y * Math.abs(Jn.y) +
- i.z * Math.abs(Jn.z),
- l = e.dot(Jn),
- c = t.dot(Jn),
- u = n.dot(Jn);
- if (Math.max(-Math.max(l, c, u), Math.min(l, c, u)) > o) return !1;
- }
- return !0;
- }
- const yd = new Ki(),
- hl = new P(),
- Ys = new P(),
- ra = new P();
- class Zi {
- constructor(e = new P(), t = -1) {
- (this.center = e), (this.radius = t);
- }
- set(e, t) {
- return this.center.copy(e), (this.radius = t), this;
- }
- setFromPoints(e, t) {
- const n = this.center;
- t !== void 0 ? n.copy(t) : yd.setFromPoints(e).getCenter(n);
- let i = 0;
- for (let s = 0, a = e.length; s < a; s++)
- i = Math.max(i, n.distanceToSquared(e[s]));
- return (this.radius = Math.sqrt(i)), this;
- }
- copy(e) {
- return this.center.copy(e.center), (this.radius = e.radius), this;
- }
- isEmpty() {
- return this.radius < 0;
- }
- makeEmpty() {
- return this.center.set(0, 0, 0), (this.radius = -1), this;
- }
- containsPoint(e) {
- return e.distanceToSquared(this.center) <= this.radius * this.radius;
- }
- distanceToPoint(e) {
- return e.distanceTo(this.center) - this.radius;
- }
- intersectsSphere(e) {
- const t = this.radius + e.radius;
- return e.center.distanceToSquared(this.center) <= t * t;
- }
- intersectsBox(e) {
- return e.intersectsSphere(this);
- }
- intersectsPlane(e) {
- return Math.abs(e.distanceToPoint(this.center)) <= this.radius;
- }
- clampPoint(e, t) {
- const n = this.center.distanceToSquared(e);
- return (
- t.copy(e),
- n > this.radius * this.radius &&
- (t.sub(this.center).normalize(),
- t.multiplyScalar(this.radius).add(this.center)),
- t
- );
- }
- getBoundingBox(e) {
- return this.isEmpty()
- ? (e.makeEmpty(), e)
- : (e.set(this.center, this.center),
- e.expandByScalar(this.radius),
- e);
- }
- applyMatrix4(e) {
- return (
- this.center.applyMatrix4(e),
- (this.radius = this.radius * e.getMaxScaleOnAxis()),
- this
- );
- }
- translate(e) {
- return this.center.add(e), this;
- }
- expandByPoint(e) {
- ra.subVectors(e, this.center);
- const t = ra.lengthSq();
- if (t > this.radius * this.radius) {
- const n = Math.sqrt(t),
- i = (n - this.radius) * 0.5;
- this.center.add(ra.multiplyScalar(i / n)), (this.radius += i);
- }
- return this;
- }
- union(e) {
- return (
- this.center.equals(e.center) === !0
- ? Ys.set(0, 0, 1).multiplyScalar(e.radius)
- : Ys.subVectors(e.center, this.center)
- .normalize()
- .multiplyScalar(e.radius),
- this.expandByPoint(hl.copy(e.center).add(Ys)),
- this.expandByPoint(hl.copy(e.center).sub(Ys)),
- this
- );
- }
- equals(e) {
- return e.center.equals(this.center) && e.radius === this.radius;
- }
- clone() {
- return new this.constructor().copy(this);
- }
- }
- const pn = new P(),
- aa = new P(),
- Ks = new P(),
- Dn = new P(),
- oa = new P(),
- Zs = new P(),
- la = new P();
- class io {
- constructor(e = new P(), t = new P(0, 0, -1)) {
- (this.origin = e), (this.direction = t);
- }
- set(e, t) {
- return this.origin.copy(e), this.direction.copy(t), this;
- }
- copy(e) {
- return (
- this.origin.copy(e.origin), this.direction.copy(e.direction), this
- );
- }
- at(e, t) {
- return t.copy(this.direction).multiplyScalar(e).add(this.origin);
- }
- lookAt(e) {
- return this.direction.copy(e).sub(this.origin).normalize(), this;
- }
- recast(e) {
- return this.origin.copy(this.at(e, pn)), this;
- }
- closestPointToPoint(e, t) {
- t.subVectors(e, this.origin);
- const n = t.dot(this.direction);
- return n < 0
- ? t.copy(this.origin)
- : t.copy(this.direction).multiplyScalar(n).add(this.origin);
- }
- distanceToPoint(e) {
- return Math.sqrt(this.distanceSqToPoint(e));
- }
- distanceSqToPoint(e) {
- const t = pn.subVectors(e, this.origin).dot(this.direction);
- return t < 0
- ? this.origin.distanceToSquared(e)
- : (pn.copy(this.direction).multiplyScalar(t).add(this.origin),
- pn.distanceToSquared(e));
- }
- distanceSqToSegment(e, t, n, i) {
- aa.copy(e).add(t).multiplyScalar(0.5),
- Ks.copy(t).sub(e).normalize(),
- Dn.copy(this.origin).sub(aa);
- const s = e.distanceTo(t) * 0.5,
- a = -this.direction.dot(Ks),
- o = Dn.dot(this.direction),
- l = -Dn.dot(Ks),
- c = Dn.lengthSq(),
- u = Math.abs(1 - a * a);
- let h, d, f, g;
- if (u > 0)
- if (((h = a * l - o), (d = a * o - l), (g = s * u), h >= 0))
- if (d >= -g)
- if (d <= g) {
- const m = 1 / u;
- (h *= m),
- (d *= m),
- (f = h * (h + a * d + 2 * o) + d * (a * h + d + 2 * l) + c);
- } else
- (d = s),
- (h = Math.max(0, -(a * d + o))),
- (f = -h * h + d * (d + 2 * l) + c);
- else
- (d = -s),
- (h = Math.max(0, -(a * d + o))),
- (f = -h * h + d * (d + 2 * l) + c);
- else
- d <= -g
- ? ((h = Math.max(0, -(-a * s + o))),
- (d = h > 0 ? -s : Math.min(Math.max(-s, -l), s)),
- (f = -h * h + d * (d + 2 * l) + c))
- : d <= g
- ? ((h = 0),
- (d = Math.min(Math.max(-s, -l), s)),
- (f = d * (d + 2 * l) + c))
- : ((h = Math.max(0, -(a * s + o))),
- (d = h > 0 ? s : Math.min(Math.max(-s, -l), s)),
- (f = -h * h + d * (d + 2 * l) + c));
- else
- (d = a > 0 ? -s : s),
- (h = Math.max(0, -(a * d + o))),
- (f = -h * h + d * (d + 2 * l) + c);
- return (
- n && n.copy(this.direction).multiplyScalar(h).add(this.origin),
- i && i.copy(Ks).multiplyScalar(d).add(aa),
- f
- );
- }
- intersectSphere(e, t) {
- pn.subVectors(e.center, this.origin);
- const n = pn.dot(this.direction),
- i = pn.dot(pn) - n * n,
- s = e.radius * e.radius;
- if (i > s) return null;
- const a = Math.sqrt(s - i),
- o = n - a,
- l = n + a;
- return o < 0 && l < 0 ? null : o < 0 ? this.at(l, t) : this.at(o, t);
- }
- intersectsSphere(e) {
- return this.distanceSqToPoint(e.center) <= e.radius * e.radius;
- }
- distanceToPlane(e) {
- const t = e.normal.dot(this.direction);
- if (t === 0) return e.distanceToPoint(this.origin) === 0 ? 0 : null;
- const n = -(this.origin.dot(e.normal) + e.constant) / t;
- return n >= 0 ? n : null;
- }
- intersectPlane(e, t) {
- const n = this.distanceToPlane(e);
- return n === null ? null : this.at(n, t);
- }
- intersectsPlane(e) {
- const t = e.distanceToPoint(this.origin);
- return t === 0 || e.normal.dot(this.direction) * t < 0;
- }
- intersectBox(e, t) {
- let n, i, s, a, o, l;
- const c = 1 / this.direction.x,
- u = 1 / this.direction.y,
- h = 1 / this.direction.z,
- d = this.origin;
- return (
- c >= 0
- ? ((n = (e.min.x - d.x) * c), (i = (e.max.x - d.x) * c))
- : ((n = (e.max.x - d.x) * c), (i = (e.min.x - d.x) * c)),
- u >= 0
- ? ((s = (e.min.y - d.y) * u), (a = (e.max.y - d.y) * u))
- : ((s = (e.max.y - d.y) * u), (a = (e.min.y - d.y) * u)),
- n > a ||
- s > i ||
- ((s > n || n !== n) && (n = s),
- (a < i || i !== i) && (i = a),
- h >= 0
- ? ((o = (e.min.z - d.z) * h), (l = (e.max.z - d.z) * h))
- : ((o = (e.max.z - d.z) * h), (l = (e.min.z - d.z) * h)),
- n > l || o > i) ||
- ((o > n || n !== n) && (n = o),
- (l < i || i !== i) && (i = l),
- i < 0)
- ? null
- : this.at(n >= 0 ? n : i, t)
- );
- }
- intersectsBox(e) {
- return this.intersectBox(e, pn) !== null;
- }
- intersectTriangle(e, t, n, i, s) {
- oa.subVectors(t, e), Zs.subVectors(n, e), la.crossVectors(oa, Zs);
- let a = this.direction.dot(la),
- o;
- if (a > 0) {
- if (i) return null;
- o = 1;
- } else if (a < 0) (o = -1), (a = -a);
- else return null;
- Dn.subVectors(this.origin, e);
- const l = o * this.direction.dot(Zs.crossVectors(Dn, Zs));
- if (l < 0) return null;
- const c = o * this.direction.dot(oa.cross(Dn));
- if (c < 0 || l + c > a) return null;
- const u = -o * Dn.dot(la);
- return u < 0 ? null : this.at(u / a, s);
- }
- applyMatrix4(e) {
- return (
- this.origin.applyMatrix4(e),
- this.direction.transformDirection(e),
- this
- );
- }
- equals(e) {
- return (
- e.origin.equals(this.origin) && e.direction.equals(this.direction)
- );
- }
- clone() {
- return new this.constructor().copy(this);
- }
- }
- class pe {
- constructor() {
- (this.isMatrix4 = !0),
- (this.elements = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
- arguments.length > 0 &&
- console.error(
- "THREE.Matrix4: the constructor no longer reads arguments. use .set() instead."
- );
- }
- set(e, t, n, i, s, a, o, l, c, u, h, d, f, g, m, p) {
- const v = this.elements;
- return (
- (v[0] = e),
- (v[4] = t),
- (v[8] = n),
- (v[12] = i),
- (v[1] = s),
- (v[5] = a),
- (v[9] = o),
- (v[13] = l),
- (v[2] = c),
- (v[6] = u),
- (v[10] = h),
- (v[14] = d),
- (v[3] = f),
- (v[7] = g),
- (v[11] = m),
- (v[15] = p),
- this
- );
- }
- identity() {
- return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this;
- }
- clone() {
- return new pe().fromArray(this.elements);
- }
- copy(e) {
- const t = this.elements,
- n = e.elements;
- return (
- (t[0] = n[0]),
- (t[1] = n[1]),
- (t[2] = n[2]),
- (t[3] = n[3]),
- (t[4] = n[4]),
- (t[5] = n[5]),
- (t[6] = n[6]),
- (t[7] = n[7]),
- (t[8] = n[8]),
- (t[9] = n[9]),
- (t[10] = n[10]),
- (t[11] = n[11]),
- (t[12] = n[12]),
- (t[13] = n[13]),
- (t[14] = n[14]),
- (t[15] = n[15]),
- this
- );
- }
- copyPosition(e) {
- const t = this.elements,
- n = e.elements;
- return (t[12] = n[12]), (t[13] = n[13]), (t[14] = n[14]), this;
- }
- setFromMatrix3(e) {
- const t = e.elements;
- return (
- this.set(
- t[0],
- t[3],
- t[6],
- 0,
- t[1],
- t[4],
- t[7],
- 0,
- t[2],
- t[5],
- t[8],
- 0,
- 0,
- 0,
- 0,
- 1
- ),
- this
- );
- }
- extractBasis(e, t, n) {
- return (
- e.setFromMatrixColumn(this, 0),
- t.setFromMatrixColumn(this, 1),
- n.setFromMatrixColumn(this, 2),
- this
- );
- }
- makeBasis(e, t, n) {
- return (
- this.set(
- e.x,
- t.x,
- n.x,
- 0,
- e.y,
- t.y,
- n.y,
- 0,
- e.z,
- t.z,
- n.z,
- 0,
- 0,
- 0,
- 0,
- 1
- ),
- this
- );
- }
- extractRotation(e) {
- const t = this.elements,
- n = e.elements,
- i = 1 / Mi.setFromMatrixColumn(e, 0).length(),
- s = 1 / Mi.setFromMatrixColumn(e, 1).length(),
- a = 1 / Mi.setFromMatrixColumn(e, 2).length();
- return (
- (t[0] = n[0] * i),
- (t[1] = n[1] * i),
- (t[2] = n[2] * i),
- (t[3] = 0),
- (t[4] = n[4] * s),
- (t[5] = n[5] * s),
- (t[6] = n[6] * s),
- (t[7] = 0),
- (t[8] = n[8] * a),
- (t[9] = n[9] * a),
- (t[10] = n[10] * a),
- (t[11] = 0),
- (t[12] = 0),
- (t[13] = 0),
- (t[14] = 0),
- (t[15] = 1),
- this
- );
- }
- makeRotationFromEuler(e) {
- (e && e.isEuler) ||
- console.error(
- "THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order."
- );
- const t = this.elements,
- n = e.x,
- i = e.y,
- s = e.z,
- a = Math.cos(n),
- o = Math.sin(n),
- l = Math.cos(i),
- c = Math.sin(i),
- u = Math.cos(s),
- h = Math.sin(s);
- if (e.order === "XYZ") {
- const d = a * u,
- f = a * h,
- g = o * u,
- m = o * h;
- (t[0] = l * u),
- (t[4] = -l * h),
- (t[8] = c),
- (t[1] = f + g * c),
- (t[5] = d - m * c),
- (t[9] = -o * l),
- (t[2] = m - d * c),
- (t[6] = g + f * c),
- (t[10] = a * l);
- } else if (e.order === "YXZ") {
- const d = l * u,
- f = l * h,
- g = c * u,
- m = c * h;
- (t[0] = d + m * o),
- (t[4] = g * o - f),
- (t[8] = a * c),
- (t[1] = a * h),
- (t[5] = a * u),
- (t[9] = -o),
- (t[2] = f * o - g),
- (t[6] = m + d * o),
- (t[10] = a * l);
- } else if (e.order === "ZXY") {
- const d = l * u,
- f = l * h,
- g = c * u,
- m = c * h;
- (t[0] = d - m * o),
- (t[4] = -a * h),
- (t[8] = g + f * o),
- (t[1] = f + g * o),
- (t[5] = a * u),
- (t[9] = m - d * o),
- (t[2] = -a * c),
- (t[6] = o),
- (t[10] = a * l);
- } else if (e.order === "ZYX") {
- const d = a * u,
- f = a * h,
- g = o * u,
- m = o * h;
- (t[0] = l * u),
- (t[4] = g * c - f),
- (t[8] = d * c + m),
- (t[1] = l * h),
- (t[5] = m * c + d),
- (t[9] = f * c - g),
- (t[2] = -c),
- (t[6] = o * l),
- (t[10] = a * l);
- } else if (e.order === "YZX") {
- const d = a * l,
- f = a * c,
- g = o * l,
- m = o * c;
- (t[0] = l * u),
- (t[4] = m - d * h),
- (t[8] = g * h + f),
- (t[1] = h),
- (t[5] = a * u),
- (t[9] = -o * u),
- (t[2] = -c * u),
- (t[6] = f * h + g),
- (t[10] = d - m * h);
- } else if (e.order === "XZY") {
- const d = a * l,
- f = a * c,
- g = o * l,
- m = o * c;
- (t[0] = l * u),
- (t[4] = -h),
- (t[8] = c * u),
- (t[1] = d * h + m),
- (t[5] = a * u),
- (t[9] = f * h - g),
- (t[2] = g * h - f),
- (t[6] = o * u),
- (t[10] = m * h + d);
- }
- return (
- (t[3] = 0),
- (t[7] = 0),
- (t[11] = 0),
- (t[12] = 0),
- (t[13] = 0),
- (t[14] = 0),
- (t[15] = 1),
- this
- );
- }
- makeRotationFromQuaternion(e) {
- return this.compose(Md, e, wd);
- }
- lookAt(e, t, n) {
- const i = this.elements;
- return (
- Ct.subVectors(e, t),
- Ct.lengthSq() === 0 && (Ct.z = 1),
- Ct.normalize(),
- In.crossVectors(n, Ct),
- In.lengthSq() === 0 &&
- (Math.abs(n.z) === 1 ? (Ct.x += 1e-4) : (Ct.z += 1e-4),
- Ct.normalize(),
- In.crossVectors(n, Ct)),
- In.normalize(),
- Js.crossVectors(Ct, In),
- (i[0] = In.x),
- (i[4] = Js.x),
- (i[8] = Ct.x),
- (i[1] = In.y),
- (i[5] = Js.y),
- (i[9] = Ct.y),
- (i[2] = In.z),
- (i[6] = Js.z),
- (i[10] = Ct.z),
- this
- );
- }
- multiply(e, t) {
- return t !== void 0
- ? (console.warn(
- "THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."
- ),
- this.multiplyMatrices(e, t))
- : this.multiplyMatrices(this, e);
- }
- premultiply(e) {
- return this.multiplyMatrices(e, this);
- }
- multiplyMatrices(e, t) {
- const n = e.elements,
- i = t.elements,
- s = this.elements,
- a = n[0],
- o = n[4],
- l = n[8],
- c = n[12],
- u = n[1],
- h = n[5],
- d = n[9],
- f = n[13],
- g = n[2],
- m = n[6],
- p = n[10],
- v = n[14],
- M = n[3],
- x = n[7],
- w = n[11],
- y = n[15],
- A = i[0],
- L = i[4],
- _ = i[8],
- T = i[12],
- I = i[1],
- F = i[5],
- H = i[9],
- B = i[13],
- D = i[2],
- z = i[6],
- N = i[10],
- k = i[14],
- G = i[3],
- U = i[7],
- X = i[11],
- Z = i[15];
- return (
- (s[0] = a * A + o * I + l * D + c * G),
- (s[4] = a * L + o * F + l * z + c * U),
- (s[8] = a * _ + o * H + l * N + c * X),
- (s[12] = a * T + o * B + l * k + c * Z),
- (s[1] = u * A + h * I + d * D + f * G),
- (s[5] = u * L + h * F + d * z + f * U),
- (s[9] = u * _ + h * H + d * N + f * X),
- (s[13] = u * T + h * B + d * k + f * Z),
- (s[2] = g * A + m * I + p * D + v * G),
- (s[6] = g * L + m * F + p * z + v * U),
- (s[10] = g * _ + m * H + p * N + v * X),
- (s[14] = g * T + m * B + p * k + v * Z),
- (s[3] = M * A + x * I + w * D + y * G),
- (s[7] = M * L + x * F + w * z + y * U),
- (s[11] = M * _ + x * H + w * N + y * X),
- (s[15] = M * T + x * B + w * k + y * Z),
- this
- );
- }
- multiplyScalar(e) {
- const t = this.elements;
- return (
- (t[0] *= e),
- (t[4] *= e),
- (t[8] *= e),
- (t[12] *= e),
- (t[1] *= e),
- (t[5] *= e),
- (t[9] *= e),
- (t[13] *= e),
- (t[2] *= e),
- (t[6] *= e),
- (t[10] *= e),
- (t[14] *= e),
- (t[3] *= e),
- (t[7] *= e),
- (t[11] *= e),
- (t[15] *= e),
- this
- );
- }
- determinant() {
- const e = this.elements,
- t = e[0],
- n = e[4],
- i = e[8],
- s = e[12],
- a = e[1],
- o = e[5],
- l = e[9],
- c = e[13],
- u = e[2],
- h = e[6],
- d = e[10],
- f = e[14],
- g = e[3],
- m = e[7],
- p = e[11],
- v = e[15];
- return (
- g *
- (+s * l * h -
- i * c * h -
- s * o * d +
- n * c * d +
- i * o * f -
- n * l * f) +
- m *
- (+t * l * f -
- t * c * d +
- s * a * d -
- i * a * f +
- i * c * u -
- s * l * u) +
- p *
- (+t * c * h -
- t * o * f -
- s * a * h +
- n * a * f +
- s * o * u -
- n * c * u) +
- v *
- (-i * o * u -
- t * l * h +
- t * o * d +
- i * a * h -
- n * a * d +
- n * l * u)
- );
- }
- transpose() {
- const e = this.elements;
- let t;
- return (
- (t = e[1]),
- (e[1] = e[4]),
- (e[4] = t),
- (t = e[2]),
- (e[2] = e[8]),
- (e[8] = t),
- (t = e[6]),
- (e[6] = e[9]),
- (e[9] = t),
- (t = e[3]),
- (e[3] = e[12]),
- (e[12] = t),
- (t = e[7]),
- (e[7] = e[13]),
- (e[13] = t),
- (t = e[11]),
- (e[11] = e[14]),
- (e[14] = t),
- this
- );
- }
- setPosition(e, t, n) {
- const i = this.elements;
- return (
- e.isVector3
- ? ((i[12] = e.x), (i[13] = e.y), (i[14] = e.z))
- : ((i[12] = e), (i[13] = t), (i[14] = n)),
- this
- );
- }
- invert() {
- const e = this.elements,
- t = e[0],
- n = e[1],
- i = e[2],
- s = e[3],
- a = e[4],
- o = e[5],
- l = e[6],
- c = e[7],
- u = e[8],
- h = e[9],
- d = e[10],
- f = e[11],
- g = e[12],
- m = e[13],
- p = e[14],
- v = e[15],
- M =
- h * p * c -
- m * d * c +
- m * l * f -
- o * p * f -
- h * l * v +
- o * d * v,
- x =
- g * d * c -
- u * p * c -
- g * l * f +
- a * p * f +
- u * l * v -
- a * d * v,
- w =
- u * m * c -
- g * h * c +
- g * o * f -
- a * m * f -
- u * o * v +
- a * h * v,
- y =
- g * h * l -
- u * m * l -
- g * o * d +
- a * m * d +
- u * o * p -
- a * h * p,
- A = t * M + n * x + i * w + s * y;
- if (A === 0)
- return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
- const L = 1 / A;
- return (
- (e[0] = M * L),
- (e[1] =
- (m * d * s -
- h * p * s -
- m * i * f +
- n * p * f +
- h * i * v -
- n * d * v) *
- L),
- (e[2] =
- (o * p * s -
- m * l * s +
- m * i * c -
- n * p * c -
- o * i * v +
- n * l * v) *
- L),
- (e[3] =
- (h * l * s -
- o * d * s -
- h * i * c +
- n * d * c +
- o * i * f -
- n * l * f) *
- L),
- (e[4] = x * L),
- (e[5] =
- (u * p * s -
- g * d * s +
- g * i * f -
- t * p * f -
- u * i * v +
- t * d * v) *
- L),
- (e[6] =
- (g * l * s -
- a * p * s -
- g * i * c +
- t * p * c +
- a * i * v -
- t * l * v) *
- L),
- (e[7] =
- (a * d * s -
- u * l * s +
- u * i * c -
- t * d * c -
- a * i * f +
- t * l * f) *
- L),
- (e[8] = w * L),
- (e[9] =
- (g * h * s -
- u * m * s -
- g * n * f +
- t * m * f +
- u * n * v -
- t * h * v) *
- L),
- (e[10] =
- (a * m * s -
- g * o * s +
- g * n * c -
- t * m * c -
- a * n * v +
- t * o * v) *
- L),
- (e[11] =
- (u * o * s -
- a * h * s -
- u * n * c +
- t * h * c +
- a * n * f -
- t * o * f) *
- L),
- (e[12] = y * L),
- (e[13] =
- (u * m * i -
- g * h * i +
- g * n * d -
- t * m * d -
- u * n * p +
- t * h * p) *
- L),
- (e[14] =
- (g * o * i -
- a * m * i -
- g * n * l +
- t * m * l +
- a * n * p -
- t * o * p) *
- L),
- (e[15] =
- (a * h * i -
- u * o * i +
- u * n * l -
- t * h * l -
- a * n * d +
- t * o * d) *
- L),
- this
- );
- }
- scale(e) {
- const t = this.elements,
- n = e.x,
- i = e.y,
- s = e.z;
- return (
- (t[0] *= n),
- (t[4] *= i),
- (t[8] *= s),
- (t[1] *= n),
- (t[5] *= i),
- (t[9] *= s),
- (t[2] *= n),
- (t[6] *= i),
- (t[10] *= s),
- (t[3] *= n),
- (t[7] *= i),
- (t[11] *= s),
- this
- );
- }
- getMaxScaleOnAxis() {
- const e = this.elements,
- t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2],
- n = e[4] * e[4] + e[5] * e[5] + e[6] * e[6],
- i = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
- return Math.sqrt(Math.max(t, n, i));
- }
- makeTranslation(e, t, n) {
- return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, n, 0, 0, 0, 1), this;
- }
- makeRotationX(e) {
- const t = Math.cos(e),
- n = Math.sin(e);
- return (
- this.set(1, 0, 0, 0, 0, t, -n, 0, 0, n, t, 0, 0, 0, 0, 1), this
- );
- }
- makeRotationY(e) {
- const t = Math.cos(e),
- n = Math.sin(e);
- return (
- this.set(t, 0, n, 0, 0, 1, 0, 0, -n, 0, t, 0, 0, 0, 0, 1), this
- );
- }
- makeRotationZ(e) {
- const t = Math.cos(e),
- n = Math.sin(e);
- return (
- this.set(t, -n, 0, 0, n, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
- );
- }
- makeRotationAxis(e, t) {
- const n = Math.cos(t),
- i = Math.sin(t),
- s = 1 - n,
- a = e.x,
- o = e.y,
- l = e.z,
- c = s * a,
- u = s * o;
- return (
- this.set(
- c * a + n,
- c * o - i * l,
- c * l + i * o,
- 0,
- c * o + i * l,
- u * o + n,
- u * l - i * a,
- 0,
- c * l - i * o,
- u * l + i * a,
- s * l * l + n,
- 0,
- 0,
- 0,
- 0,
- 1
- ),
- this
- );
- }
- makeScale(e, t, n) {
- return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, n, 0, 0, 0, 0, 1), this;
- }
- makeShear(e, t, n, i, s, a) {
- return this.set(1, n, s, 0, e, 1, a, 0, t, i, 1, 0, 0, 0, 0, 1), this;
- }
- compose(e, t, n) {
- const i = this.elements,
- s = t._x,
- a = t._y,
- o = t._z,
- l = t._w,
- c = s + s,
- u = a + a,
- h = o + o,
- d = s * c,
- f = s * u,
- g = s * h,
- m = a * u,
- p = a * h,
- v = o * h,
- M = l * c,
- x = l * u,
- w = l * h,
- y = n.x,
- A = n.y,
- L = n.z;
- return (
- (i[0] = (1 - (m + v)) * y),
- (i[1] = (f + w) * y),
- (i[2] = (g - x) * y),
- (i[3] = 0),
- (i[4] = (f - w) * A),
- (i[5] = (1 - (d + v)) * A),
- (i[6] = (p + M) * A),
- (i[7] = 0),
- (i[8] = (g + x) * L),
- (i[9] = (p - M) * L),
- (i[10] = (1 - (d + m)) * L),
- (i[11] = 0),
- (i[12] = e.x),
- (i[13] = e.y),
- (i[14] = e.z),
- (i[15] = 1),
- this
- );
- }
- decompose(e, t, n) {
- const i = this.elements;
- let s = Mi.set(i[0], i[1], i[2]).length();
- const a = Mi.set(i[4], i[5], i[6]).length(),
- o = Mi.set(i[8], i[9], i[10]).length();
- this.determinant() < 0 && (s = -s),
- (e.x = i[12]),
- (e.y = i[13]),
- (e.z = i[14]),
- Vt.copy(this);
- const c = 1 / s,
- u = 1 / a,
- h = 1 / o;
- return (
- (Vt.elements[0] *= c),
- (Vt.elements[1] *= c),
- (Vt.elements[2] *= c),
- (Vt.elements[4] *= u),
- (Vt.elements[5] *= u),
- (Vt.elements[6] *= u),
- (Vt.elements[8] *= h),
- (Vt.elements[9] *= h),
- (Vt.elements[10] *= h),
- t.setFromRotationMatrix(Vt),
- (n.x = s),
- (n.y = a),
- (n.z = o),
- this
- );
- }
- makePerspective(e, t, n, i, s, a) {
- a === void 0 &&
- console.warn(
- "THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs."
- );
- const o = this.elements,
- l = (2 * s) / (t - e),
- c = (2 * s) / (n - i),
- u = (t + e) / (t - e),
- h = (n + i) / (n - i),
- d = -(a + s) / (a - s),
- f = (-2 * a * s) / (a - s);
- return (
- (o[0] = l),
- (o[4] = 0),
- (o[8] = u),
- (o[12] = 0),
- (o[1] = 0),
- (o[5] = c),
- (o[9] = h),
- (o[13] = 0),
- (o[2] = 0),
- (o[6] = 0),
- (o[10] = d),
- (o[14] = f),
- (o[3] = 0),
- (o[7] = 0),
- (o[11] = -1),
- (o[15] = 0),
- this
- );
- }
- makeOrthographic(e, t, n, i, s, a) {
- const o = this.elements,
- l = 1 / (t - e),
- c = 1 / (n - i),
- u = 1 / (a - s),
- h = (t + e) * l,
- d = (n + i) * c,
- f = (a + s) * u;
- return (
- (o[0] = 2 * l),
- (o[4] = 0),
- (o[8] = 0),
- (o[12] = -h),
- (o[1] = 0),
- (o[5] = 2 * c),
- (o[9] = 0),
- (o[13] = -d),
- (o[2] = 0),
- (o[6] = 0),
- (o[10] = -2 * u),
- (o[14] = -f),
- (o[3] = 0),
- (o[7] = 0),
- (o[11] = 0),
- (o[15] = 1),
- this
- );
- }
- equals(e) {
- const t = this.elements,
- n = e.elements;
- for (let i = 0; i < 16; i++) if (t[i] !== n[i]) return !1;
- return !0;
- }
- fromArray(e, t = 0) {
- for (let n = 0; n < 16; n++) this.elements[n] = e[n + t];
- return this;
- }
- toArray(e = [], t = 0) {
- const n = this.elements;
- return (
- (e[t] = n[0]),
- (e[t + 1] = n[1]),
- (e[t + 2] = n[2]),
- (e[t + 3] = n[3]),
- (e[t + 4] = n[4]),
- (e[t + 5] = n[5]),
- (e[t + 6] = n[6]),
- (e[t + 7] = n[7]),
- (e[t + 8] = n[8]),
- (e[t + 9] = n[9]),
- (e[t + 10] = n[10]),
- (e[t + 11] = n[11]),
- (e[t + 12] = n[12]),
- (e[t + 13] = n[13]),
- (e[t + 14] = n[14]),
- (e[t + 15] = n[15]),
- e
- );
- }
- }
- const Mi = new P(),
- Vt = new pe(),
- Md = new P(0, 0, 0),
- wd = new P(1, 1, 1),
- In = new P(),
- Js = new P(),
- Ct = new P(),
- ul = new pe(),
- dl = new Mt();
- class an {
- constructor(e = 0, t = 0, n = 0, i = an.DefaultOrder) {
- (this.isEuler = !0),
- (this._x = e),
- (this._y = t),
- (this._z = n),
- (this._order = i);
- }
- get x() {
- return this._x;
- }
- set x(e) {
- (this._x = e), this._onChangeCallback();
- }
- get y() {
- return this._y;
- }
- set y(e) {
- (this._y = e), this._onChangeCallback();
- }
- get z() {
- return this._z;
- }
- set z(e) {
- (this._z = e), this._onChangeCallback();
- }
- get order() {
- return this._order;
- }
- set order(e) {
- (this._order = e), this._onChangeCallback();
- }
- set(e, t, n, i = this._order) {
- return (
- (this._x = e),
- (this._y = t),
- (this._z = n),
- (this._order = i),
- this._onChangeCallback(),
- this
- );
- }
- clone() {
- return new this.constructor(this._x, this._y, this._z, this._order);
- }
- copy(e) {
- return (
- (this._x = e._x),
- (this._y = e._y),
- (this._z = e._z),
- (this._order = e._order),
- this._onChangeCallback(),
- this
- );
- }
- setFromRotationMatrix(e, t = this._order, n = !0) {
- const i = e.elements,
- s = i[0],
- a = i[4],
- o = i[8],
- l = i[1],
- c = i[5],
- u = i[9],
- h = i[2],
- d = i[6],
- f = i[10];
- switch (t) {
- case "XYZ":
- (this._y = Math.asin(at(o, -1, 1))),
- Math.abs(o) < 0.9999999
- ? ((this._x = Math.atan2(-u, f)),
- (this._z = Math.atan2(-a, s)))
- : ((this._x = Math.atan2(d, c)), (this._z = 0));
- break;
- case "YXZ":
- (this._x = Math.asin(-at(u, -1, 1))),
- Math.abs(u) < 0.9999999
- ? ((this._y = Math.atan2(o, f)), (this._z = Math.atan2(l, c)))
- : ((this._y = Math.atan2(-h, s)), (this._z = 0));
- break;
- case "ZXY":
- (this._x = Math.asin(at(d, -1, 1))),
- Math.abs(d) < 0.9999999
- ? ((this._y = Math.atan2(-h, f)),
- (this._z = Math.atan2(-a, c)))
- : ((this._y = 0), (this._z = Math.atan2(l, s)));
- break;
- case "ZYX":
- (this._y = Math.asin(-at(h, -1, 1))),
- Math.abs(h) < 0.9999999
- ? ((this._x = Math.atan2(d, f)), (this._z = Math.atan2(l, s)))
- : ((this._x = 0), (this._z = Math.atan2(-a, c)));
- break;
- case "YZX":
- (this._z = Math.asin(at(l, -1, 1))),
- Math.abs(l) < 0.9999999
- ? ((this._x = Math.atan2(-u, c)),
- (this._y = Math.atan2(-h, s)))
- : ((this._x = 0), (this._y = Math.atan2(o, f)));
- break;
- case "XZY":
- (this._z = Math.asin(-at(a, -1, 1))),
- Math.abs(a) < 0.9999999
- ? ((this._x = Math.atan2(d, c)), (this._y = Math.atan2(o, s)))
- : ((this._x = Math.atan2(-u, f)), (this._y = 0));
- break;
- default:
- console.warn(
- "THREE.Euler: .setFromRotationMatrix() encountered an unknown order: " +
- t
- );
- }
- return (this._order = t), n === !0 && this._onChangeCallback(), this;
- }
- setFromQuaternion(e, t, n) {
- return (
- ul.makeRotationFromQuaternion(e),
- this.setFromRotationMatrix(ul, t, n)
- );
- }
- setFromVector3(e, t = this._order) {
- return this.set(e.x, e.y, e.z, t);
- }
- reorder(e) {
- return dl.setFromEuler(this), this.setFromQuaternion(dl, e);
- }
- equals(e) {
- return (
- e._x === this._x &&
- e._y === this._y &&
- e._z === this._z &&
- e._order === this._order
- );
- }
- fromArray(e) {
- return (
- (this._x = e[0]),
- (this._y = e[1]),
- (this._z = e[2]),
- e[3] !== void 0 && (this._order = e[3]),
- this._onChangeCallback(),
- this
- );
- }
- toArray(e = [], t = 0) {
- return (
- (e[t] = this._x),
- (e[t + 1] = this._y),
- (e[t + 2] = this._z),
- (e[t + 3] = this._order),
- e
- );
- }
- _onChange(e) {
- return (this._onChangeCallback = e), this;
- }
- _onChangeCallback() {}
- *[Symbol.iterator]() {
- yield this._x, yield this._y, yield this._z, yield this._order;
- }
- toVector3() {
- console.error(
- "THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead"
- );
- }
- }
- an.DefaultOrder = "XYZ";
- an.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"];
- class qc {
- constructor() {
- this.mask = 1;
- }
- set(e) {
- this.mask = ((1 << e) | 0) >>> 0;
- }
- enable(e) {
- this.mask |= (1 << e) | 0;
- }
- enableAll() {
- this.mask = -1;
- }
- toggle(e) {
- this.mask ^= (1 << e) | 0;
- }
- disable(e) {
- this.mask &= ~((1 << e) | 0);
- }
- disableAll() {
- this.mask = 0;
- }
- test(e) {
- return (this.mask & e.mask) !== 0;
- }
- isEnabled(e) {
- return (this.mask & ((1 << e) | 0)) !== 0;
- }
- }
- let bd = 0;
- const fl = new P(),
- wi = new Mt(),
- mn = new pe(),
- Qs = new P(),
- fs = new P(),
- Sd = new P(),
- Td = new Mt(),
- pl = new P(1, 0, 0),
- ml = new P(0, 1, 0),
- gl = new P(0, 0, 1),
- Ed = { type: "added" },
- vl = { type: "removed" };
- class Ye extends hi {
- constructor() {
- super(),
- (this.isObject3D = !0),
- Object.defineProperty(this, "id", { value: bd++ }),
- (this.uuid = Yt()),
- (this.name = ""),
- (this.type = "Object3D"),
- (this.parent = null),
- (this.children = []),
- (this.up = Ye.DefaultUp.clone());
- const e = new P(),
- t = new an(),
- n = new Mt(),
- i = new P(1, 1, 1);
- function s() {
- n.setFromEuler(t, !1);
- }
- function a() {
- t.setFromQuaternion(n, void 0, !1);
- }
- t._onChange(s),
- n._onChange(a),
- Object.defineProperties(this, {
- position: { configurable: !0, enumerable: !0, value: e },
- rotation: { configurable: !0, enumerable: !0, value: t },
- quaternion: { configurable: !0, enumerable: !0, value: n },
- scale: { configurable: !0, enumerable: !0, value: i },
- modelViewMatrix: { value: new pe() },
- normalMatrix: { value: new Xt() },
- }),
- (this.matrix = new pe()),
- (this.matrixWorld = new pe()),
- (this.matrixAutoUpdate = Ye.DefaultMatrixAutoUpdate),
- (this.matrixWorldNeedsUpdate = !1),
- (this.layers = new qc()),
- (this.visible = !0),
- (this.castShadow = !1),
- (this.receiveShadow = !1),
- (this.frustumCulled = !0),
- (this.renderOrder = 0),
- (this.animations = []),
- (this.userData = {});
- }
- onBeforeRender() {}
- onAfterRender() {}
- applyMatrix4(e) {
- this.matrixAutoUpdate && this.updateMatrix(),
- this.matrix.premultiply(e),
- this.matrix.decompose(this.position, this.quaternion, this.scale);
- }
- applyQuaternion(e) {
- return this.quaternion.premultiply(e), this;
- }
- setRotationFromAxisAngle(e, t) {
- this.quaternion.setFromAxisAngle(e, t);
- }
- setRotationFromEuler(e) {
- this.quaternion.setFromEuler(e, !0);
- }
- setRotationFromMatrix(e) {
- this.quaternion.setFromRotationMatrix(e);
- }
- setRotationFromQuaternion(e) {
- this.quaternion.copy(e);
- }
- rotateOnAxis(e, t) {
- return wi.setFromAxisAngle(e, t), this.quaternion.multiply(wi), this;
- }
- rotateOnWorldAxis(e, t) {
- return (
- wi.setFromAxisAngle(e, t), this.quaternion.premultiply(wi), this
- );
- }
- rotateX(e) {
- return this.rotateOnAxis(pl, e);
- }
- rotateY(e) {
- return this.rotateOnAxis(ml, e);
- }
- rotateZ(e) {
- return this.rotateOnAxis(gl, e);
- }
- translateOnAxis(e, t) {
- return (
- fl.copy(e).applyQuaternion(this.quaternion),
- this.position.add(fl.multiplyScalar(t)),
- this
- );
- }
- translateX(e) {
- return this.translateOnAxis(pl, e);
- }
- translateY(e) {
- return this.translateOnAxis(ml, e);
- }
- translateZ(e) {
- return this.translateOnAxis(gl, e);
- }
- localToWorld(e) {
- return e.applyMatrix4(this.matrixWorld);
- }
- worldToLocal(e) {
- return e.applyMatrix4(mn.copy(this.matrixWorld).invert());
- }
- lookAt(e, t, n) {
- e.isVector3 ? Qs.copy(e) : Qs.set(e, t, n);
- const i = this.parent;
- this.updateWorldMatrix(!0, !1),
- fs.setFromMatrixPosition(this.matrixWorld),
- this.isCamera || this.isLight
- ? mn.lookAt(fs, Qs, this.up)
- : mn.lookAt(Qs, fs, this.up),
- this.quaternion.setFromRotationMatrix(mn),
- i &&
- (mn.extractRotation(i.matrixWorld),
- wi.setFromRotationMatrix(mn),
- this.quaternion.premultiply(wi.invert()));
- }
- add(e) {
- if (arguments.length > 1) {
- for (let t = 0; t < arguments.length; t++) this.add(arguments[t]);
- return this;
- }
- return e === this
- ? (console.error(
- "THREE.Object3D.add: object can't be added as a child of itself.",
- e
- ),
- this)
- : (e && e.isObject3D
- ? (e.parent !== null && e.parent.remove(e),
- (e.parent = this),
- this.children.push(e),
- e.dispatchEvent(Ed))
- : console.error(
- "THREE.Object3D.add: object not an instance of THREE.Object3D.",
- e
- ),
- this);
- }
- remove(e) {
- if (arguments.length > 1) {
- for (let n = 0; n < arguments.length; n++)
- this.remove(arguments[n]);
- return this;
- }
- const t = this.children.indexOf(e);
- return (
- t !== -1 &&
- ((e.parent = null),
- this.children.splice(t, 1),
- e.dispatchEvent(vl)),
- this
- );
- }
- removeFromParent() {
- const e = this.parent;
- return e !== null && e.remove(this), this;
- }
- clear() {
- for (let e = 0; e < this.children.length; e++) {
- const t = this.children[e];
- (t.parent = null), t.dispatchEvent(vl);
- }
- return (this.children.length = 0), this;
- }
- attach(e) {
- return (
- this.updateWorldMatrix(!0, !1),
- mn.copy(this.matrixWorld).invert(),
- e.parent !== null &&
- (e.parent.updateWorldMatrix(!0, !1),
- mn.multiply(e.parent.matrixWorld)),
- e.applyMatrix4(mn),
- this.add(e),
- e.updateWorldMatrix(!1, !0),
- this
- );
- }
- getObjectById(e) {
- return this.getObjectByProperty("id", e);
- }
- getObjectByName(e) {
- return this.getObjectByProperty("name", e);
- }
- getObjectByProperty(e, t) {
- if (this[e] === t) return this;
- for (let n = 0, i = this.children.length; n < i; n++) {
- const a = this.children[n].getObjectByProperty(e, t);
- if (a !== void 0) return a;
- }
- }
- getWorldPosition(e) {
- return (
- this.updateWorldMatrix(!0, !1),
- e.setFromMatrixPosition(this.matrixWorld)
- );
- }
- getWorldQuaternion(e) {
- return (
- this.updateWorldMatrix(!0, !1),
- this.matrixWorld.decompose(fs, e, Sd),
- e
- );
- }
- getWorldScale(e) {
- return (
- this.updateWorldMatrix(!0, !1),
- this.matrixWorld.decompose(fs, Td, e),
- e
- );
- }
- getWorldDirection(e) {
- this.updateWorldMatrix(!0, !1);
- const t = this.matrixWorld.elements;
- return e.set(t[8], t[9], t[10]).normalize();
- }
- raycast() {}
- traverse(e) {
- e(this);
- const t = this.children;
- for (let n = 0, i = t.length; n < i; n++) t[n].traverse(e);
- }
- traverseVisible(e) {
- if (this.visible === !1) return;
- e(this);
- const t = this.children;
- for (let n = 0, i = t.length; n < i; n++) t[n].traverseVisible(e);
- }
- traverseAncestors(e) {
- const t = this.parent;
- t !== null && (e(t), t.traverseAncestors(e));
- }
- updateMatrix() {
- this.matrix.compose(this.position, this.quaternion, this.scale),
- (this.matrixWorldNeedsUpdate = !0);
- }
- updateMatrixWorld(e) {
- this.matrixAutoUpdate && this.updateMatrix(),
- (this.matrixWorldNeedsUpdate || e) &&
- (this.parent === null
- ? this.matrixWorld.copy(this.matrix)
- : this.matrixWorld.multiplyMatrices(
- this.parent.matrixWorld,
- this.matrix
- ),
- (this.matrixWorldNeedsUpdate = !1),
- (e = !0));
- const t = this.children;
- for (let n = 0, i = t.length; n < i; n++) t[n].updateMatrixWorld(e);
- }
- updateWorldMatrix(e, t) {
- const n = this.parent;
- if (
- (e === !0 && n !== null && n.updateWorldMatrix(!0, !1),
- this.matrixAutoUpdate && this.updateMatrix(),
- this.parent === null
- ? this.matrixWorld.copy(this.matrix)
- : this.matrixWorld.multiplyMatrices(
- this.parent.matrixWorld,
- this.matrix
- ),
- t === !0)
- ) {
- const i = this.children;
- for (let s = 0, a = i.length; s < a; s++)
- i[s].updateWorldMatrix(!1, !0);
- }
- }
- toJSON(e) {
- const t = e === void 0 || typeof e == "string",
- n = {};
- t &&
- ((e = {
- geometries: {},
- materials: {},
- textures: {},
- images: {},
- shapes: {},
- skeletons: {},
- animations: {},
- nodes: {},
- }),
- (n.metadata = {
- version: 4.5,
- type: "Object",
- generator: "Object3D.toJSON",
- }));
- const i = {};
- (i.uuid = this.uuid),
- (i.type = this.type),
- this.name !== "" && (i.name = this.name),
- this.castShadow === !0 && (i.castShadow = !0),
- this.receiveShadow === !0 && (i.receiveShadow = !0),
- this.visible === !1 && (i.visible = !1),
- this.frustumCulled === !1 && (i.frustumCulled = !1),
- this.renderOrder !== 0 && (i.renderOrder = this.renderOrder),
- JSON.stringify(this.userData) !== "{}" &&
- (i.userData = this.userData),
- (i.layers = this.layers.mask),
- (i.matrix = this.matrix.toArray()),
- this.matrixAutoUpdate === !1 && (i.matrixAutoUpdate = !1),
- this.isInstancedMesh &&
- ((i.type = "InstancedMesh"),
- (i.count = this.count),
- (i.instanceMatrix = this.instanceMatrix.toJSON()),
- this.instanceColor !== null &&
- (i.instanceColor = this.instanceColor.toJSON()));
- function s(o, l) {
- return o[l.uuid] === void 0 && (o[l.uuid] = l.toJSON(e)), l.uuid;
- }
- if (this.isScene)
- this.background &&
- (this.background.isColor
- ? (i.background = this.background.toJSON())
- : this.background.isTexture &&
- (i.background = this.background.toJSON(e).uuid)),
- this.environment &&
- this.environment.isTexture &&
- (i.environment = this.environment.toJSON(e).uuid);
- else if (this.isMesh || this.isLine || this.isPoints) {
- i.geometry = s(e.geometries, this.geometry);
- const o = this.geometry.parameters;
- if (o !== void 0 && o.shapes !== void 0) {
- const l = o.shapes;
- if (Array.isArray(l))
- for (let c = 0, u = l.length; c < u; c++) {
- const h = l[c];
- s(e.shapes, h);
- }
- else s(e.shapes, l);
- }
- }
- if (
- (this.isSkinnedMesh &&
- ((i.bindMode = this.bindMode),
- (i.bindMatrix = this.bindMatrix.toArray()),
- this.skeleton !== void 0 &&
- (s(e.skeletons, this.skeleton),
- (i.skeleton = this.skeleton.uuid))),
- this.material !== void 0)
- )
- if (Array.isArray(this.material)) {
- const o = [];
- for (let l = 0, c = this.material.length; l < c; l++)
- o.push(s(e.materials, this.material[l]));
- i.material = o;
- } else i.material = s(e.materials, this.material);
- if (this.children.length > 0) {
- i.children = [];
- for (let o = 0; o < this.children.length; o++)
- i.children.push(this.children[o].toJSON(e).object);
- }
- if (this.animations.length > 0) {
- i.animations = [];
- for (let o = 0; o < this.animations.length; o++) {
- const l = this.animations[o];
- i.animations.push(s(e.animations, l));
- }
- }
- if (t) {
- const o = a(e.geometries),
- l = a(e.materials),
- c = a(e.textures),
- u = a(e.images),
- h = a(e.shapes),
- d = a(e.skeletons),
- f = a(e.animations),
- g = a(e.nodes);
- o.length > 0 && (n.geometries = o),
- l.length > 0 && (n.materials = l),
- c.length > 0 && (n.textures = c),
- u.length > 0 && (n.images = u),
- h.length > 0 && (n.shapes = h),
- d.length > 0 && (n.skeletons = d),
- f.length > 0 && (n.animations = f),
- g.length > 0 && (n.nodes = g);
- }
- return (n.object = i), n;
- function a(o) {
- const l = [];
- for (const c in o) {
- const u = o[c];
- delete u.metadata, l.push(u);
- }
- return l;
- }
- }
- clone(e) {
- return new this.constructor().copy(this, e);
- }
- copy(e, t = !0) {
- if (
- ((this.name = e.name),
- this.up.copy(e.up),
- this.position.copy(e.position),
- (this.rotation.order = e.rotation.order),
- this.quaternion.copy(e.quaternion),
- this.scale.copy(e.scale),
- this.matrix.copy(e.matrix),
- this.matrixWorld.copy(e.matrixWorld),
- (this.matrixAutoUpdate = e.matrixAutoUpdate),
- (this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate),
- (this.layers.mask = e.layers.mask),
- (this.visible = e.visible),
- (this.castShadow = e.castShadow),
- (this.receiveShadow = e.receiveShadow),
- (this.frustumCulled = e.frustumCulled),
- (this.renderOrder = e.renderOrder),
- (this.userData = JSON.parse(JSON.stringify(e.userData))),
- t === !0)
- )
- for (let n = 0; n < e.children.length; n++) {
- const i = e.children[n];
- this.add(i.clone());
- }
- return this;
- }
- }
- Ye.DefaultUp = new P(0, 1, 0);
- Ye.DefaultMatrixAutoUpdate = !0;
- const Gt = new P(),
- gn = new P(),
- ca = new P(),
- vn = new P(),
- bi = new P(),
- Si = new P(),
- _l = new P(),
- ha = new P(),
- ua = new P(),
- da = new P();
- class rn {
- constructor(e = new P(), t = new P(), n = new P()) {
- (this.a = e), (this.b = t), (this.c = n);
- }
- static getNormal(e, t, n, i) {
- i.subVectors(n, t), Gt.subVectors(e, t), i.cross(Gt);
- const s = i.lengthSq();
- return s > 0 ? i.multiplyScalar(1 / Math.sqrt(s)) : i.set(0, 0, 0);
- }
- static getBarycoord(e, t, n, i, s) {
- Gt.subVectors(i, t), gn.subVectors(n, t), ca.subVectors(e, t);
- const a = Gt.dot(Gt),
- o = Gt.dot(gn),
- l = Gt.dot(ca),
- c = gn.dot(gn),
- u = gn.dot(ca),
- h = a * c - o * o;
- if (h === 0) return s.set(-2, -1, -1);
- const d = 1 / h,
- f = (c * l - o * u) * d,
- g = (a * u - o * l) * d;
- return s.set(1 - f - g, g, f);
- }
- static containsPoint(e, t, n, i) {
- return (
- this.getBarycoord(e, t, n, i, vn),
- vn.x >= 0 && vn.y >= 0 && vn.x + vn.y <= 1
- );
- }
- static getUV(e, t, n, i, s, a, o, l) {
- return (
- this.getBarycoord(e, t, n, i, vn),
- l.set(0, 0),
- l.addScaledVector(s, vn.x),
- l.addScaledVector(a, vn.y),
- l.addScaledVector(o, vn.z),
- l
- );
- }
- static isFrontFacing(e, t, n, i) {
- return (
- Gt.subVectors(n, t), gn.subVectors(e, t), Gt.cross(gn).dot(i) < 0
- );
- }
- set(e, t, n) {
- return this.a.copy(e), this.b.copy(t), this.c.copy(n), this;
- }
- setFromPointsAndIndices(e, t, n, i) {
- return this.a.copy(e[t]), this.b.copy(e[n]), this.c.copy(e[i]), this;
- }
- setFromAttributeAndIndices(e, t, n, i) {
- return (
- this.a.fromBufferAttribute(e, t),
- this.b.fromBufferAttribute(e, n),
- this.c.fromBufferAttribute(e, i),
- this
- );
- }
- clone() {
- return new this.constructor().copy(this);
- }
- copy(e) {
- return this.a.copy(e.a), this.b.copy(e.b), this.c.copy(e.c), this;
- }
- getArea() {
- return (
- Gt.subVectors(this.c, this.b),
- gn.subVectors(this.a, this.b),
- Gt.cross(gn).length() * 0.5
- );
- }
- getMidpoint(e) {
- return e
- .addVectors(this.a, this.b)
- .add(this.c)
- .multiplyScalar(1 / 3);
- }
- getNormal(e) {
- return rn.getNormal(this.a, this.b, this.c, e);
- }
- getPlane(e) {
- return e.setFromCoplanarPoints(this.a, this.b, this.c);
- }
- getBarycoord(e, t) {
- return rn.getBarycoord(e, this.a, this.b, this.c, t);
- }
- getUV(e, t, n, i, s) {
- return rn.getUV(e, this.a, this.b, this.c, t, n, i, s);
- }
- containsPoint(e) {
- return rn.containsPoint(e, this.a, this.b, this.c);
- }
- isFrontFacing(e) {
- return rn.isFrontFacing(this.a, this.b, this.c, e);
- }
- intersectsBox(e) {
- return e.intersectsTriangle(this);
- }
- closestPointToPoint(e, t) {
- const n = this.a,
- i = this.b,
- s = this.c;
- let a, o;
- bi.subVectors(i, n), Si.subVectors(s, n), ha.subVectors(e, n);
- const l = bi.dot(ha),
- c = Si.dot(ha);
- if (l <= 0 && c <= 0) return t.copy(n);
- ua.subVectors(e, i);
- const u = bi.dot(ua),
- h = Si.dot(ua);
- if (u >= 0 && h <= u) return t.copy(i);
- const d = l * h - u * c;
- if (d <= 0 && l >= 0 && u <= 0)
- return (a = l / (l - u)), t.copy(n).addScaledVector(bi, a);
- da.subVectors(e, s);
- const f = bi.dot(da),
- g = Si.dot(da);
- if (g >= 0 && f <= g) return t.copy(s);
- const m = f * c - l * g;
- if (m <= 0 && c >= 0 && g <= 0)
- return (o = c / (c - g)), t.copy(n).addScaledVector(Si, o);
- const p = u * g - f * h;
- if (p <= 0 && h - u >= 0 && f - g >= 0)
- return (
- _l.subVectors(s, i),
- (o = (h - u) / (h - u + (f - g))),
- t.copy(i).addScaledVector(_l, o)
- );
- const v = 1 / (p + m + d);
- return (
- (a = m * v),
- (o = d * v),
- t.copy(n).addScaledVector(bi, a).addScaledVector(Si, o)
- );
- }
- equals(e) {
- return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c);
- }
- }
- let Ad = 0;
- class it extends hi {
- constructor() {
- super(),
- (this.isMaterial = !0),
- Object.defineProperty(this, "id", { value: Ad++ }),
- (this.uuid = Yt()),
- (this.name = ""),
- (this.type = "Material"),
- (this.blending = zi),
- (this.side = ki),
- (this.vertexColors = !1),
- (this.opacity = 1),
- (this.transparent = !1),
- (this.blendSrc = Rc),
- (this.blendDst = Pc),
- (this.blendEquation = Di),
- (this.blendSrcAlpha = null),
- (this.blendDstAlpha = null),
- (this.blendEquationAlpha = null),
- (this.depthFunc = Fa),
- (this.depthTest = !0),
- (this.depthWrite = !0),
- (this.stencilWriteMask = 255),
- (this.stencilFunc = nd),
- (this.stencilRef = 0),
- (this.stencilFuncMask = 255),
- (this.stencilFail = Jr),
- (this.stencilZFail = Jr),
- (this.stencilZPass = Jr),
- (this.stencilWrite = !1),
- (this.clippingPlanes = null),
- (this.clipIntersection = !1),
- (this.clipShadows = !1),
- (this.shadowSide = null),
- (this.colorWrite = !0),
- (this.precision = null),
- (this.polygonOffset = !1),
- (this.polygonOffsetFactor = 0),
- (this.polygonOffsetUnits = 0),
- (this.dithering = !1),
- (this.alphaToCoverage = !1),
- (this.premultipliedAlpha = !1),
- (this.visible = !0),
- (this.toneMapped = !0),
- (this.userData = {}),
- (this.version = 0),
- (this._alphaTest = 0);
- }
- get alphaTest() {
- return this._alphaTest;
- }
- set alphaTest(e) {
- this._alphaTest > 0 != e > 0 && this.version++, (this._alphaTest = e);
- }
- onBuild() {}
- onBeforeRender() {}
- onBeforeCompile() {}
- customProgramCacheKey() {
- return this.onBeforeCompile.toString();
- }
- setValues(e) {
- if (e !== void 0)
- for (const t in e) {
- const n = e[t];
- if (n === void 0) {
- console.warn(
- "THREE.Material: '" + t + "' parameter is undefined."
- );
- continue;
- }
- if (t === "shading") {
- console.warn(
- "THREE." +
- this.type +
- ": .shading has been removed. Use the boolean .flatShading instead."
- ),
- (this.flatShading = n === fu);
- continue;
- }
- const i = this[t];
- if (i === void 0) {
- console.warn(
- "THREE." +
- this.type +
- ": '" +
- t +
- "' is not a property of this material."
- );
- continue;
- }
- i && i.isColor
- ? i.set(n)
- : i && i.isVector3 && n && n.isVector3
- ? i.copy(n)
- : (this[t] = n);
- }
- }
- toJSON(e) {
- const t = e === void 0 || typeof e == "string";
- t && (e = { textures: {}, images: {} });
- const n = {
- metadata: {
- version: 4.5,
- type: "Material",
- generator: "Material.toJSON",
- },
- };
- (n.uuid = this.uuid),
- (n.type = this.type),
- this.name !== "" && (n.name = this.name),
- this.color && this.color.isColor && (n.color = this.color.getHex()),
- this.roughness !== void 0 && (n.roughness = this.roughness),
- this.metalness !== void 0 && (n.metalness = this.metalness),
- this.sheen !== void 0 && (n.sheen = this.sheen),
- this.sheenColor &&
- this.sheenColor.isColor &&
- (n.sheenColor = this.sheenColor.getHex()),
- this.sheenRoughness !== void 0 &&
- (n.sheenRoughness = this.sheenRoughness),
- this.emissive &&
- this.emissive.isColor &&
- (n.emissive = this.emissive.getHex()),
- this.emissiveIntensity &&
- this.emissiveIntensity !== 1 &&
- (n.emissiveIntensity = this.emissiveIntensity),
- this.specular &&
- this.specular.isColor &&
- (n.specular = this.specular.getHex()),
- this.specularIntensity !== void 0 &&
- (n.specularIntensity = this.specularIntensity),
- this.specularColor &&
- this.specularColor.isColor &&
- (n.specularColor = this.specularColor.getHex()),
- this.shininess !== void 0 && (n.shininess = this.shininess),
- this.clearcoat !== void 0 && (n.clearcoat = this.clearcoat),
- this.clearcoatRoughness !== void 0 &&
- (n.clearcoatRoughness = this.clearcoatRoughness),
- this.clearcoatMap &&
- this.clearcoatMap.isTexture &&
- (n.clearcoatMap = this.clearcoatMap.toJSON(e).uuid),
- this.clearcoatRoughnessMap &&
- this.clearcoatRoughnessMap.isTexture &&
- (n.clearcoatRoughnessMap =
- this.clearcoatRoughnessMap.toJSON(e).uuid),
- this.clearcoatNormalMap &&
- this.clearcoatNormalMap.isTexture &&
- ((n.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(e).uuid),
- (n.clearcoatNormalScale = this.clearcoatNormalScale.toArray())),
- this.iridescence !== void 0 && (n.iridescence = this.iridescence),
- this.iridescenceIOR !== void 0 &&
- (n.iridescenceIOR = this.iridescenceIOR),
- this.iridescenceThicknessRange !== void 0 &&
- (n.iridescenceThicknessRange = this.iridescenceThicknessRange),
- this.iridescenceMap &&
- this.iridescenceMap.isTexture &&
- (n.iridescenceMap = this.iridescenceMap.toJSON(e).uuid),
- this.iridescenceThicknessMap &&
- this.iridescenceThicknessMap.isTexture &&
- (n.iridescenceThicknessMap =
- this.iridescenceThicknessMap.toJSON(e).uuid),
- this.map && this.map.isTexture && (n.map = this.map.toJSON(e).uuid),
- this.matcap &&
- this.matcap.isTexture &&
- (n.matcap = this.matcap.toJSON(e).uuid),
- this.alphaMap &&
- this.alphaMap.isTexture &&
- (n.alphaMap = this.alphaMap.toJSON(e).uuid),
- this.lightMap &&
- this.lightMap.isTexture &&
- ((n.lightMap = this.lightMap.toJSON(e).uuid),
- (n.lightMapIntensity = this.lightMapIntensity)),
- this.aoMap &&
- this.aoMap.isTexture &&
- ((n.aoMap = this.aoMap.toJSON(e).uuid),
- (n.aoMapIntensity = this.aoMapIntensity)),
- this.bumpMap &&
- this.bumpMap.isTexture &&
- ((n.bumpMap = this.bumpMap.toJSON(e).uuid),
- (n.bumpScale = this.bumpScale)),
- this.normalMap &&
- this.normalMap.isTexture &&
- ((n.normalMap = this.normalMap.toJSON(e).uuid),
- (n.normalMapType = this.normalMapType),
- (n.normalScale = this.normalScale.toArray())),
- this.displacementMap &&
- this.displacementMap.isTexture &&
- ((n.displacementMap = this.displacementMap.toJSON(e).uuid),
- (n.displacementScale = this.displacementScale),
- (n.displacementBias = this.displacementBias)),
- this.roughnessMap &&
- this.roughnessMap.isTexture &&
- (n.roughnessMap = this.roughnessMap.toJSON(e).uuid),
- this.metalnessMap &&
- this.metalnessMap.isTexture &&
- (n.metalnessMap = this.metalnessMap.toJSON(e).uuid),
- this.emissiveMap &&
- this.emissiveMap.isTexture &&
- (n.emissiveMap = this.emissiveMap.toJSON(e).uuid),
- this.specularMap &&
- this.specularMap.isTexture &&
- (n.specularMap = this.specularMap.toJSON(e).uuid),
- this.specularIntensityMap &&
- this.specularIntensityMap.isTexture &&
- (n.specularIntensityMap =
- this.specularIntensityMap.toJSON(e).uuid),
- this.specularColorMap &&
- this.specularColorMap.isTexture &&
- (n.specularColorMap = this.specularColorMap.toJSON(e).uuid),
- this.envMap &&
- this.envMap.isTexture &&
- ((n.envMap = this.envMap.toJSON(e).uuid),
- this.combine !== void 0 && (n.combine = this.combine)),
- this.envMapIntensity !== void 0 &&
- (n.envMapIntensity = this.envMapIntensity),
- this.reflectivity !== void 0 &&
- (n.reflectivity = this.reflectivity),
- this.refractionRatio !== void 0 &&
- (n.refractionRatio = this.refractionRatio),
- this.gradientMap &&
- this.gradientMap.isTexture &&
- (n.gradientMap = this.gradientMap.toJSON(e).uuid),
- this.transmission !== void 0 &&
- (n.transmission = this.transmission),
- this.transmissionMap &&
- this.transmissionMap.isTexture &&
- (n.transmissionMap = this.transmissionMap.toJSON(e).uuid),
- this.thickness !== void 0 && (n.thickness = this.thickness),
- this.thicknessMap &&
- this.thicknessMap.isTexture &&
- (n.thicknessMap = this.thicknessMap.toJSON(e).uuid),
- this.attenuationDistance !== void 0 &&
- (n.attenuationDistance = this.attenuationDistance),
- this.attenuationColor !== void 0 &&
- (n.attenuationColor = this.attenuationColor.getHex()),
- this.size !== void 0 && (n.size = this.size),
- this.shadowSide !== null && (n.shadowSide = this.shadowSide),
- this.sizeAttenuation !== void 0 &&
- (n.sizeAttenuation = this.sizeAttenuation),
- this.blending !== zi && (n.blending = this.blending),
- this.side !== ki && (n.side = this.side),
- this.vertexColors && (n.vertexColors = !0),
- this.opacity < 1 && (n.opacity = this.opacity),
- this.transparent === !0 && (n.transparent = this.transparent),
- (n.depthFunc = this.depthFunc),
- (n.depthTest = this.depthTest),
- (n.depthWrite = this.depthWrite),
- (n.colorWrite = this.colorWrite),
- (n.stencilWrite = this.stencilWrite),
- (n.stencilWriteMask = this.stencilWriteMask),
- (n.stencilFunc = this.stencilFunc),
- (n.stencilRef = this.stencilRef),
- (n.stencilFuncMask = this.stencilFuncMask),
- (n.stencilFail = this.stencilFail),
- (n.stencilZFail = this.stencilZFail),
- (n.stencilZPass = this.stencilZPass),
- this.rotation !== void 0 &&
- this.rotation !== 0 &&
- (n.rotation = this.rotation),
- this.polygonOffset === !0 && (n.polygonOffset = !0),
- this.polygonOffsetFactor !== 0 &&
- (n.polygonOffsetFactor = this.polygonOffsetFactor),
- this.polygonOffsetUnits !== 0 &&
- (n.polygonOffsetUnits = this.polygonOffsetUnits),
- this.linewidth !== void 0 &&
- this.linewidth !== 1 &&
- (n.linewidth = this.linewidth),
- this.dashSize !== void 0 && (n.dashSize = this.dashSize),
- this.gapSize !== void 0 && (n.gapSize = this.gapSize),
- this.scale !== void 0 && (n.scale = this.scale),
- this.dithering === !0 && (n.dithering = !0),
- this.alphaTest > 0 && (n.alphaTest = this.alphaTest),
- this.alphaToCoverage === !0 &&
- (n.alphaToCoverage = this.alphaToCoverage),
- this.premultipliedAlpha === !0 &&
- (n.premultipliedAlpha = this.premultipliedAlpha),
- this.wireframe === !0 && (n.wireframe = this.wireframe),
- this.wireframeLinewidth > 1 &&
- (n.wireframeLinewidth = this.wireframeLinewidth),
- this.wireframeLinecap !== "round" &&
- (n.wireframeLinecap = this.wireframeLinecap),
- this.wireframeLinejoin !== "round" &&
- (n.wireframeLinejoin = this.wireframeLinejoin),
- this.flatShading === !0 && (n.flatShading = this.flatShading),
- this.visible === !1 && (n.visible = !1),
- this.toneMapped === !1 && (n.toneMapped = !1),
- this.fog === !1 && (n.fog = !1),
- JSON.stringify(this.userData) !== "{}" &&
- (n.userData = this.userData);
- function i(s) {
- const a = [];
- for (const o in s) {
- const l = s[o];
- delete l.metadata, a.push(l);
- }
- return a;
- }
- if (t) {
- const s = i(e.textures),
- a = i(e.images);
- s.length > 0 && (n.textures = s), a.length > 0 && (n.images = a);
- }
- return n;
- }
- clone() {
- return new this.constructor().copy(this);
- }
- copy(e) {
- (this.name = e.name),
- (this.blending = e.blending),
- (this.side = e.side),
- (this.vertexColors = e.vertexColors),
- (this.opacity = e.opacity),
- (this.transparent = e.transparent),
- (this.blendSrc = e.blendSrc),
- (this.blendDst = e.blendDst),
- (this.blendEquation = e.blendEquation),
- (this.blendSrcAlpha = e.blendSrcAlpha),
- (this.blendDstAlpha = e.blendDstAlpha),
- (this.blendEquationAlpha = e.blendEquationAlpha),
- (this.depthFunc = e.depthFunc),
- (this.depthTest = e.depthTest),
- (this.depthWrite = e.depthWrite),
- (this.stencilWriteMask = e.stencilWriteMask),
- (this.stencilFunc = e.stencilFunc),
- (this.stencilRef = e.stencilRef),
- (this.stencilFuncMask = e.stencilFuncMask),
- (this.stencilFail = e.stencilFail),
- (this.stencilZFail = e.stencilZFail),
- (this.stencilZPass = e.stencilZPass),
- (this.stencilWrite = e.stencilWrite);
- const t = e.clippingPlanes;
- let n = null;
- if (t !== null) {
- const i = t.length;
- n = new Array(i);
- for (let s = 0; s !== i; ++s) n[s] = t[s].clone();
- }
- return (
- (this.clippingPlanes = n),
- (this.clipIntersection = e.clipIntersection),
- (this.clipShadows = e.clipShadows),
- (this.shadowSide = e.shadowSide),
- (this.colorWrite = e.colorWrite),
- (this.precision = e.precision),
- (this.polygonOffset = e.polygonOffset),
- (this.polygonOffsetFactor = e.polygonOffsetFactor),
- (this.polygonOffsetUnits = e.polygonOffsetUnits),
- (this.dithering = e.dithering),
- (this.alphaTest = e.alphaTest),
- (this.alphaToCoverage = e.alphaToCoverage),
- (this.premultipliedAlpha = e.premultipliedAlpha),
- (this.visible = e.visible),
- (this.toneMapped = e.toneMapped),
- (this.userData = JSON.parse(JSON.stringify(e.userData))),
- this
- );
- }
- dispose() {
- this.dispatchEvent({ type: "dispose" });
- }
- set needsUpdate(e) {
- e === !0 && this.version++;
- }
- get vertexTangents() {
- return (
- console.warn(
- "THREE." + this.type + ": .vertexTangents has been removed."
- ),
- !1
- );
- }
- set vertexTangents(e) {
- console.warn(
- "THREE." + this.type + ": .vertexTangents has been removed."
- );
- }
- }
- it.fromType = function () {
- return null;
- };
- class wn extends it {
- constructor(e) {
- super(),
- (this.isMeshBasicMaterial = !0),
- (this.type = "MeshBasicMaterial"),
- (this.color = new de(16777215)),
- (this.map = null),
- (this.lightMap = null),
- (this.lightMapIntensity = 1),
- (this.aoMap = null),
- (this.aoMapIntensity = 1),
- (this.specularMap = null),
- (this.alphaMap = null),
- (this.envMap = null),
- (this.combine = zr),
- (this.reflectivity = 1),
- (this.refractionRatio = 0.98),
- (this.wireframe = !1),
- (this.wireframeLinewidth = 1),
- (this.wireframeLinecap = "round"),
- (this.wireframeLinejoin = "round"),
- (this.fog = !0),
- this.setValues(e);
- }
- copy(e) {
- return (
- super.copy(e),
- this.color.copy(e.color),
- (this.map = e.map),
- (this.lightMap = e.lightMap),
- (this.lightMapIntensity = e.lightMapIntensity),
- (this.aoMap = e.aoMap),
- (this.aoMapIntensity = e.aoMapIntensity),
- (this.specularMap = e.specularMap),
- (this.alphaMap = e.alphaMap),
- (this.envMap = e.envMap),
- (this.combine = e.combine),
- (this.reflectivity = e.reflectivity),
- (this.refractionRatio = e.refractionRatio),
- (this.wireframe = e.wireframe),
- (this.wireframeLinewidth = e.wireframeLinewidth),
- (this.wireframeLinecap = e.wireframeLinecap),
- (this.wireframeLinejoin = e.wireframeLinejoin),
- (this.fog = e.fog),
- this
- );
- }
- }
- const tt = new P(),
- er = new ve();
- class wt {
- constructor(e, t, n) {
- if (Array.isArray(e))
- throw new TypeError(
- "THREE.BufferAttribute: array should be a Typed Array."
- );
- (this.isBufferAttribute = !0),
- (this.name = ""),
- (this.array = e),
- (this.itemSize = t),
- (this.count = e !== void 0 ? e.length / t : 0),
- (this.normalized = n === !0),
- (this.usage = ka),
- (this.updateRange = { offset: 0, count: -1 }),
- (this.version = 0);
- }
- onUploadCallback() {}
- set needsUpdate(e) {
- e === !0 && this.version++;
- }
- setUsage(e) {
- return (this.usage = e), this;
- }
- copy(e) {
- return (
- (this.name = e.name),
- (this.array = new e.array.constructor(e.array)),
- (this.itemSize = e.itemSize),
- (this.count = e.count),
- (this.normalized = e.normalized),
- (this.usage = e.usage),
- this
- );
- }
- copyAt(e, t, n) {
- (e *= this.itemSize), (n *= t.itemSize);
- for (let i = 0, s = this.itemSize; i < s; i++)
- this.array[e + i] = t.array[n + i];
- return this;
- }
- copyArray(e) {
- return this.array.set(e), this;
- }
- copyColorsArray(e) {
- const t = this.array;
- let n = 0;
- for (let i = 0, s = e.length; i < s; i++) {
- let a = e[i];
- a === void 0 &&
- (console.warn(
- "THREE.BufferAttribute.copyColorsArray(): color is undefined",
- i
- ),
- (a = new de())),
- (t[n++] = a.r),
- (t[n++] = a.g),
- (t[n++] = a.b);
- }
- return this;
- }
- copyVector2sArray(e) {
- const t = this.array;
- let n = 0;
- for (let i = 0, s = e.length; i < s; i++) {
- let a = e[i];
- a === void 0 &&
- (console.warn(
- "THREE.BufferAttribute.copyVector2sArray(): vector is undefined",
- i
- ),
- (a = new ve())),
- (t[n++] = a.x),
- (t[n++] = a.y);
- }
- return this;
- }
- copyVector3sArray(e) {
- const t = this.array;
- let n = 0;
- for (let i = 0, s = e.length; i < s; i++) {
- let a = e[i];
- a === void 0 &&
- (console.warn(
- "THREE.BufferAttribute.copyVector3sArray(): vector is undefined",
- i
- ),
- (a = new P())),
- (t[n++] = a.x),
- (t[n++] = a.y),
- (t[n++] = a.z);
- }
- return this;
- }
- copyVector4sArray(e) {
- const t = this.array;
- let n = 0;
- for (let i = 0, s = e.length; i < s; i++) {
- let a = e[i];
- a === void 0 &&
- (console.warn(
- "THREE.BufferAttribute.copyVector4sArray(): vector is undefined",
- i
- ),
- (a = new Ue())),
- (t[n++] = a.x),
- (t[n++] = a.y),
- (t[n++] = a.z),
- (t[n++] = a.w);
- }
- return this;
- }
- applyMatrix3(e) {
- if (this.itemSize === 2)
- for (let t = 0, n = this.count; t < n; t++)
- er.fromBufferAttribute(this, t),
- er.applyMatrix3(e),
- this.setXY(t, er.x, er.y);
- else if (this.itemSize === 3)
- for (let t = 0, n = this.count; t < n; t++)
- tt.fromBufferAttribute(this, t),
- tt.applyMatrix3(e),
- this.setXYZ(t, tt.x, tt.y, tt.z);
- return this;
- }
- applyMatrix4(e) {
- for (let t = 0, n = this.count; t < n; t++)
- tt.fromBufferAttribute(this, t),
- tt.applyMatrix4(e),
- this.setXYZ(t, tt.x, tt.y, tt.z);
- return this;
- }
- applyNormalMatrix(e) {
- for (let t = 0, n = this.count; t < n; t++)
- tt.fromBufferAttribute(this, t),
- tt.applyNormalMatrix(e),
- this.setXYZ(t, tt.x, tt.y, tt.z);
- return this;
- }
- transformDirection(e) {
- for (let t = 0, n = this.count; t < n; t++)
- tt.fromBufferAttribute(this, t),
- tt.transformDirection(e),
- this.setXYZ(t, tt.x, tt.y, tt.z);
- return this;
- }
- set(e, t = 0) {
- return this.array.set(e, t), this;
- }
- getX(e) {
- return this.array[e * this.itemSize];
- }
- setX(e, t) {
- return (this.array[e * this.itemSize] = t), this;
- }
- getY(e) {
- return this.array[e * this.itemSize + 1];
- }
- setY(e, t) {
- return (this.array[e * this.itemSize + 1] = t), this;
- }
- getZ(e) {
- return this.array[e * this.itemSize + 2];
- }
- setZ(e, t) {
- return (this.array[e * this.itemSize + 2] = t), this;
- }
- getW(e) {
- return this.array[e * this.itemSize + 3];
- }
- setW(e, t) {
- return (this.array[e * this.itemSize + 3] = t), this;
- }
- setXY(e, t, n) {
- return (
- (e *= this.itemSize),
- (this.array[e + 0] = t),
- (this.array[e + 1] = n),
- this
- );
- }
- setXYZ(e, t, n, i) {
- return (
- (e *= this.itemSize),
- (this.array[e + 0] = t),
- (this.array[e + 1] = n),
- (this.array[e + 2] = i),
- this
- );
- }
- setXYZW(e, t, n, i, s) {
- return (
- (e *= this.itemSize),
- (this.array[e + 0] = t),
- (this.array[e + 1] = n),
- (this.array[e + 2] = i),
- (this.array[e + 3] = s),
- this
- );
- }
- onUpload(e) {
- return (this.onUploadCallback = e), this;
- }
- clone() {
- return new this.constructor(this.array, this.itemSize).copy(this);
- }
- toJSON() {
- const e = {
- itemSize: this.itemSize,
- type: this.array.constructor.name,
- array: Array.prototype.slice.call(this.array),
- normalized: this.normalized,
- };
- return (
- this.name !== "" && (e.name = this.name),
- this.usage !== ka && (e.usage = this.usage),
- (this.updateRange.offset !== 0 || this.updateRange.count !== -1) &&
- (e.updateRange = this.updateRange),
- e
- );
- }
- }
- class so extends wt {
- constructor(e, t, n) {
- super(new Uint16Array(e), t, n);
- }
- }
- class $c extends wt {
- constructor(e, t, n) {
- super(new Uint32Array(e), t, n);
- }
- }
- class Xe extends wt {
- constructor(e, t, n) {
- super(new Float32Array(e), t, n);
- }
- }
- let Cd = 0;
- const Dt = new pe(),
- fa = new Ye(),
- Ti = new P(),
- Lt = new Ki(),
- ps = new Ki(),
- lt = new P();
- class ct extends hi {
- constructor() {
- super(),
- (this.isBufferGeometry = !0),
- Object.defineProperty(this, "id", { value: Cd++ }),
- (this.uuid = Yt()),
- (this.name = ""),
- (this.type = "BufferGeometry"),
- (this.index = null),
- (this.attributes = {}),
- (this.morphAttributes = {}),
- (this.morphTargetsRelative = !1),
- (this.groups = []),
- (this.boundingBox = null),
- (this.boundingSphere = null),
- (this.drawRange = { start: 0, count: 1 / 0 }),
- (this.userData = {});
- }
- getIndex() {
- return this.index;
- }
- setIndex(e) {
- return (
- Array.isArray(e)
- ? (this.index = new (Gc(e) ? $c : so)(e, 1))
- : (this.index = e),
- this
- );
- }
- getAttribute(e) {
- return this.attributes[e];
- }
- setAttribute(e, t) {
- return (this.attributes[e] = t), this;
- }
- deleteAttribute(e) {
- return delete this.attributes[e], this;
- }
- hasAttribute(e) {
- return this.attributes[e] !== void 0;
- }
- addGroup(e, t, n = 0) {
- this.groups.push({ start: e, count: t, materialIndex: n });
- }
- clearGroups() {
- this.groups = [];
- }
- setDrawRange(e, t) {
- (this.drawRange.start = e), (this.drawRange.count = t);
- }
- applyMatrix4(e) {
- const t = this.attributes.position;
- t !== void 0 && (t.applyMatrix4(e), (t.needsUpdate = !0));
- const n = this.attributes.normal;
- if (n !== void 0) {
- const s = new Xt().getNormalMatrix(e);
- n.applyNormalMatrix(s), (n.needsUpdate = !0);
- }
- const i = this.attributes.tangent;
- return (
- i !== void 0 && (i.transformDirection(e), (i.needsUpdate = !0)),
- this.boundingBox !== null && this.computeBoundingBox(),
- this.boundingSphere !== null && this.computeBoundingSphere(),
- this
- );
- }
- applyQuaternion(e) {
- return Dt.makeRotationFromQuaternion(e), this.applyMatrix4(Dt), this;
- }
- rotateX(e) {
- return Dt.makeRotationX(e), this.applyMatrix4(Dt), this;
- }
- rotateY(e) {
- return Dt.makeRotationY(e), this.applyMatrix4(Dt), this;
- }
- rotateZ(e) {
- return Dt.makeRotationZ(e), this.applyMatrix4(Dt), this;
- }
- translate(e, t, n) {
- return Dt.makeTranslation(e, t, n), this.applyMatrix4(Dt), this;
- }
- scale(e, t, n) {
- return Dt.makeScale(e, t, n), this.applyMatrix4(Dt), this;
- }
- lookAt(e) {
- return (
- fa.lookAt(e), fa.updateMatrix(), this.applyMatrix4(fa.matrix), this
- );
- }
- center() {
- return (
- this.computeBoundingBox(),
- this.boundingBox.getCenter(Ti).negate(),
- this.translate(Ti.x, Ti.y, Ti.z),
- this
- );
- }
- setFromPoints(e) {
- const t = [];
- for (let n = 0, i = e.length; n < i; n++) {
- const s = e[n];
- t.push(s.x, s.y, s.z || 0);
- }
- return this.setAttribute("position", new Xe(t, 3)), this;
- }
- computeBoundingBox() {
- this.boundingBox === null && (this.boundingBox = new Ki());
- const e = this.attributes.position,
- t = this.morphAttributes.position;
- if (e && e.isGLBufferAttribute) {
- console.error(
- 'THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',
- this
- ),
- this.boundingBox.set(
- new P(-1 / 0, -1 / 0, -1 / 0),
- new P(1 / 0, 1 / 0, 1 / 0)
- );
- return;
- }
- if (e !== void 0) {
- if ((this.boundingBox.setFromBufferAttribute(e), t))
- for (let n = 0, i = t.length; n < i; n++) {
- const s = t[n];
- Lt.setFromBufferAttribute(s),
- this.morphTargetsRelative
- ? (lt.addVectors(this.boundingBox.min, Lt.min),
- this.boundingBox.expandByPoint(lt),
- lt.addVectors(this.boundingBox.max, Lt.max),
- this.boundingBox.expandByPoint(lt))
- : (this.boundingBox.expandByPoint(Lt.min),
- this.boundingBox.expandByPoint(Lt.max));
- }
- } else this.boundingBox.makeEmpty();
- (isNaN(this.boundingBox.min.x) ||
- isNaN(this.boundingBox.min.y) ||
- isNaN(this.boundingBox.min.z)) &&
- console.error(
- 'THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',
- this
- );
- }
- computeBoundingSphere() {
- this.boundingSphere === null && (this.boundingSphere = new Zi());
- const e = this.attributes.position,
- t = this.morphAttributes.position;
- if (e && e.isGLBufferAttribute) {
- console.error(
- 'THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',
- this
- ),
- this.boundingSphere.set(new P(), 1 / 0);
- return;
- }
- if (e) {
- const n = this.boundingSphere.center;
- if ((Lt.setFromBufferAttribute(e), t))
- for (let s = 0, a = t.length; s < a; s++) {
- const o = t[s];
- ps.setFromBufferAttribute(o),
- this.morphTargetsRelative
- ? (lt.addVectors(Lt.min, ps.min),
- Lt.expandByPoint(lt),
- lt.addVectors(Lt.max, ps.max),
- Lt.expandByPoint(lt))
- : (Lt.expandByPoint(ps.min), Lt.expandByPoint(ps.max));
- }
- Lt.getCenter(n);
- let i = 0;
- for (let s = 0, a = e.count; s < a; s++)
- lt.fromBufferAttribute(e, s),
- (i = Math.max(i, n.distanceToSquared(lt)));
- if (t)
- for (let s = 0, a = t.length; s < a; s++) {
- const o = t[s],
- l = this.morphTargetsRelative;
- for (let c = 0, u = o.count; c < u; c++)
- lt.fromBufferAttribute(o, c),
- l && (Ti.fromBufferAttribute(e, c), lt.add(Ti)),
- (i = Math.max(i, n.distanceToSquared(lt)));
- }
- (this.boundingSphere.radius = Math.sqrt(i)),
- isNaN(this.boundingSphere.radius) &&
- console.error(
- 'THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',
- this
- );
- }
- }
- computeTangents() {
- const e = this.index,
- t = this.attributes;
- if (
- e === null ||
- t.position === void 0 ||
- t.normal === void 0 ||
- t.uv === void 0
- ) {
- console.error(
- "THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)"
- );
- return;
- }
- const n = e.array,
- i = t.position.array,
- s = t.normal.array,
- a = t.uv.array,
- o = i.length / 3;
- this.hasAttribute("tangent") === !1 &&
- this.setAttribute("tangent", new wt(new Float32Array(4 * o), 4));
- const l = this.getAttribute("tangent").array,
- c = [],
- u = [];
- for (let I = 0; I < o; I++) (c[I] = new P()), (u[I] = new P());
- const h = new P(),
- d = new P(),
- f = new P(),
- g = new ve(),
- m = new ve(),
- p = new ve(),
- v = new P(),
- M = new P();
- function x(I, F, H) {
- h.fromArray(i, I * 3),
- d.fromArray(i, F * 3),
- f.fromArray(i, H * 3),
- g.fromArray(a, I * 2),
- m.fromArray(a, F * 2),
- p.fromArray(a, H * 2),
- d.sub(h),
- f.sub(h),
- m.sub(g),
- p.sub(g);
- const B = 1 / (m.x * p.y - p.x * m.y);
- !isFinite(B) ||
- (v
- .copy(d)
- .multiplyScalar(p.y)
- .addScaledVector(f, -m.y)
- .multiplyScalar(B),
- M.copy(f)
- .multiplyScalar(m.x)
- .addScaledVector(d, -p.x)
- .multiplyScalar(B),
- c[I].add(v),
- c[F].add(v),
- c[H].add(v),
- u[I].add(M),
- u[F].add(M),
- u[H].add(M));
- }
- let w = this.groups;
- w.length === 0 && (w = [{ start: 0, count: n.length }]);
- for (let I = 0, F = w.length; I < F; ++I) {
- const H = w[I],
- B = H.start,
- D = H.count;
- for (let z = B, N = B + D; z < N; z += 3)
- x(n[z + 0], n[z + 1], n[z + 2]);
- }
- const y = new P(),
- A = new P(),
- L = new P(),
- _ = new P();
- function T(I) {
- L.fromArray(s, I * 3), _.copy(L);
- const F = c[I];
- y.copy(F),
- y.sub(L.multiplyScalar(L.dot(F))).normalize(),
- A.crossVectors(_, F);
- const B = A.dot(u[I]) < 0 ? -1 : 1;
- (l[I * 4] = y.x),
- (l[I * 4 + 1] = y.y),
- (l[I * 4 + 2] = y.z),
- (l[I * 4 + 3] = B);
- }
- for (let I = 0, F = w.length; I < F; ++I) {
- const H = w[I],
- B = H.start,
- D = H.count;
- for (let z = B, N = B + D; z < N; z += 3)
- T(n[z + 0]), T(n[z + 1]), T(n[z + 2]);
- }
- }
- computeVertexNormals() {
- const e = this.index,
- t = this.getAttribute("position");
- if (t !== void 0) {
- let n = this.getAttribute("normal");
- if (n === void 0)
- (n = new wt(new Float32Array(t.count * 3), 3)),
- this.setAttribute("normal", n);
- else for (let d = 0, f = n.count; d < f; d++) n.setXYZ(d, 0, 0, 0);
- const i = new P(),
- s = new P(),
- a = new P(),
- o = new P(),
- l = new P(),
- c = new P(),
- u = new P(),
- h = new P();
- if (e)
- for (let d = 0, f = e.count; d < f; d += 3) {
- const g = e.getX(d + 0),
- m = e.getX(d + 1),
- p = e.getX(d + 2);
- i.fromBufferAttribute(t, g),
- s.fromBufferAttribute(t, m),
- a.fromBufferAttribute(t, p),
- u.subVectors(a, s),
- h.subVectors(i, s),
- u.cross(h),
- o.fromBufferAttribute(n, g),
- l.fromBufferAttribute(n, m),
- c.fromBufferAttribute(n, p),
- o.add(u),
- l.add(u),
- c.add(u),
- n.setXYZ(g, o.x, o.y, o.z),
- n.setXYZ(m, l.x, l.y, l.z),
- n.setXYZ(p, c.x, c.y, c.z);
- }
- else
- for (let d = 0, f = t.count; d < f; d += 3)
- i.fromBufferAttribute(t, d + 0),
- s.fromBufferAttribute(t, d + 1),
- a.fromBufferAttribute(t, d + 2),
- u.subVectors(a, s),
- h.subVectors(i, s),
- u.cross(h),
- n.setXYZ(d + 0, u.x, u.y, u.z),
- n.setXYZ(d + 1, u.x, u.y, u.z),
- n.setXYZ(d + 2, u.x, u.y, u.z);
- this.normalizeNormals(), (n.needsUpdate = !0);
- }
- }
- merge(e, t) {
- if (!(e && e.isBufferGeometry)) {
- console.error(
- "THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",
- e
- );
- return;
- }
- t === void 0 &&
- ((t = 0),
- console.warn(
- "THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."
- ));
- const n = this.attributes;
- for (const i in n) {
- if (e.attributes[i] === void 0) continue;
- const a = n[i].array,
- o = e.attributes[i],
- l = o.array,
- c = o.itemSize * t,
- u = Math.min(l.length, a.length - c);
- for (let h = 0, d = c; h < u; h++, d++) a[d] = l[h];
- }
- return this;
- }
- normalizeNormals() {
- const e = this.attributes.normal;
- for (let t = 0, n = e.count; t < n; t++)
- lt.fromBufferAttribute(e, t),
- lt.normalize(),
- e.setXYZ(t, lt.x, lt.y, lt.z);
- }
- toNonIndexed() {
- function e(o, l) {
- const c = o.array,
- u = o.itemSize,
- h = o.normalized,
- d = new c.constructor(l.length * u);
- let f = 0,
- g = 0;
- for (let m = 0, p = l.length; m < p; m++) {
- o.isInterleavedBufferAttribute
- ? (f = l[m] * o.data.stride + o.offset)
- : (f = l[m] * u);
- for (let v = 0; v < u; v++) d[g++] = c[f++];
- }
- return new wt(d, u, h);
- }
- if (this.index === null)
- return (
- console.warn(
- "THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."
- ),
- this
- );
- const t = new ct(),
- n = this.index.array,
- i = this.attributes;
- for (const o in i) {
- const l = i[o],
- c = e(l, n);
- t.setAttribute(o, c);
- }
- const s = this.morphAttributes;
- for (const o in s) {
- const l = [],
- c = s[o];
- for (let u = 0, h = c.length; u < h; u++) {
- const d = c[u],
- f = e(d, n);
- l.push(f);
- }
- t.morphAttributes[o] = l;
- }
- t.morphTargetsRelative = this.morphTargetsRelative;
- const a = this.groups;
- for (let o = 0, l = a.length; o < l; o++) {
- const c = a[o];
- t.addGroup(c.start, c.count, c.materialIndex);
- }
- return t;
- }
- toJSON() {
- const e = {
- metadata: {
- version: 4.5,
- type: "BufferGeometry",
- generator: "BufferGeometry.toJSON",
- },
- };
- if (
- ((e.uuid = this.uuid),
- (e.type = this.type),
- this.name !== "" && (e.name = this.name),
- Object.keys(this.userData).length > 0 &&
- (e.userData = this.userData),
- this.parameters !== void 0)
- ) {
- const l = this.parameters;
- for (const c in l) l[c] !== void 0 && (e[c] = l[c]);
- return e;
- }
- e.data = { attributes: {} };
- const t = this.index;
- t !== null &&
- (e.data.index = {
- type: t.array.constructor.name,
- array: Array.prototype.slice.call(t.array),
- });
- const n = this.attributes;
- for (const l in n) {
- const c = n[l];
- e.data.attributes[l] = c.toJSON(e.data);
- }
- const i = {};
- let s = !1;
- for (const l in this.morphAttributes) {
- const c = this.morphAttributes[l],
- u = [];
- for (let h = 0, d = c.length; h < d; h++) {
- const f = c[h];
- u.push(f.toJSON(e.data));
- }
- u.length > 0 && ((i[l] = u), (s = !0));
- }
- s &&
- ((e.data.morphAttributes = i),
- (e.data.morphTargetsRelative = this.morphTargetsRelative));
- const a = this.groups;
- a.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(a)));
- const o = this.boundingSphere;
- return (
- o !== null &&
- (e.data.boundingSphere = {
- center: o.center.toArray(),
- radius: o.radius,
- }),
- e
- );
- }
- clone() {
- return new this.constructor().copy(this);
- }
- copy(e) {
- (this.index = null),
- (this.attributes = {}),
- (this.morphAttributes = {}),
- (this.groups = []),
- (this.boundingBox = null),
- (this.boundingSphere = null);
- const t = {};
- this.name = e.name;
- const n = e.index;
- n !== null && this.setIndex(n.clone(t));
- const i = e.attributes;
- for (const c in i) {
- const u = i[c];
- this.setAttribute(c, u.clone(t));
- }
- const s = e.morphAttributes;
- for (const c in s) {
- const u = [],
- h = s[c];
- for (let d = 0, f = h.length; d < f; d++) u.push(h[d].clone(t));
- this.morphAttributes[c] = u;
- }
- this.morphTargetsRelative = e.morphTargetsRelative;
- const a = e.groups;
- for (let c = 0, u = a.length; c < u; c++) {
- const h = a[c];
- this.addGroup(h.start, h.count, h.materialIndex);
- }
- const o = e.boundingBox;
- o !== null && (this.boundingBox = o.clone());
- const l = e.boundingSphere;
- return (
- l !== null && (this.boundingSphere = l.clone()),
- (this.drawRange.start = e.drawRange.start),
- (this.drawRange.count = e.drawRange.count),
- (this.userData = e.userData),
- e.parameters !== void 0 &&
- (this.parameters = Object.assign({}, e.parameters)),
- this
- );
- }
- dispose() {
- this.dispatchEvent({ type: "dispose" });
- }
- }
- const xl = new pe(),
- Ei = new io(),
- pa = new Zi(),
- Fn = new P(),
- Nn = new P(),
- zn = new P(),
- ma = new P(),
- ga = new P(),
- va = new P(),
- tr = new P(),
- nr = new P(),
- ir = new P(),
- sr = new ve(),
- rr = new ve(),
- ar = new ve(),
- _a = new P(),
- or = new P();
- class Qe extends Ye {
- constructor(e = new ct(), t = new wn()) {
- super(),
- (this.isMesh = !0),
- (this.type = "Mesh"),
- (this.geometry = e),
- (this.material = t),
- this.updateMorphTargets();
- }
- copy(e, t) {
- return (
- super.copy(e, t),
- e.morphTargetInfluences !== void 0 &&
- (this.morphTargetInfluences = e.morphTargetInfluences.slice()),
- e.morphTargetDictionary !== void 0 &&
- (this.morphTargetDictionary = Object.assign(
- {},
- e.morphTargetDictionary
- )),
- (this.material = e.material),
- (this.geometry = e.geometry),
- this
- );
- }
- updateMorphTargets() {
- const t = this.geometry.morphAttributes,
- n = Object.keys(t);
- if (n.length > 0) {
- const i = t[n[0]];
- if (i !== void 0) {
- (this.morphTargetInfluences = []),
- (this.morphTargetDictionary = {});
- for (let s = 0, a = i.length; s < a; s++) {
- const o = i[s].name || String(s);
- this.morphTargetInfluences.push(0),
- (this.morphTargetDictionary[o] = s);
- }
- }
- }
- }
- raycast(e, t) {
- const n = this.geometry,
- i = this.material,
- s = this.matrixWorld;
- if (
- i === void 0 ||
- (n.boundingSphere === null && n.computeBoundingSphere(),
- pa.copy(n.boundingSphere),
- pa.applyMatrix4(s),
- e.ray.intersectsSphere(pa) === !1) ||
- (xl.copy(s).invert(),
- Ei.copy(e.ray).applyMatrix4(xl),
- n.boundingBox !== null && Ei.intersectsBox(n.boundingBox) === !1)
- )
- return;
- let a;
- const o = n.index,
- l = n.attributes.position,
- c = n.morphAttributes.position,
- u = n.morphTargetsRelative,
- h = n.attributes.uv,
- d = n.attributes.uv2,
- f = n.groups,
- g = n.drawRange;
- if (o !== null)
- if (Array.isArray(i))
- for (let m = 0, p = f.length; m < p; m++) {
- const v = f[m],
- M = i[v.materialIndex],
- x = Math.max(v.start, g.start),
- w = Math.min(
- o.count,
- Math.min(v.start + v.count, g.start + g.count)
- );
- for (let y = x, A = w; y < A; y += 3) {
- const L = o.getX(y),
- _ = o.getX(y + 1),
- T = o.getX(y + 2);
- (a = lr(this, M, e, Ei, l, c, u, h, d, L, _, T)),
- a &&
- ((a.faceIndex = Math.floor(y / 3)),
- (a.face.materialIndex = v.materialIndex),
- t.push(a));
- }
- }
- else {
- const m = Math.max(0, g.start),
- p = Math.min(o.count, g.start + g.count);
- for (let v = m, M = p; v < M; v += 3) {
- const x = o.getX(v),
- w = o.getX(v + 1),
- y = o.getX(v + 2);
- (a = lr(this, i, e, Ei, l, c, u, h, d, x, w, y)),
- a && ((a.faceIndex = Math.floor(v / 3)), t.push(a));
- }
- }
- else if (l !== void 0)
- if (Array.isArray(i))
- for (let m = 0, p = f.length; m < p; m++) {
- const v = f[m],
- M = i[v.materialIndex],
- x = Math.max(v.start, g.start),
- w = Math.min(
- l.count,
- Math.min(v.start + v.count, g.start + g.count)
- );
- for (let y = x, A = w; y < A; y += 3) {
- const L = y,
- _ = y + 1,
- T = y + 2;
- (a = lr(this, M, e, Ei, l, c, u, h, d, L, _, T)),
- a &&
- ((a.faceIndex = Math.floor(y / 3)),
- (a.face.materialIndex = v.materialIndex),
- t.push(a));
- }
- }
- else {
- const m = Math.max(0, g.start),
- p = Math.min(l.count, g.start + g.count);
- for (let v = m, M = p; v < M; v += 3) {
- const x = v,
- w = v + 1,
- y = v + 2;
- (a = lr(this, i, e, Ei, l, c, u, h, d, x, w, y)),
- a && ((a.faceIndex = Math.floor(v / 3)), t.push(a));
- }
- }
- }
- }
- function Ld(r, e, t, n, i, s, a, o) {
- let l;
- if (
- (e.side === qt
- ? (l = n.intersectTriangle(a, s, i, !0, o))
- : (l = n.intersectTriangle(i, s, a, e.side !== cn, o)),
- l === null)
- )
- return null;
- or.copy(o), or.applyMatrix4(r.matrixWorld);
- const c = t.ray.origin.distanceTo(or);
- return c < t.near || c > t.far
- ? null
- : { distance: c, point: or.clone(), object: r };
- }
- function lr(r, e, t, n, i, s, a, o, l, c, u, h) {
- Fn.fromBufferAttribute(i, c),
- Nn.fromBufferAttribute(i, u),
- zn.fromBufferAttribute(i, h);
- const d = r.morphTargetInfluences;
- if (s && d) {
- tr.set(0, 0, 0), nr.set(0, 0, 0), ir.set(0, 0, 0);
- for (let g = 0, m = s.length; g < m; g++) {
- const p = d[g],
- v = s[g];
- p !== 0 &&
- (ma.fromBufferAttribute(v, c),
- ga.fromBufferAttribute(v, u),
- va.fromBufferAttribute(v, h),
- a
- ? (tr.addScaledVector(ma, p),
- nr.addScaledVector(ga, p),
- ir.addScaledVector(va, p))
- : (tr.addScaledVector(ma.sub(Fn), p),
- nr.addScaledVector(ga.sub(Nn), p),
- ir.addScaledVector(va.sub(zn), p)));
- }
- Fn.add(tr), Nn.add(nr), zn.add(ir);
- }
- r.isSkinnedMesh &&
- (r.boneTransform(c, Fn),
- r.boneTransform(u, Nn),
- r.boneTransform(h, zn));
- const f = Ld(r, e, t, n, Fn, Nn, zn, _a);
- if (f) {
- o &&
- (sr.fromBufferAttribute(o, c),
- rr.fromBufferAttribute(o, u),
- ar.fromBufferAttribute(o, h),
- (f.uv = rn.getUV(_a, Fn, Nn, zn, sr, rr, ar, new ve()))),
- l &&
- (sr.fromBufferAttribute(l, c),
- rr.fromBufferAttribute(l, u),
- ar.fromBufferAttribute(l, h),
- (f.uv2 = rn.getUV(_a, Fn, Nn, zn, sr, rr, ar, new ve())));
- const g = { a: c, b: u, c: h, normal: new P(), materialIndex: 0 };
- rn.getNormal(Fn, Nn, zn, g.normal), (f.face = g);
- }
- return f;
- }
- class Ns extends ct {
- constructor(e = 1, t = 1, n = 1, i = 1, s = 1, a = 1) {
- super(),
- (this.type = "BoxGeometry"),
- (this.parameters = {
- width: e,
- height: t,
- depth: n,
- widthSegments: i,
- heightSegments: s,
- depthSegments: a,
- });
- const o = this;
- (i = Math.floor(i)), (s = Math.floor(s)), (a = Math.floor(a));
- const l = [],
- c = [],
- u = [],
- h = [];
- let d = 0,
- f = 0;
- g("z", "y", "x", -1, -1, n, t, e, a, s, 0),
- g("z", "y", "x", 1, -1, n, t, -e, a, s, 1),
- g("x", "z", "y", 1, 1, e, n, t, i, a, 2),
- g("x", "z", "y", 1, -1, e, n, -t, i, a, 3),
- g("x", "y", "z", 1, -1, e, t, n, i, s, 4),
- g("x", "y", "z", -1, -1, e, t, -n, i, s, 5),
- this.setIndex(l),
- this.setAttribute("position", new Xe(c, 3)),
- this.setAttribute("normal", new Xe(u, 3)),
- this.setAttribute("uv", new Xe(h, 2));
- function g(m, p, v, M, x, w, y, A, L, _, T) {
- const I = w / L,
- F = y / _,
- H = w / 2,
- B = y / 2,
- D = A / 2,
- z = L + 1,
- N = _ + 1;
- let k = 0,
- G = 0;
- const U = new P();
- for (let X = 0; X < N; X++) {
- const Z = X * F - B;
- for (let Y = 0; Y < z; Y++) {
- const J = Y * I - H;
- (U[m] = J * M),
- (U[p] = Z * x),
- (U[v] = D),
- c.push(U.x, U.y, U.z),
- (U[m] = 0),
- (U[p] = 0),
- (U[v] = A > 0 ? 1 : -1),
- u.push(U.x, U.y, U.z),
- h.push(Y / L),
- h.push(1 - X / _),
- (k += 1);
- }
- }
- for (let X = 0; X < _; X++)
- for (let Z = 0; Z < L; Z++) {
- const Y = d + Z + z * X,
- J = d + Z + z * (X + 1),
- ae = d + (Z + 1) + z * (X + 1),
- ue = d + (Z + 1) + z * X;
- l.push(Y, J, ue), l.push(J, ae, ue), (G += 6);
- }
- o.addGroup(f, G, T), (f += G), (d += k);
- }
- }
- static fromJSON(e) {
- return new Ns(
- e.width,
- e.height,
- e.depth,
- e.widthSegments,
- e.heightSegments,
- e.depthSegments
- );
- }
- }
- function Hi(r) {
- const e = {};
- for (const t in r) {
- e[t] = {};
- for (const n in r[t]) {
- const i = r[t][n];
- i &&
- (i.isColor ||
- i.isMatrix3 ||
- i.isMatrix4 ||
- i.isVector2 ||
- i.isVector3 ||
- i.isVector4 ||
- i.isTexture ||
- i.isQuaternion)
- ? (e[t][n] = i.clone())
- : Array.isArray(i)
- ? (e[t][n] = i.slice())
- : (e[t][n] = i);
- }
- }
- return e;
- }
- function pt(r) {
- const e = {};
- for (let t = 0; t < r.length; t++) {
- const n = Hi(r[t]);
- for (const i in n) e[i] = n[i];
- }
- return e;
- }
- const Rd = { clone: Hi, merge: pt };
- var Pd = `void main() {
- gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
-}`,
- Dd = `void main() {
- gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
-}`;
- class En extends it {
- constructor(e) {
- super(),
- (this.isShaderMaterial = !0),
- (this.type = "ShaderMaterial"),
- (this.defines = {}),
- (this.uniforms = {}),
- (this.vertexShader = Pd),
- (this.fragmentShader = Dd),
- (this.linewidth = 1),
- (this.wireframe = !1),
- (this.wireframeLinewidth = 1),
- (this.fog = !1),
- (this.lights = !1),
- (this.clipping = !1),
- (this.extensions = {
- derivatives: !1,
- fragDepth: !1,
- drawBuffers: !1,
- shaderTextureLOD: !1,
- }),
- (this.defaultAttributeValues = {
- color: [1, 1, 1],
- uv: [0, 0],
- uv2: [0, 0],
- }),
- (this.index0AttributeName = void 0),
- (this.uniformsNeedUpdate = !1),
- (this.glslVersion = null),
- e !== void 0 &&
- (e.attributes !== void 0 &&
- console.error(
- "THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."
- ),
- this.setValues(e));
- }
- copy(e) {
- return (
- super.copy(e),
- (this.fragmentShader = e.fragmentShader),
- (this.vertexShader = e.vertexShader),
- (this.uniforms = Hi(e.uniforms)),
- (this.defines = Object.assign({}, e.defines)),
- (this.wireframe = e.wireframe),
- (this.wireframeLinewidth = e.wireframeLinewidth),
- (this.fog = e.fog),
- (this.lights = e.lights),
- (this.clipping = e.clipping),
- (this.extensions = Object.assign({}, e.extensions)),
- (this.glslVersion = e.glslVersion),
- this
- );
- }
- toJSON(e) {
- const t = super.toJSON(e);
- (t.glslVersion = this.glslVersion), (t.uniforms = {});
- for (const i in this.uniforms) {
- const a = this.uniforms[i].value;
- a && a.isTexture
- ? (t.uniforms[i] = { type: "t", value: a.toJSON(e).uuid })
- : a && a.isColor
- ? (t.uniforms[i] = { type: "c", value: a.getHex() })
- : a && a.isVector2
- ? (t.uniforms[i] = { type: "v2", value: a.toArray() })
- : a && a.isVector3
- ? (t.uniforms[i] = { type: "v3", value: a.toArray() })
- : a && a.isVector4
- ? (t.uniforms[i] = { type: "v4", value: a.toArray() })
- : a && a.isMatrix3
- ? (t.uniforms[i] = { type: "m3", value: a.toArray() })
- : a && a.isMatrix4
- ? (t.uniforms[i] = { type: "m4", value: a.toArray() })
- : (t.uniforms[i] = { value: a });
- }
- Object.keys(this.defines).length > 0 && (t.defines = this.defines),
- (t.vertexShader = this.vertexShader),
- (t.fragmentShader = this.fragmentShader);
- const n = {};
- for (const i in this.extensions)
- this.extensions[i] === !0 && (n[i] = !0);
- return Object.keys(n).length > 0 && (t.extensions = n), t;
- }
- }
- class Yc extends Ye {
- constructor() {
- super(),
- (this.isCamera = !0),
- (this.type = "Camera"),
- (this.matrixWorldInverse = new pe()),
- (this.projectionMatrix = new pe()),
- (this.projectionMatrixInverse = new pe());
- }
- copy(e, t) {
- return (
- super.copy(e, t),
- this.matrixWorldInverse.copy(e.matrixWorldInverse),
- this.projectionMatrix.copy(e.projectionMatrix),
- this.projectionMatrixInverse.copy(e.projectionMatrixInverse),
- this
- );
- }
- getWorldDirection(e) {
- this.updateWorldMatrix(!0, !1);
- const t = this.matrixWorld.elements;
- return e.set(-t[8], -t[9], -t[10]).normalize();
- }
- updateMatrixWorld(e) {
- super.updateMatrixWorld(e),
- this.matrixWorldInverse.copy(this.matrixWorld).invert();
- }
- updateWorldMatrix(e, t) {
- super.updateWorldMatrix(e, t),
- this.matrixWorldInverse.copy(this.matrixWorld).invert();
- }
- clone() {
- return new this.constructor().copy(this);
- }
- }
- class mt extends Yc {
- constructor(e = 50, t = 1, n = 0.1, i = 2e3) {
- super(),
- (this.isPerspectiveCamera = !0),
- (this.type = "PerspectiveCamera"),
- (this.fov = e),
- (this.zoom = 1),
- (this.near = n),
- (this.far = i),
- (this.focus = 10),
- (this.aspect = t),
- (this.view = null),
- (this.filmGauge = 35),
- (this.filmOffset = 0),
- this.updateProjectionMatrix();
- }
- copy(e, t) {
- return (
- super.copy(e, t),
- (this.fov = e.fov),
- (this.zoom = e.zoom),
- (this.near = e.near),
- (this.far = e.far),
- (this.focus = e.focus),
- (this.aspect = e.aspect),
- (this.view = e.view === null ? null : Object.assign({}, e.view)),
- (this.filmGauge = e.filmGauge),
- (this.filmOffset = e.filmOffset),
- this
- );
- }
- setFocalLength(e) {
- const t = (0.5 * this.getFilmHeight()) / e;
- (this.fov = As * 2 * Math.atan(t)), this.updateProjectionMatrix();
- }
- getFocalLength() {
- const e = Math.tan(ys * 0.5 * this.fov);
- return (0.5 * this.getFilmHeight()) / e;
- }
- getEffectiveFOV() {
- return As * 2 * Math.atan(Math.tan(ys * 0.5 * this.fov) / this.zoom);
- }
- getFilmWidth() {
- return this.filmGauge * Math.min(this.aspect, 1);
- }
- getFilmHeight() {
- return this.filmGauge / Math.max(this.aspect, 1);
- }
- setViewOffset(e, t, n, i, s, a) {
- (this.aspect = e / t),
- this.view === null &&
- (this.view = {
- enabled: !0,
- fullWidth: 1,
- fullHeight: 1,
- offsetX: 0,
- offsetY: 0,
- width: 1,
- height: 1,
- }),
- (this.view.enabled = !0),
- (this.view.fullWidth = e),
- (this.view.fullHeight = t),
- (this.view.offsetX = n),
- (this.view.offsetY = i),
- (this.view.width = s),
- (this.view.height = a),
- this.updateProjectionMatrix();
- }
- clearViewOffset() {
- this.view !== null && (this.view.enabled = !1),
- this.updateProjectionMatrix();
- }
- updateProjectionMatrix() {
- const e = this.near;
- let t = (e * Math.tan(ys * 0.5 * this.fov)) / this.zoom,
- n = 2 * t,
- i = this.aspect * n,
- s = -0.5 * i;
- const a = this.view;
- if (this.view !== null && this.view.enabled) {
- const l = a.fullWidth,
- c = a.fullHeight;
- (s += (a.offsetX * i) / l),
- (t -= (a.offsetY * n) / c),
- (i *= a.width / l),
- (n *= a.height / c);
- }
- const o = this.filmOffset;
- o !== 0 && (s += (e * o) / this.getFilmWidth()),
- this.projectionMatrix.makePerspective(
- s,
- s + i,
- t,
- t - n,
- e,
- this.far
- ),
- this.projectionMatrixInverse.copy(this.projectionMatrix).invert();
- }
- toJSON(e) {
- const t = super.toJSON(e);
- return (
- (t.object.fov = this.fov),
- (t.object.zoom = this.zoom),
- (t.object.near = this.near),
- (t.object.far = this.far),
- (t.object.focus = this.focus),
- (t.object.aspect = this.aspect),
- this.view !== null &&
- (t.object.view = Object.assign({}, this.view)),
- (t.object.filmGauge = this.filmGauge),
- (t.object.filmOffset = this.filmOffset),
- t
- );
- }
- }
- const Ai = 90,
- Ci = 1;
- class Id extends Ye {
- constructor(e, t, n) {
- if (
- (super(),
- (this.type = "CubeCamera"),
- n.isWebGLCubeRenderTarget !== !0)
- ) {
- console.error(
- "THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter."
- );
- return;
- }
- this.renderTarget = n;
- const i = new mt(Ai, Ci, e, t);
- (i.layers = this.layers),
- i.up.set(0, -1, 0),
- i.lookAt(new P(1, 0, 0)),
- this.add(i);
- const s = new mt(Ai, Ci, e, t);
- (s.layers = this.layers),
- s.up.set(0, -1, 0),
- s.lookAt(new P(-1, 0, 0)),
- this.add(s);
- const a = new mt(Ai, Ci, e, t);
- (a.layers = this.layers),
- a.up.set(0, 0, 1),
- a.lookAt(new P(0, 1, 0)),
- this.add(a);
- const o = new mt(Ai, Ci, e, t);
- (o.layers = this.layers),
- o.up.set(0, 0, -1),
- o.lookAt(new P(0, -1, 0)),
- this.add(o);
- const l = new mt(Ai, Ci, e, t);
- (l.layers = this.layers),
- l.up.set(0, -1, 0),
- l.lookAt(new P(0, 0, 1)),
- this.add(l);
- const c = new mt(Ai, Ci, e, t);
- (c.layers = this.layers),
- c.up.set(0, -1, 0),
- c.lookAt(new P(0, 0, -1)),
- this.add(c);
- }
- update(e, t) {
- this.parent === null && this.updateMatrixWorld();
- const n = this.renderTarget,
- [i, s, a, o, l, c] = this.children,
- u = e.getRenderTarget(),
- h = e.toneMapping,
- d = e.xr.enabled;
- (e.toneMapping = $t), (e.xr.enabled = !1);
- const f = n.texture.generateMipmaps;
- (n.texture.generateMipmaps = !1),
- e.setRenderTarget(n, 0),
- e.render(t, i),
- e.setRenderTarget(n, 1),
- e.render(t, s),
- e.setRenderTarget(n, 2),
- e.render(t, a),
- e.setRenderTarget(n, 3),
- e.render(t, o),
- e.setRenderTarget(n, 4),
- e.render(t, l),
- (n.texture.generateMipmaps = f),
- e.setRenderTarget(n, 5),
- e.render(t, c),
- e.setRenderTarget(u),
- (e.toneMapping = h),
- (e.xr.enabled = d),
- (n.texture.needsPMREMUpdate = !0);
- }
- }
- class Kc extends nt {
- constructor(e, t, n, i, s, a, o, l, c, u) {
- (e = e !== void 0 ? e : []),
- (t = t !== void 0 ? t : Ui),
- super(e, t, n, i, s, a, o, l, c, u),
- (this.isCubeTexture = !0),
- (this.flipY = !1);
- }
- get images() {
- return this.image;
- }
- set images(e) {
- this.image = e;
- }
- }
- class Fd extends Kt {
- constructor(e, t = {}) {
- super(e, e, t), (this.isWebGLCubeRenderTarget = !0);
- const n = { width: e, height: e, depth: 1 },
- i = [n, n, n, n, n, n];
- (this.texture = new Kc(
- i,
- t.mapping,
- t.wrapS,
- t.wrapT,
- t.magFilter,
- t.minFilter,
- t.format,
- t.type,
- t.anisotropy,
- t.encoding
- )),
- (this.texture.isRenderTargetTexture = !0),
- (this.texture.generateMipmaps =
- t.generateMipmaps !== void 0 ? t.generateMipmaps : !1),
- (this.texture.minFilter =
- t.minFilter !== void 0 ? t.minFilter : $e);
- }
- fromEquirectangularTexture(e, t) {
- (this.texture.type = t.type),
- (this.texture.encoding = t.encoding),
- (this.texture.generateMipmaps = t.generateMipmaps),
- (this.texture.minFilter = t.minFilter),
- (this.texture.magFilter = t.magFilter);
- const n = {
- uniforms: { tEquirect: { value: null } },
- vertexShader: `
-
- varying vec3 vWorldDirection;
-
- vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
-
- return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
-
- }
-
- void main() {
-
- vWorldDirection = transformDirection( position, modelMatrix );
-
- #include
- #include
-
- }
- `,
- fragmentShader: `
-
- uniform sampler2D tEquirect;
-
- varying vec3 vWorldDirection;
-
- #include
-
- void main() {
-
- vec3 direction = normalize( vWorldDirection );
-
- vec2 sampleUV = equirectUv( direction );
-
- gl_FragColor = texture2D( tEquirect, sampleUV );
-
- }
- `,
- },
- i = new Ns(5, 5, 5),
- s = new En({
- name: "CubemapFromEquirect",
- uniforms: Hi(n.uniforms),
- vertexShader: n.vertexShader,
- fragmentShader: n.fragmentShader,
- side: qt,
- blending: Un,
- });
- s.uniforms.tEquirect.value = t;
- const a = new Qe(i, s),
- o = t.minFilter;
- return (
- t.minFilter === li && (t.minFilter = $e),
- new Id(1, 10, this).update(e, a),
- (t.minFilter = o),
- a.geometry.dispose(),
- a.material.dispose(),
- this
- );
- }
- clear(e, t, n, i) {
- const s = e.getRenderTarget();
- for (let a = 0; a < 6; a++)
- e.setRenderTarget(this, a), e.clear(t, n, i);
- e.setRenderTarget(s);
- }
- }
- const xa = new P(),
- Nd = new P(),
- zd = new Xt();
- class Qn {
- constructor(e = new P(1, 0, 0), t = 0) {
- (this.isPlane = !0), (this.normal = e), (this.constant = t);
- }
- set(e, t) {
- return this.normal.copy(e), (this.constant = t), this;
- }
- setComponents(e, t, n, i) {
- return this.normal.set(e, t, n), (this.constant = i), this;
- }
- setFromNormalAndCoplanarPoint(e, t) {
- return (
- this.normal.copy(e), (this.constant = -t.dot(this.normal)), this
- );
- }
- setFromCoplanarPoints(e, t, n) {
- const i = xa.subVectors(n, t).cross(Nd.subVectors(e, t)).normalize();
- return this.setFromNormalAndCoplanarPoint(i, e), this;
- }
- copy(e) {
- return this.normal.copy(e.normal), (this.constant = e.constant), this;
- }
- normalize() {
- const e = 1 / this.normal.length();
- return this.normal.multiplyScalar(e), (this.constant *= e), this;
- }
- negate() {
- return (this.constant *= -1), this.normal.negate(), this;
- }
- distanceToPoint(e) {
- return this.normal.dot(e) + this.constant;
- }
- distanceToSphere(e) {
- return this.distanceToPoint(e.center) - e.radius;
- }
- projectPoint(e, t) {
- return t
- .copy(this.normal)
- .multiplyScalar(-this.distanceToPoint(e))
- .add(e);
- }
- intersectLine(e, t) {
- const n = e.delta(xa),
- i = this.normal.dot(n);
- if (i === 0)
- return this.distanceToPoint(e.start) === 0 ? t.copy(e.start) : null;
- const s = -(e.start.dot(this.normal) + this.constant) / i;
- return s < 0 || s > 1
- ? null
- : t.copy(n).multiplyScalar(s).add(e.start);
- }
- intersectsLine(e) {
- const t = this.distanceToPoint(e.start),
- n = this.distanceToPoint(e.end);
- return (t < 0 && n > 0) || (n < 0 && t > 0);
- }
- intersectsBox(e) {
- return e.intersectsPlane(this);
- }
- intersectsSphere(e) {
- return e.intersectsPlane(this);
- }
- coplanarPoint(e) {
- return e.copy(this.normal).multiplyScalar(-this.constant);
- }
- applyMatrix4(e, t) {
- const n = t || zd.getNormalMatrix(e),
- i = this.coplanarPoint(xa).applyMatrix4(e),
- s = this.normal.applyMatrix3(n).normalize();
- return (this.constant = -i.dot(s)), this;
- }
- translate(e) {
- return (this.constant -= e.dot(this.normal)), this;
- }
- equals(e) {
- return e.normal.equals(this.normal) && e.constant === this.constant;
- }
- clone() {
- return new this.constructor().copy(this);
- }
- }
- const Li = new Zi(),
- cr = new P();
- class ro {
- constructor(
- e = new Qn(),
- t = new Qn(),
- n = new Qn(),
- i = new Qn(),
- s = new Qn(),
- a = new Qn()
- ) {
- this.planes = [e, t, n, i, s, a];
- }
- set(e, t, n, i, s, a) {
- const o = this.planes;
- return (
- o[0].copy(e),
- o[1].copy(t),
- o[2].copy(n),
- o[3].copy(i),
- o[4].copy(s),
- o[5].copy(a),
- this
- );
- }
- copy(e) {
- const t = this.planes;
- for (let n = 0; n < 6; n++) t[n].copy(e.planes[n]);
- return this;
- }
- setFromProjectionMatrix(e) {
- const t = this.planes,
- n = e.elements,
- i = n[0],
- s = n[1],
- a = n[2],
- o = n[3],
- l = n[4],
- c = n[5],
- u = n[6],
- h = n[7],
- d = n[8],
- f = n[9],
- g = n[10],
- m = n[11],
- p = n[12],
- v = n[13],
- M = n[14],
- x = n[15];
- return (
- t[0].setComponents(o - i, h - l, m - d, x - p).normalize(),
- t[1].setComponents(o + i, h + l, m + d, x + p).normalize(),
- t[2].setComponents(o + s, h + c, m + f, x + v).normalize(),
- t[3].setComponents(o - s, h - c, m - f, x - v).normalize(),
- t[4].setComponents(o - a, h - u, m - g, x - M).normalize(),
- t[5].setComponents(o + a, h + u, m + g, x + M).normalize(),
- this
- );
- }
- intersectsObject(e) {
- const t = e.geometry;
- return (
- t.boundingSphere === null && t.computeBoundingSphere(),
- Li.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),
- this.intersectsSphere(Li)
- );
- }
- intersectsSprite(e) {
- return (
- Li.center.set(0, 0, 0),
- (Li.radius = 0.7071067811865476),
- Li.applyMatrix4(e.matrixWorld),
- this.intersectsSphere(Li)
- );
- }
- intersectsSphere(e) {
- const t = this.planes,
- n = e.center,
- i = -e.radius;
- for (let s = 0; s < 6; s++)
- if (t[s].distanceToPoint(n) < i) return !1;
- return !0;
- }
- intersectsBox(e) {
- const t = this.planes;
- for (let n = 0; n < 6; n++) {
- const i = t[n];
- if (
- ((cr.x = i.normal.x > 0 ? e.max.x : e.min.x),
- (cr.y = i.normal.y > 0 ? e.max.y : e.min.y),
- (cr.z = i.normal.z > 0 ? e.max.z : e.min.z),
- i.distanceToPoint(cr) < 0)
- )
- return !1;
- }
- return !0;
- }
- containsPoint(e) {
- const t = this.planes;
- for (let n = 0; n < 6; n++)
- if (t[n].distanceToPoint(e) < 0) return !1;
- return !0;
- }
- clone() {
- return new this.constructor().copy(this);
- }
- }
- function Zc() {
- let r = null,
- e = !1,
- t = null,
- n = null;
- function i(s, a) {
- t(s, a), (n = r.requestAnimationFrame(i));
- }
- return {
- start: function () {
- e !== !0 &&
- t !== null &&
- ((n = r.requestAnimationFrame(i)), (e = !0));
- },
- stop: function () {
- r.cancelAnimationFrame(n), (e = !1);
- },
- setAnimationLoop: function (s) {
- t = s;
- },
- setContext: function (s) {
- r = s;
- },
- };
- }
- function Od(r, e) {
- const t = e.isWebGL2,
- n = new WeakMap();
- function i(c, u) {
- const h = c.array,
- d = c.usage,
- f = r.createBuffer();
- r.bindBuffer(u, f), r.bufferData(u, h, d), c.onUploadCallback();
- let g;
- if (h instanceof Float32Array) g = 5126;
- else if (h instanceof Uint16Array)
- if (c.isFloat16BufferAttribute)
- if (t) g = 5131;
- else
- throw new Error(
- "THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."
- );
- else g = 5123;
- else if (h instanceof Int16Array) g = 5122;
- else if (h instanceof Uint32Array) g = 5125;
- else if (h instanceof Int32Array) g = 5124;
- else if (h instanceof Int8Array) g = 5120;
- else if (h instanceof Uint8Array) g = 5121;
- else if (h instanceof Uint8ClampedArray) g = 5121;
- else
- throw new Error(
- "THREE.WebGLAttributes: Unsupported buffer data format: " + h
- );
- return {
- buffer: f,
- type: g,
- bytesPerElement: h.BYTES_PER_ELEMENT,
- version: c.version,
- };
- }
- function s(c, u, h) {
- const d = u.array,
- f = u.updateRange;
- r.bindBuffer(h, c),
- f.count === -1
- ? r.bufferSubData(h, 0, d)
- : (t
- ? r.bufferSubData(
- h,
- f.offset * d.BYTES_PER_ELEMENT,
- d,
- f.offset,
- f.count
- )
- : r.bufferSubData(
- h,
- f.offset * d.BYTES_PER_ELEMENT,
- d.subarray(f.offset, f.offset + f.count)
- ),
- (f.count = -1));
- }
- function a(c) {
- return c.isInterleavedBufferAttribute && (c = c.data), n.get(c);
- }
- function o(c) {
- c.isInterleavedBufferAttribute && (c = c.data);
- const u = n.get(c);
- u && (r.deleteBuffer(u.buffer), n.delete(c));
- }
- function l(c, u) {
- if (c.isGLBufferAttribute) {
- const d = n.get(c);
- (!d || d.version < c.version) &&
- n.set(c, {
- buffer: c.buffer,
- type: c.type,
- bytesPerElement: c.elementSize,
- version: c.version,
- });
- return;
- }
- c.isInterleavedBufferAttribute && (c = c.data);
- const h = n.get(c);
- h === void 0
- ? n.set(c, i(c, u))
- : h.version < c.version &&
- (s(h.buffer, c, u), (h.version = c.version));
- }
- return { get: a, remove: o, update: l };
- }
- class Gn extends ct {
- constructor(e = 1, t = 1, n = 1, i = 1) {
- super(),
- (this.type = "PlaneGeometry"),
- (this.parameters = {
- width: e,
- height: t,
- widthSegments: n,
- heightSegments: i,
- });
- const s = e / 2,
- a = t / 2,
- o = Math.floor(n),
- l = Math.floor(i),
- c = o + 1,
- u = l + 1,
- h = e / o,
- d = t / l,
- f = [],
- g = [],
- m = [],
- p = [];
- for (let v = 0; v < u; v++) {
- const M = v * d - a;
- for (let x = 0; x < c; x++) {
- const w = x * h - s;
- g.push(w, -M, 0),
- m.push(0, 0, 1),
- p.push(x / o),
- p.push(1 - v / l);
- }
- }
- for (let v = 0; v < l; v++)
- for (let M = 0; M < o; M++) {
- const x = M + c * v,
- w = M + c * (v + 1),
- y = M + 1 + c * (v + 1),
- A = M + 1 + c * v;
- f.push(x, w, A), f.push(w, y, A);
- }
- this.setIndex(f),
- this.setAttribute("position", new Xe(g, 3)),
- this.setAttribute("normal", new Xe(m, 3)),
- this.setAttribute("uv", new Xe(p, 2));
- }
- static fromJSON(e) {
- return new Gn(e.width, e.height, e.widthSegments, e.heightSegments);
- }
- }
- var kd = `#ifdef USE_ALPHAMAP
- diffuseColor.a *= texture2D( alphaMap, vUv ).g;
-#endif`,
- Ud = `#ifdef USE_ALPHAMAP
- uniform sampler2D alphaMap;
-#endif`,
- Bd = `#ifdef USE_ALPHATEST
- if ( diffuseColor.a < alphaTest ) discard;
-#endif`,
- Vd = `#ifdef USE_ALPHATEST
- uniform float alphaTest;
-#endif`,
- Gd = `#ifdef USE_AOMAP
- float ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;
- reflectedLight.indirectDiffuse *= ambientOcclusion;
- #if defined( USE_ENVMAP ) && defined( STANDARD )
- float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );
- reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
- #endif
-#endif`,
- Hd = `#ifdef USE_AOMAP
- uniform sampler2D aoMap;
- uniform float aoMapIntensity;
-#endif`,
- Wd = "vec3 transformed = vec3( position );",
- jd = `vec3 objectNormal = vec3( normal );
-#ifdef USE_TANGENT
- vec3 objectTangent = vec3( tangent.xyz );
-#endif`,
- Xd = `vec3 BRDF_Lambert( const in vec3 diffuseColor ) {
- return RECIPROCAL_PI * diffuseColor;
-}
-vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
- float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
- return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
-}
-float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
- float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
- return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
-}
-vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {
- float x = clamp( 1.0 - dotVH, 0.0, 1.0 );
- float x2 = x * x;
- float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );
- return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );
-}
-float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {
- float a2 = pow2( alpha );
- float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
- float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
- return 0.5 / max( gv + gl, EPSILON );
-}
-float D_GGX( const in float alpha, const in float dotNH ) {
- float a2 = pow2( alpha );
- float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;
- return RECIPROCAL_PI * a2 / pow2( denom );
-}
-vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {
- float alpha = pow2( roughness );
- vec3 halfDir = normalize( lightDir + viewDir );
- float dotNL = saturate( dot( normal, lightDir ) );
- float dotNV = saturate( dot( normal, viewDir ) );
- float dotNH = saturate( dot( normal, halfDir ) );
- float dotVH = saturate( dot( viewDir, halfDir ) );
- vec3 F = F_Schlick( f0, f90, dotVH );
- float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
- float D = D_GGX( alpha, dotNH );
- return F * ( V * D );
-}
-#ifdef USE_IRIDESCENCE
-vec3 BRDF_GGX_Iridescence( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float iridescence, const in vec3 iridescenceFresnel, const in float roughness ) {
- float alpha = pow2( roughness );
- vec3 halfDir = normalize( lightDir + viewDir );
- float dotNL = saturate( dot( normal, lightDir ) );
- float dotNV = saturate( dot( normal, viewDir ) );
- float dotNH = saturate( dot( normal, halfDir ) );
- float dotVH = saturate( dot( viewDir, halfDir ) );
- vec3 F = mix(F_Schlick( f0, f90, dotVH ), iridescenceFresnel, iridescence);
- float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
- float D = D_GGX( alpha, dotNH );
- return F * ( V * D );
-}
-#endif
-vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {
- const float LUT_SIZE = 64.0;
- const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;
- const float LUT_BIAS = 0.5 / LUT_SIZE;
- float dotNV = saturate( dot( N, V ) );
- vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );
- uv = uv * LUT_SCALE + LUT_BIAS;
- return uv;
-}
-float LTC_ClippedSphereFormFactor( const in vec3 f ) {
- float l = length( f );
- return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );
-}
-vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {
- float x = dot( v1, v2 );
- float y = abs( x );
- float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;
- float b = 3.4175940 + ( 4.1616724 + y ) * y;
- float v = a / b;
- float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;
- return cross( v1, v2 ) * theta_sintheta;
-}
-vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {
- vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];
- vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];
- vec3 lightNormal = cross( v1, v2 );
- if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );
- vec3 T1, T2;
- T1 = normalize( V - N * dot( V, N ) );
- T2 = - cross( N, T1 );
- mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );
- vec3 coords[ 4 ];
- coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );
- coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );
- coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );
- coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );
- coords[ 0 ] = normalize( coords[ 0 ] );
- coords[ 1 ] = normalize( coords[ 1 ] );
- coords[ 2 ] = normalize( coords[ 2 ] );
- coords[ 3 ] = normalize( coords[ 3 ] );
- vec3 vectorFormFactor = vec3( 0.0 );
- vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );
- vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );
- vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );
- vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );
- float result = LTC_ClippedSphereFormFactor( vectorFormFactor );
- return vec3( result );
-}
-float G_BlinnPhong_Implicit( ) {
- return 0.25;
-}
-float D_BlinnPhong( const in float shininess, const in float dotNH ) {
- return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );
-}
-vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {
- vec3 halfDir = normalize( lightDir + viewDir );
- float dotNH = saturate( dot( normal, halfDir ) );
- float dotVH = saturate( dot( viewDir, halfDir ) );
- vec3 F = F_Schlick( specularColor, 1.0, dotVH );
- float G = G_BlinnPhong_Implicit( );
- float D = D_BlinnPhong( shininess, dotNH );
- return F * ( G * D );
-}
-#if defined( USE_SHEEN )
-float D_Charlie( float roughness, float dotNH ) {
- float alpha = pow2( roughness );
- float invAlpha = 1.0 / alpha;
- float cos2h = dotNH * dotNH;
- float sin2h = max( 1.0 - cos2h, 0.0078125 );
- return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );
-}
-float V_Neubelt( float dotNV, float dotNL ) {
- return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );
-}
-vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {
- vec3 halfDir = normalize( lightDir + viewDir );
- float dotNL = saturate( dot( normal, lightDir ) );
- float dotNV = saturate( dot( normal, viewDir ) );
- float dotNH = saturate( dot( normal, halfDir ) );
- float D = D_Charlie( sheenRoughness, dotNH );
- float V = V_Neubelt( dotNV, dotNL );
- return sheenColor * ( D * V );
-}
-#endif`,
- qd = `#ifdef USE_IRIDESCENCE
-const mat3 XYZ_TO_REC709 = mat3(
- 3.2404542, -0.9692660, 0.0556434,
- -1.5371385, 1.8760108, -0.2040259,
- -0.4985314, 0.0415560, 1.0572252
-);
-vec3 Fresnel0ToIor( vec3 fresnel0 ) {
- vec3 sqrtF0 = sqrt( fresnel0 );
- return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );
-}
-vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {
- return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );
-}
-float IorToFresnel0( float transmittedIor, float incidentIor ) {
- return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));
-}
-vec3 evalSensitivity( float OPD, vec3 shift ) {
- float phase = 2.0 * PI * OPD * 1.0e-9;
- vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );
- vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );
- vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );
- vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( -pow2( phase ) * var );
- xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[0] ) * exp( -4.5282e+09 * pow2( phase ) );
- xyz /= 1.0685e-7;
- vec3 srgb = XYZ_TO_REC709 * xyz;
- return srgb;
-}
-vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {
- vec3 I;
- float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );
- float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );
- float cosTheta2Sq = 1.0 - sinTheta2Sq;
- if ( cosTheta2Sq < 0.0 ) {
- return vec3( 1.0 );
- }
- float cosTheta2 = sqrt( cosTheta2Sq );
- float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );
- float R12 = F_Schlick( R0, 1.0, cosTheta1 );
- float R21 = R12;
- float T121 = 1.0 - R12;
- float phi12 = 0.0;
- if ( iridescenceIOR < outsideIOR ) phi12 = PI;
- float phi21 = PI - phi12;
- vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );
- vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );
- vec3 phi23 = vec3( 0.0 );
- if ( baseIOR[0] < iridescenceIOR ) phi23[0] = PI;
- if ( baseIOR[1] < iridescenceIOR ) phi23[1] = PI;
- if ( baseIOR[2] < iridescenceIOR ) phi23[2] = PI;
- float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;
- vec3 phi = vec3( phi21 ) + phi23;
- vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );
- vec3 r123 = sqrt( R123 );
- vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );
- vec3 C0 = R12 + Rs;
- I = C0;
- vec3 Cm = Rs - T121;
- for ( int m = 1; m <= 2; ++m ) {
- Cm *= r123;
- vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );
- I += Cm * Sm;
- }
- return max( I, vec3( 0.0 ) );
-}
-#endif`,
- $d = `#ifdef USE_BUMPMAP
- uniform sampler2D bumpMap;
- uniform float bumpScale;
- vec2 dHdxy_fwd() {
- vec2 dSTdx = dFdx( vUv );
- vec2 dSTdy = dFdy( vUv );
- float Hll = bumpScale * texture2D( bumpMap, vUv ).x;
- float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;
- float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;
- return vec2( dBx, dBy );
- }
- vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {
- vec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );
- vec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );
- vec3 vN = surf_norm;
- vec3 R1 = cross( vSigmaY, vN );
- vec3 R2 = cross( vN, vSigmaX );
- float fDet = dot( vSigmaX, R1 ) * faceDirection;
- vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
- return normalize( abs( fDet ) * surf_norm - vGrad );
- }
-#endif`,
- Yd = `#if NUM_CLIPPING_PLANES > 0
- vec4 plane;
- #pragma unroll_loop_start
- for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
- plane = clippingPlanes[ i ];
- if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;
- }
- #pragma unroll_loop_end
- #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
- bool clipped = true;
- #pragma unroll_loop_start
- for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
- plane = clippingPlanes[ i ];
- clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;
- }
- #pragma unroll_loop_end
- if ( clipped ) discard;
- #endif
-#endif`,
- Kd = `#if NUM_CLIPPING_PLANES > 0
- varying vec3 vClipPosition;
- uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
-#endif`,
- Zd = `#if NUM_CLIPPING_PLANES > 0
- varying vec3 vClipPosition;
-#endif`,
- Jd = `#if NUM_CLIPPING_PLANES > 0
- vClipPosition = - mvPosition.xyz;
-#endif`,
- Qd = `#if defined( USE_COLOR_ALPHA )
- diffuseColor *= vColor;
-#elif defined( USE_COLOR )
- diffuseColor.rgb *= vColor;
-#endif`,
- ef = `#if defined( USE_COLOR_ALPHA )
- varying vec4 vColor;
-#elif defined( USE_COLOR )
- varying vec3 vColor;
-#endif`,
- tf = `#if defined( USE_COLOR_ALPHA )
- varying vec4 vColor;
-#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )
- varying vec3 vColor;
-#endif`,
- nf = `#if defined( USE_COLOR_ALPHA )
- vColor = vec4( 1.0 );
-#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )
- vColor = vec3( 1.0 );
-#endif
-#ifdef USE_COLOR
- vColor *= color;
-#endif
-#ifdef USE_INSTANCING_COLOR
- vColor.xyz *= instanceColor.xyz;
-#endif`,
- sf = `#define PI 3.141592653589793
-#define PI2 6.283185307179586
-#define PI_HALF 1.5707963267948966
-#define RECIPROCAL_PI 0.3183098861837907
-#define RECIPROCAL_PI2 0.15915494309189535
-#define EPSILON 1e-6
-#ifndef saturate
-#define saturate( a ) clamp( a, 0.0, 1.0 )
-#endif
-#define whiteComplement( a ) ( 1.0 - saturate( a ) )
-float pow2( const in float x ) { return x*x; }
-vec3 pow2( const in vec3 x ) { return x*x; }
-float pow3( const in float x ) { return x*x*x; }
-float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
-float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }
-float average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }
-highp float rand( const in vec2 uv ) {
- const highp float a = 12.9898, b = 78.233, c = 43758.5453;
- highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
- return fract( sin( sn ) * c );
-}
-#ifdef HIGH_PRECISION
- float precisionSafeLength( vec3 v ) { return length( v ); }
-#else
- float precisionSafeLength( vec3 v ) {
- float maxComponent = max3( abs( v ) );
- return length( v / maxComponent ) * maxComponent;
- }
-#endif
-struct IncidentLight {
- vec3 color;
- vec3 direction;
- bool visible;
-};
-struct ReflectedLight {
- vec3 directDiffuse;
- vec3 directSpecular;
- vec3 indirectDiffuse;
- vec3 indirectSpecular;
-};
-struct GeometricContext {
- vec3 position;
- vec3 normal;
- vec3 viewDir;
-#ifdef USE_CLEARCOAT
- vec3 clearcoatNormal;
-#endif
-};
-vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
- return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
-}
-vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {
- return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );
-}
-mat3 transposeMat3( const in mat3 m ) {
- mat3 tmp;
- tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );
- tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );
- tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );
- return tmp;
-}
-float linearToRelativeLuminance( const in vec3 color ) {
- vec3 weights = vec3( 0.2126, 0.7152, 0.0722 );
- return dot( weights, color.rgb );
-}
-bool isPerspectiveMatrix( mat4 m ) {
- return m[ 2 ][ 3 ] == - 1.0;
-}
-vec2 equirectUv( in vec3 dir ) {
- float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;
- float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
- return vec2( u, v );
-}`,
- rf = `#ifdef ENVMAP_TYPE_CUBE_UV
- #define cubeUV_minMipLevel 4.0
- #define cubeUV_minTileSize 16.0
- float getFace( vec3 direction ) {
- vec3 absDirection = abs( direction );
- float face = - 1.0;
- if ( absDirection.x > absDirection.z ) {
- if ( absDirection.x > absDirection.y )
- face = direction.x > 0.0 ? 0.0 : 3.0;
- else
- face = direction.y > 0.0 ? 1.0 : 4.0;
- } else {
- if ( absDirection.z > absDirection.y )
- face = direction.z > 0.0 ? 2.0 : 5.0;
- else
- face = direction.y > 0.0 ? 1.0 : 4.0;
- }
- return face;
- }
- vec2 getUV( vec3 direction, float face ) {
- vec2 uv;
- if ( face == 0.0 ) {
- uv = vec2( direction.z, direction.y ) / abs( direction.x );
- } else if ( face == 1.0 ) {
- uv = vec2( - direction.x, - direction.z ) / abs( direction.y );
- } else if ( face == 2.0 ) {
- uv = vec2( - direction.x, direction.y ) / abs( direction.z );
- } else if ( face == 3.0 ) {
- uv = vec2( - direction.z, direction.y ) / abs( direction.x );
- } else if ( face == 4.0 ) {
- uv = vec2( - direction.x, direction.z ) / abs( direction.y );
- } else {
- uv = vec2( direction.x, direction.y ) / abs( direction.z );
- }
- return 0.5 * ( uv + 1.0 );
- }
- vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {
- float face = getFace( direction );
- float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );
- mipInt = max( mipInt, cubeUV_minMipLevel );
- float faceSize = exp2( mipInt );
- vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;
- if ( face > 2.0 ) {
- uv.y += faceSize;
- face -= 3.0;
- }
- uv.x += face * faceSize;
- uv.x += filterInt * 3.0 * cubeUV_minTileSize;
- uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );
- uv.x *= CUBEUV_TEXEL_WIDTH;
- uv.y *= CUBEUV_TEXEL_HEIGHT;
- #ifdef texture2DGradEXT
- return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;
- #else
- return texture2D( envMap, uv ).rgb;
- #endif
- }
- #define r0 1.0
- #define v0 0.339
- #define m0 - 2.0
- #define r1 0.8
- #define v1 0.276
- #define m1 - 1.0
- #define r4 0.4
- #define v4 0.046
- #define m4 2.0
- #define r5 0.305
- #define v5 0.016
- #define m5 3.0
- #define r6 0.21
- #define v6 0.0038
- #define m6 4.0
- float roughnessToMip( float roughness ) {
- float mip = 0.0;
- if ( roughness >= r1 ) {
- mip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;
- } else if ( roughness >= r4 ) {
- mip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;
- } else if ( roughness >= r5 ) {
- mip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;
- } else if ( roughness >= r6 ) {
- mip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;
- } else {
- mip = - 2.0 * log2( 1.16 * roughness ); }
- return mip;
- }
- vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {
- float mip = clamp( roughnessToMip( roughness ), m0, CUBEUV_MAX_MIP );
- float mipF = fract( mip );
- float mipInt = floor( mip );
- vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );
- if ( mipF == 0.0 ) {
- return vec4( color0, 1.0 );
- } else {
- vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );
- return vec4( mix( color0, color1, mipF ), 1.0 );
- }
- }
-#endif`,
- af = `vec3 transformedNormal = objectNormal;
-#ifdef USE_INSTANCING
- mat3 m = mat3( instanceMatrix );
- transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );
- transformedNormal = m * transformedNormal;
-#endif
-transformedNormal = normalMatrix * transformedNormal;
-#ifdef FLIP_SIDED
- transformedNormal = - transformedNormal;
-#endif
-#ifdef USE_TANGENT
- vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;
- #ifdef FLIP_SIDED
- transformedTangent = - transformedTangent;
- #endif
-#endif`,
- of = `#ifdef USE_DISPLACEMENTMAP
- uniform sampler2D displacementMap;
- uniform float displacementScale;
- uniform float displacementBias;
-#endif`,
- lf = `#ifdef USE_DISPLACEMENTMAP
- transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );
-#endif`,
- cf = `#ifdef USE_EMISSIVEMAP
- vec4 emissiveColor = texture2D( emissiveMap, vUv );
- totalEmissiveRadiance *= emissiveColor.rgb;
-#endif`,
- hf = `#ifdef USE_EMISSIVEMAP
- uniform sampler2D emissiveMap;
-#endif`,
- uf = "gl_FragColor = linearToOutputTexel( gl_FragColor );",
- df = `vec4 LinearToLinear( in vec4 value ) {
- return value;
-}
-vec4 LinearTosRGB( in vec4 value ) {
- return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );
-}`,
- ff = `#ifdef USE_ENVMAP
- #ifdef ENV_WORLDPOS
- vec3 cameraToFrag;
- if ( isOrthographic ) {
- cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
- } else {
- cameraToFrag = normalize( vWorldPosition - cameraPosition );
- }
- vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
- #ifdef ENVMAP_MODE_REFLECTION
- vec3 reflectVec = reflect( cameraToFrag, worldNormal );
- #else
- vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );
- #endif
- #else
- vec3 reflectVec = vReflect;
- #endif
- #ifdef ENVMAP_TYPE_CUBE
- vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
- #elif defined( ENVMAP_TYPE_CUBE_UV )
- vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );
- #else
- vec4 envColor = vec4( 0.0 );
- #endif
- #ifdef ENVMAP_BLENDING_MULTIPLY
- outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );
- #elif defined( ENVMAP_BLENDING_MIX )
- outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );
- #elif defined( ENVMAP_BLENDING_ADD )
- outgoingLight += envColor.xyz * specularStrength * reflectivity;
- #endif
-#endif`,
- pf = `#ifdef USE_ENVMAP
- uniform float envMapIntensity;
- uniform float flipEnvMap;
- #ifdef ENVMAP_TYPE_CUBE
- uniform samplerCube envMap;
- #else
- uniform sampler2D envMap;
- #endif
-
-#endif`,
- mf = `#ifdef USE_ENVMAP
- uniform float reflectivity;
- #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )
- #define ENV_WORLDPOS
- #endif
- #ifdef ENV_WORLDPOS
- varying vec3 vWorldPosition;
- uniform float refractionRatio;
- #else
- varying vec3 vReflect;
- #endif
-#endif`,
- gf = `#ifdef USE_ENVMAP
- #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )
- #define ENV_WORLDPOS
- #endif
- #ifdef ENV_WORLDPOS
-
- varying vec3 vWorldPosition;
- #else
- varying vec3 vReflect;
- uniform float refractionRatio;
- #endif
-#endif`,
- vf = `#ifdef USE_ENVMAP
- #ifdef ENV_WORLDPOS
- vWorldPosition = worldPosition.xyz;
- #else
- vec3 cameraToVertex;
- if ( isOrthographic ) {
- cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
- } else {
- cameraToVertex = normalize( worldPosition.xyz - cameraPosition );
- }
- vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
- #ifdef ENVMAP_MODE_REFLECTION
- vReflect = reflect( cameraToVertex, worldNormal );
- #else
- vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
- #endif
- #endif
-#endif`,
- _f = `#ifdef USE_FOG
- vFogDepth = - mvPosition.z;
-#endif`,
- xf = `#ifdef USE_FOG
- varying float vFogDepth;
-#endif`,
- yf = `#ifdef USE_FOG
- #ifdef FOG_EXP2
- float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
- #else
- float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
- #endif
- gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
-#endif`,
- Mf = `#ifdef USE_FOG
- uniform vec3 fogColor;
- varying float vFogDepth;
- #ifdef FOG_EXP2
- uniform float fogDensity;
- #else
- uniform float fogNear;
- uniform float fogFar;
- #endif
-#endif`,
- wf = `#ifdef USE_GRADIENTMAP
- uniform sampler2D gradientMap;
-#endif
-vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
- float dotNL = dot( normal, lightDirection );
- vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );
- #ifdef USE_GRADIENTMAP
- return vec3( texture2D( gradientMap, coord ).r );
- #else
- return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );
- #endif
-}`,
- bf = `#ifdef USE_LIGHTMAP
- vec4 lightMapTexel = texture2D( lightMap, vUv2 );
- vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
- reflectedLight.indirectDiffuse += lightMapIrradiance;
-#endif`,
- Sf = `#ifdef USE_LIGHTMAP
- uniform sampler2D lightMap;
- uniform float lightMapIntensity;
-#endif`,
- Tf = `vec3 diffuse = vec3( 1.0 );
-GeometricContext geometry;
-geometry.position = mvPosition.xyz;
-geometry.normal = normalize( transformedNormal );
-geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );
-GeometricContext backGeometry;
-backGeometry.position = geometry.position;
-backGeometry.normal = -geometry.normal;
-backGeometry.viewDir = geometry.viewDir;
-vLightFront = vec3( 0.0 );
-vIndirectFront = vec3( 0.0 );
-#ifdef DOUBLE_SIDED
- vLightBack = vec3( 0.0 );
- vIndirectBack = vec3( 0.0 );
-#endif
-IncidentLight directLight;
-float dotNL;
-vec3 directLightColor_Diffuse;
-vIndirectFront += getAmbientLightIrradiance( ambientLightColor );
-vIndirectFront += getLightProbeIrradiance( lightProbe, geometry.normal );
-#ifdef DOUBLE_SIDED
- vIndirectBack += getAmbientLightIrradiance( ambientLightColor );
- vIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry.normal );
-#endif
-#if NUM_POINT_LIGHTS > 0
- #pragma unroll_loop_start
- for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
- getPointLightInfo( pointLights[ i ], geometry, directLight );
- dotNL = dot( geometry.normal, directLight.direction );
- directLightColor_Diffuse = directLight.color;
- vLightFront += saturate( dotNL ) * directLightColor_Diffuse;
- #ifdef DOUBLE_SIDED
- vLightBack += saturate( - dotNL ) * directLightColor_Diffuse;
- #endif
- }
- #pragma unroll_loop_end
-#endif
-#if NUM_SPOT_LIGHTS > 0
- #pragma unroll_loop_start
- for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
- getSpotLightInfo( spotLights[ i ], geometry, directLight );
- dotNL = dot( geometry.normal, directLight.direction );
- directLightColor_Diffuse = directLight.color;
- vLightFront += saturate( dotNL ) * directLightColor_Diffuse;
- #ifdef DOUBLE_SIDED
- vLightBack += saturate( - dotNL ) * directLightColor_Diffuse;
- #endif
- }
- #pragma unroll_loop_end
-#endif
-#if NUM_DIR_LIGHTS > 0
- #pragma unroll_loop_start
- for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
- getDirectionalLightInfo( directionalLights[ i ], geometry, directLight );
- dotNL = dot( geometry.normal, directLight.direction );
- directLightColor_Diffuse = directLight.color;
- vLightFront += saturate( dotNL ) * directLightColor_Diffuse;
- #ifdef DOUBLE_SIDED
- vLightBack += saturate( - dotNL ) * directLightColor_Diffuse;
- #endif
- }
- #pragma unroll_loop_end
-#endif
-#if NUM_HEMI_LIGHTS > 0
- #pragma unroll_loop_start
- for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
- vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );
- #ifdef DOUBLE_SIDED
- vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry.normal );
- #endif
- }
- #pragma unroll_loop_end
-#endif`,
- Ef = `uniform bool receiveShadow;
-uniform vec3 ambientLightColor;
-uniform vec3 lightProbe[ 9 ];
-vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {
- float x = normal.x, y = normal.y, z = normal.z;
- vec3 result = shCoefficients[ 0 ] * 0.886227;
- result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;
- result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;
- result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;
- result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;
- result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;
- result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );
- result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;
- result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );
- return result;
-}
-vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {
- vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
- vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );
- return irradiance;
-}
-vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
- vec3 irradiance = ambientLightColor;
- return irradiance;
-}
-float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {
- #if defined ( PHYSICALLY_CORRECT_LIGHTS )
- float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
- if ( cutoffDistance > 0.0 ) {
- distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
- }
- return distanceFalloff;
- #else
- if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {
- return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );
- }
- return 1.0;
- #endif
-}
-float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {
- return smoothstep( coneCosine, penumbraCosine, angleCosine );
-}
-#if NUM_DIR_LIGHTS > 0
- struct DirectionalLight {
- vec3 direction;
- vec3 color;
- };
- uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
- void getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {
- light.color = directionalLight.color;
- light.direction = directionalLight.direction;
- light.visible = true;
- }
-#endif
-#if NUM_POINT_LIGHTS > 0
- struct PointLight {
- vec3 position;
- vec3 color;
- float distance;
- float decay;
- };
- uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
- void getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {
- vec3 lVector = pointLight.position - geometry.position;
- light.direction = normalize( lVector );
- float lightDistance = length( lVector );
- light.color = pointLight.color;
- light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );
- light.visible = ( light.color != vec3( 0.0 ) );
- }
-#endif
-#if NUM_SPOT_LIGHTS > 0
- struct SpotLight {
- vec3 position;
- vec3 direction;
- vec3 color;
- float distance;
- float decay;
- float coneCos;
- float penumbraCos;
- };
- uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
- void getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {
- vec3 lVector = spotLight.position - geometry.position;
- light.direction = normalize( lVector );
- float angleCos = dot( light.direction, spotLight.direction );
- float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );
- if ( spotAttenuation > 0.0 ) {
- float lightDistance = length( lVector );
- light.color = spotLight.color * spotAttenuation;
- light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );
- light.visible = ( light.color != vec3( 0.0 ) );
- } else {
- light.color = vec3( 0.0 );
- light.visible = false;
- }
- }
-#endif
-#if NUM_RECT_AREA_LIGHTS > 0
- struct RectAreaLight {
- vec3 color;
- vec3 position;
- vec3 halfWidth;
- vec3 halfHeight;
- };
- uniform sampler2D ltc_1; uniform sampler2D ltc_2;
- uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];
-#endif
-#if NUM_HEMI_LIGHTS > 0
- struct HemisphereLight {
- vec3 direction;
- vec3 skyColor;
- vec3 groundColor;
- };
- uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
- vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {
- float dotNL = dot( normal, hemiLight.direction );
- float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
- vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
- return irradiance;
- }
-#endif`,
- Af = `#if defined( USE_ENVMAP )
- vec3 getIBLIrradiance( const in vec3 normal ) {
- #if defined( ENVMAP_TYPE_CUBE_UV )
- vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
- vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );
- return PI * envMapColor.rgb * envMapIntensity;
- #else
- return vec3( 0.0 );
- #endif
- }
- vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {
- #if defined( ENVMAP_TYPE_CUBE_UV )
- vec3 reflectVec = reflect( - viewDir, normal );
- reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );
- reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
- vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );
- return envMapColor.rgb * envMapIntensity;
- #else
- return vec3( 0.0 );
- #endif
- }
-#endif`,
- Cf = `ToonMaterial material;
-material.diffuseColor = diffuseColor.rgb;`,
- Lf = `varying vec3 vViewPosition;
-struct ToonMaterial {
- vec3 diffuseColor;
-};
-void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
- vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;
- reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
-}
-void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
- reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
-}
-#define RE_Direct RE_Direct_Toon
-#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon
-#define Material_LightProbeLOD( material ) (0)`,
- Rf = `BlinnPhongMaterial material;
-material.diffuseColor = diffuseColor.rgb;
-material.specularColor = specular;
-material.specularShininess = shininess;
-material.specularStrength = specularStrength;`,
- Pf = `varying vec3 vViewPosition;
-struct BlinnPhongMaterial {
- vec3 diffuseColor;
- vec3 specularColor;
- float specularShininess;
- float specularStrength;
-};
-void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
- float dotNL = saturate( dot( geometry.normal, directLight.direction ) );
- vec3 irradiance = dotNL * directLight.color;
- reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
- reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;
-}
-void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
- reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
-}
-#define RE_Direct RE_Direct_BlinnPhong
-#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong
-#define Material_LightProbeLOD( material ) (0)`,
- Df = `PhysicalMaterial material;
-material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
-vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );
-float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
-material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;
-material.roughness = min( material.roughness, 1.0 );
-#ifdef IOR
- #ifdef SPECULAR
- float specularIntensityFactor = specularIntensity;
- vec3 specularColorFactor = specularColor;
- #ifdef USE_SPECULARINTENSITYMAP
- specularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;
- #endif
- #ifdef USE_SPECULARCOLORMAP
- specularColorFactor *= texture2D( specularColorMap, vUv ).rgb;
- #endif
- material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );
- #else
- float specularIntensityFactor = 1.0;
- vec3 specularColorFactor = vec3( 1.0 );
- material.specularF90 = 1.0;
- #endif
- material.specularColor = mix( min( pow2( ( ior - 1.0 ) / ( ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );
-#else
- material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );
- material.specularF90 = 1.0;
-#endif
-#ifdef USE_CLEARCOAT
- material.clearcoat = clearcoat;
- material.clearcoatRoughness = clearcoatRoughness;
- material.clearcoatF0 = vec3( 0.04 );
- material.clearcoatF90 = 1.0;
- #ifdef USE_CLEARCOATMAP
- material.clearcoat *= texture2D( clearcoatMap, vUv ).x;
- #endif
- #ifdef USE_CLEARCOAT_ROUGHNESSMAP
- material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;
- #endif
- material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );
- material.clearcoatRoughness += geometryRoughness;
- material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );
-#endif
-#ifdef USE_IRIDESCENCE
- material.iridescence = iridescence;
- material.iridescenceIOR = iridescenceIOR;
- #ifdef USE_IRIDESCENCEMAP
- material.iridescence *= texture2D( iridescenceMap, vUv ).r;
- #endif
- #ifdef USE_IRIDESCENCE_THICKNESSMAP
- material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vUv ).g + iridescenceThicknessMinimum;
- #else
- material.iridescenceThickness = iridescenceThicknessMaximum;
- #endif
-#endif
-#ifdef USE_SHEEN
- material.sheenColor = sheenColor;
- #ifdef USE_SHEENCOLORMAP
- material.sheenColor *= texture2D( sheenColorMap, vUv ).rgb;
- #endif
- material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );
- #ifdef USE_SHEENROUGHNESSMAP
- material.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;
- #endif
-#endif`,
- If = `struct PhysicalMaterial {
- vec3 diffuseColor;
- float roughness;
- vec3 specularColor;
- float specularF90;
- #ifdef USE_CLEARCOAT
- float clearcoat;
- float clearcoatRoughness;
- vec3 clearcoatF0;
- float clearcoatF90;
- #endif
- #ifdef USE_IRIDESCENCE
- float iridescence;
- float iridescenceIOR;
- float iridescenceThickness;
- vec3 iridescenceFresnel;
- vec3 iridescenceF0;
- #endif
- #ifdef USE_SHEEN
- vec3 sheenColor;
- float sheenRoughness;
- #endif
-};
-vec3 clearcoatSpecular = vec3( 0.0 );
-vec3 sheenSpecular = vec3( 0.0 );
-float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness) {
- float dotNV = saturate( dot( normal, viewDir ) );
- float r2 = roughness * roughness;
- float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;
- float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;
- float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );
- return saturate( DG * RECIPROCAL_PI );
-}
-vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
- float dotNV = saturate( dot( normal, viewDir ) );
- const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );
- const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );
- vec4 r = roughness * c0 + c1;
- float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;
- vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;
- return fab;
-}
-vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {
- vec2 fab = DFGApprox( normal, viewDir, roughness );
- return specularColor * fab.x + specularF90 * fab.y;
-}
-#ifdef USE_IRIDESCENCE
-void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
-#else
-void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
-#endif
- vec2 fab = DFGApprox( normal, viewDir, roughness );
- #ifdef USE_IRIDESCENCE
- vec3 Fr = mix( specularColor, iridescenceF0, iridescence );
- #else
- vec3 Fr = specularColor;
- #endif
- vec3 FssEss = Fr * fab.x + specularF90 * fab.y;
- float Ess = fab.x + fab.y;
- float Ems = 1.0 - Ess;
- vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );
- singleScatter += FssEss;
- multiScatter += Fms * Ems;
-}
-#if NUM_RECT_AREA_LIGHTS > 0
- void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
- vec3 normal = geometry.normal;
- vec3 viewDir = geometry.viewDir;
- vec3 position = geometry.position;
- vec3 lightPos = rectAreaLight.position;
- vec3 halfWidth = rectAreaLight.halfWidth;
- vec3 halfHeight = rectAreaLight.halfHeight;
- vec3 lightColor = rectAreaLight.color;
- float roughness = material.roughness;
- vec3 rectCoords[ 4 ];
- rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;
- rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;
- rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;
- vec2 uv = LTC_Uv( normal, viewDir, roughness );
- vec4 t1 = texture2D( ltc_1, uv );
- vec4 t2 = texture2D( ltc_2, uv );
- mat3 mInv = mat3(
- vec3( t1.x, 0, t1.y ),
- vec3( 0, 1, 0 ),
- vec3( t1.z, 0, t1.w )
- );
- vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );
- reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );
- reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );
- }
-#endif
-void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
- float dotNL = saturate( dot( geometry.normal, directLight.direction ) );
- vec3 irradiance = dotNL * directLight.color;
- #ifdef USE_CLEARCOAT
- float dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );
- vec3 ccIrradiance = dotNLcc * directLight.color;
- clearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
- #endif
- #ifdef USE_SHEEN
- sheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );
- #endif
- #ifdef USE_IRIDESCENCE
- reflectedLight.directSpecular += irradiance * BRDF_GGX_Iridescence( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness );
- #else
- reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );
- #endif
- reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
-}
-void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
- reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
-}
-void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {
- #ifdef USE_CLEARCOAT
- clearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
- #endif
- #ifdef USE_SHEEN
- sheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );
- #endif
- vec3 singleScattering = vec3( 0.0 );
- vec3 multiScattering = vec3( 0.0 );
- vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
- #ifdef USE_IRIDESCENCE
- computeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );
- #else
- computeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );
- #endif
- vec3 totalScattering = singleScattering + multiScattering;
- vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );
- reflectedLight.indirectSpecular += radiance * singleScattering;
- reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;
- reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;
-}
-#define RE_Direct RE_Direct_Physical
-#define RE_Direct_RectArea RE_Direct_RectArea_Physical
-#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical
-#define RE_IndirectSpecular RE_IndirectSpecular_Physical
-float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
- return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
-}`,
- Ff = `
-GeometricContext geometry;
-geometry.position = - vViewPosition;
-geometry.normal = normal;
-geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
-#ifdef USE_CLEARCOAT
- geometry.clearcoatNormal = clearcoatNormal;
-#endif
-#ifdef USE_IRIDESCENCE
-float dotNVi = saturate( dot( normal, geometry.viewDir ) );
-if ( material.iridescenceThickness == 0.0 ) {
- material.iridescence = 0.0;
-} else {
- material.iridescence = saturate( material.iridescence );
-}
-if ( material.iridescence > 0.0 ) {
- material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
- material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );
-}
-#endif
-IncidentLight directLight;
-#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
- PointLight pointLight;
- #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
- PointLightShadow pointLightShadow;
- #endif
- #pragma unroll_loop_start
- for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
- pointLight = pointLights[ i ];
- getPointLightInfo( pointLight, geometry, directLight );
- #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )
- pointLightShadow = pointLightShadows[ i ];
- directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
- #endif
- RE_Direct( directLight, geometry, material, reflectedLight );
- }
- #pragma unroll_loop_end
-#endif
-#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
- SpotLight spotLight;
- #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
- SpotLightShadow spotLightShadow;
- #endif
- #pragma unroll_loop_start
- for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
- spotLight = spotLights[ i ];
- getSpotLightInfo( spotLight, geometry, directLight );
- #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
- spotLightShadow = spotLightShadows[ i ];
- directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;
- #endif
- RE_Direct( directLight, geometry, material, reflectedLight );
- }
- #pragma unroll_loop_end
-#endif
-#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )
- DirectionalLight directionalLight;
- #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
- DirectionalLightShadow directionalLightShadow;
- #endif
- #pragma unroll_loop_start
- for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
- directionalLight = directionalLights[ i ];
- getDirectionalLightInfo( directionalLight, geometry, directLight );
- #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
- directionalLightShadow = directionalLightShadows[ i ];
- directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
- #endif
- RE_Direct( directLight, geometry, material, reflectedLight );
- }
- #pragma unroll_loop_end
-#endif
-#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )
- RectAreaLight rectAreaLight;
- #pragma unroll_loop_start
- for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
- rectAreaLight = rectAreaLights[ i ];
- RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );
- }
- #pragma unroll_loop_end
-#endif
-#if defined( RE_IndirectDiffuse )
- vec3 iblIrradiance = vec3( 0.0 );
- vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
- irradiance += getLightProbeIrradiance( lightProbe, geometry.normal );
- #if ( NUM_HEMI_LIGHTS > 0 )
- #pragma unroll_loop_start
- for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
- irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );
- }
- #pragma unroll_loop_end
- #endif
-#endif
-#if defined( RE_IndirectSpecular )
- vec3 radiance = vec3( 0.0 );
- vec3 clearcoatRadiance = vec3( 0.0 );
-#endif`,
- Nf = `#if defined( RE_IndirectDiffuse )
- #ifdef USE_LIGHTMAP
- vec4 lightMapTexel = texture2D( lightMap, vUv2 );
- vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
- irradiance += lightMapIrradiance;
- #endif
- #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )
- iblIrradiance += getIBLIrradiance( geometry.normal );
- #endif
-#endif
-#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
- radiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );
- #ifdef USE_CLEARCOAT
- clearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );
- #endif
-#endif`,
- zf = `#if defined( RE_IndirectDiffuse )
- RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );
-#endif
-#if defined( RE_IndirectSpecular )
- RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );
-#endif`,
- Of = `#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
- gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
-#endif`,
- kf = `#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
- uniform float logDepthBufFC;
- varying float vFragDepth;
- varying float vIsPerspective;
-#endif`,
- Uf = `#ifdef USE_LOGDEPTHBUF
- #ifdef USE_LOGDEPTHBUF_EXT
- varying float vFragDepth;
- varying float vIsPerspective;
- #else
- uniform float logDepthBufFC;
- #endif
-#endif`,
- Bf = `#ifdef USE_LOGDEPTHBUF
- #ifdef USE_LOGDEPTHBUF_EXT
- vFragDepth = 1.0 + gl_Position.w;
- vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
- #else
- if ( isPerspectiveMatrix( projectionMatrix ) ) {
- gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;
- gl_Position.z *= gl_Position.w;
- }
- #endif
-#endif`,
- Vf = `#ifdef USE_MAP
- vec4 sampledDiffuseColor = texture2D( map, vUv );
- #ifdef DECODE_VIDEO_TEXTURE
- sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );
- #endif
- diffuseColor *= sampledDiffuseColor;
-#endif`,
- Gf = `#ifdef USE_MAP
- uniform sampler2D map;
-#endif`,
- Hf = `#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
- vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
-#endif
-#ifdef USE_MAP
- diffuseColor *= texture2D( map, uv );
-#endif
-#ifdef USE_ALPHAMAP
- diffuseColor.a *= texture2D( alphaMap, uv ).g;
-#endif`,
- Wf = `#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
- uniform mat3 uvTransform;
-#endif
-#ifdef USE_MAP
- uniform sampler2D map;
-#endif
-#ifdef USE_ALPHAMAP
- uniform sampler2D alphaMap;
-#endif`,
- jf = `float metalnessFactor = metalness;
-#ifdef USE_METALNESSMAP
- vec4 texelMetalness = texture2D( metalnessMap, vUv );
- metalnessFactor *= texelMetalness.b;
-#endif`,
- Xf = `#ifdef USE_METALNESSMAP
- uniform sampler2D metalnessMap;
-#endif`,
- qf = `#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )
- vColor *= morphTargetBaseInfluence;
- for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
- #if defined( USE_COLOR_ALPHA )
- if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];
- #elif defined( USE_COLOR )
- if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
- #endif
- }
-#endif`,
- $f = `#ifdef USE_MORPHNORMALS
- objectNormal *= morphTargetBaseInfluence;
- #ifdef MORPHTARGETS_TEXTURE
- for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
- if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
- }
- #else
- objectNormal += morphNormal0 * morphTargetInfluences[ 0 ];
- objectNormal += morphNormal1 * morphTargetInfluences[ 1 ];
- objectNormal += morphNormal2 * morphTargetInfluences[ 2 ];
- objectNormal += morphNormal3 * morphTargetInfluences[ 3 ];
- #endif
-#endif`,
- Yf = `#ifdef USE_MORPHTARGETS
- uniform float morphTargetBaseInfluence;
- #ifdef MORPHTARGETS_TEXTURE
- uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
- uniform sampler2DArray morphTargetsTexture;
- uniform ivec2 morphTargetsTextureSize;
- vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {
- int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;
- int y = texelIndex / morphTargetsTextureSize.x;
- int x = texelIndex - y * morphTargetsTextureSize.x;
- ivec3 morphUV = ivec3( x, y, morphTargetIndex );
- return texelFetch( morphTargetsTexture, morphUV, 0 );
- }
- #else
- #ifndef USE_MORPHNORMALS
- uniform float morphTargetInfluences[ 8 ];
- #else
- uniform float morphTargetInfluences[ 4 ];
- #endif
- #endif
-#endif`,
- Kf = `#ifdef USE_MORPHTARGETS
- transformed *= morphTargetBaseInfluence;
- #ifdef MORPHTARGETS_TEXTURE
- for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
- if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
- }
- #else
- transformed += morphTarget0 * morphTargetInfluences[ 0 ];
- transformed += morphTarget1 * morphTargetInfluences[ 1 ];
- transformed += morphTarget2 * morphTargetInfluences[ 2 ];
- transformed += morphTarget3 * morphTargetInfluences[ 3 ];
- #ifndef USE_MORPHNORMALS
- transformed += morphTarget4 * morphTargetInfluences[ 4 ];
- transformed += morphTarget5 * morphTargetInfluences[ 5 ];
- transformed += morphTarget6 * morphTargetInfluences[ 6 ];
- transformed += morphTarget7 * morphTargetInfluences[ 7 ];
- #endif
- #endif
-#endif`,
- Zf = `float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
-#ifdef FLAT_SHADED
- vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );
- vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );
- vec3 normal = normalize( cross( fdx, fdy ) );
-#else
- vec3 normal = normalize( vNormal );
- #ifdef DOUBLE_SIDED
- normal = normal * faceDirection;
- #endif
- #ifdef USE_TANGENT
- vec3 tangent = normalize( vTangent );
- vec3 bitangent = normalize( vBitangent );
- #ifdef DOUBLE_SIDED
- tangent = tangent * faceDirection;
- bitangent = bitangent * faceDirection;
- #endif
- #if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )
- mat3 vTBN = mat3( tangent, bitangent, normal );
- #endif
- #endif
-#endif
-vec3 geometryNormal = normal;`,
- Jf = `#ifdef OBJECTSPACE_NORMALMAP
- normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;
- #ifdef FLIP_SIDED
- normal = - normal;
- #endif
- #ifdef DOUBLE_SIDED
- normal = normal * faceDirection;
- #endif
- normal = normalize( normalMatrix * normal );
-#elif defined( TANGENTSPACE_NORMALMAP )
- vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;
- mapN.xy *= normalScale;
- #ifdef USE_TANGENT
- normal = normalize( vTBN * mapN );
- #else
- normal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );
- #endif
-#elif defined( USE_BUMPMAP )
- normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
-#endif`,
- Qf = `#ifndef FLAT_SHADED
- varying vec3 vNormal;
- #ifdef USE_TANGENT
- varying vec3 vTangent;
- varying vec3 vBitangent;
- #endif
-#endif`,
- ep = `#ifndef FLAT_SHADED
- varying vec3 vNormal;
- #ifdef USE_TANGENT
- varying vec3 vTangent;
- varying vec3 vBitangent;
- #endif
-#endif`,
- tp = `#ifndef FLAT_SHADED
- vNormal = normalize( transformedNormal );
- #ifdef USE_TANGENT
- vTangent = normalize( transformedTangent );
- vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
- #endif
-#endif`,
- np = `#ifdef USE_NORMALMAP
- uniform sampler2D normalMap;
- uniform vec2 normalScale;
-#endif
-#ifdef OBJECTSPACE_NORMALMAP
- uniform mat3 normalMatrix;
-#endif
-#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )
- vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {
- vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );
- vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );
- vec2 st0 = dFdx( vUv.st );
- vec2 st1 = dFdy( vUv.st );
- vec3 N = surf_norm;
- vec3 q1perp = cross( q1, N );
- vec3 q0perp = cross( N, q0 );
- vec3 T = q1perp * st0.x + q0perp * st1.x;
- vec3 B = q1perp * st0.y + q0perp * st1.y;
- float det = max( dot( T, T ), dot( B, B ) );
- float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );
- return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );
- }
-#endif`,
- ip = `#ifdef USE_CLEARCOAT
- vec3 clearcoatNormal = geometryNormal;
-#endif`,
- sp = `#ifdef USE_CLEARCOAT_NORMALMAP
- vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;
- clearcoatMapN.xy *= clearcoatNormalScale;
- #ifdef USE_TANGENT
- clearcoatNormal = normalize( vTBN * clearcoatMapN );
- #else
- clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );
- #endif
-#endif`,
- rp = `#ifdef USE_CLEARCOATMAP
- uniform sampler2D clearcoatMap;
-#endif
-#ifdef USE_CLEARCOAT_ROUGHNESSMAP
- uniform sampler2D clearcoatRoughnessMap;
-#endif
-#ifdef USE_CLEARCOAT_NORMALMAP
- uniform sampler2D clearcoatNormalMap;
- uniform vec2 clearcoatNormalScale;
-#endif`,
- ap = `#ifdef USE_IRIDESCENCEMAP
- uniform sampler2D iridescenceMap;
-#endif
-#ifdef USE_IRIDESCENCE_THICKNESSMAP
- uniform sampler2D iridescenceThicknessMap;
-#endif`,
- op = `#ifdef OPAQUE
-diffuseColor.a = 1.0;
-#endif
-#ifdef USE_TRANSMISSION
-diffuseColor.a *= transmissionAlpha + 0.1;
-#endif
-gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,
- lp = `vec3 packNormalToRGB( const in vec3 normal ) {
- return normalize( normal ) * 0.5 + 0.5;
-}
-vec3 unpackRGBToNormal( const in vec3 rgb ) {
- return 2.0 * rgb.xyz - 1.0;
-}
-const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;
-const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );
-const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );
-const float ShiftRight8 = 1. / 256.;
-vec4 packDepthToRGBA( const in float v ) {
- vec4 r = vec4( fract( v * PackFactors ), v );
- r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale;
-}
-float unpackRGBAToDepth( const in vec4 v ) {
- return dot( v, UnpackFactors );
-}
-vec4 pack2HalfToRGBA( vec2 v ) {
- vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );
- return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );
-}
-vec2 unpackRGBATo2Half( vec4 v ) {
- return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );
-}
-float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
- return ( viewZ + near ) / ( near - far );
-}
-float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {
- return linearClipZ * ( near - far ) - near;
-}
-float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
- return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );
-}
-float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {
- return ( near * far ) / ( ( far - near ) * invClipZ - far );
-}`,
- cp = `#ifdef PREMULTIPLIED_ALPHA
- gl_FragColor.rgb *= gl_FragColor.a;
-#endif`,
- hp = `vec4 mvPosition = vec4( transformed, 1.0 );
-#ifdef USE_INSTANCING
- mvPosition = instanceMatrix * mvPosition;
-#endif
-mvPosition = modelViewMatrix * mvPosition;
-gl_Position = projectionMatrix * mvPosition;`,
- up = `#ifdef DITHERING
- gl_FragColor.rgb = dithering( gl_FragColor.rgb );
-#endif`,
- dp = `#ifdef DITHERING
- vec3 dithering( vec3 color ) {
- float grid_position = rand( gl_FragCoord.xy );
- vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
- dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
- return color + dither_shift_RGB;
- }
-#endif`,
- fp = `float roughnessFactor = roughness;
-#ifdef USE_ROUGHNESSMAP
- vec4 texelRoughness = texture2D( roughnessMap, vUv );
- roughnessFactor *= texelRoughness.g;
-#endif`,
- pp = `#ifdef USE_ROUGHNESSMAP
- uniform sampler2D roughnessMap;
-#endif`,
- mp = `#ifdef USE_SHADOWMAP
- #if NUM_DIR_LIGHT_SHADOWS > 0
- uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
- varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
- struct DirectionalLightShadow {
- float shadowBias;
- float shadowNormalBias;
- float shadowRadius;
- vec2 shadowMapSize;
- };
- uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
- #endif
- #if NUM_SPOT_LIGHT_SHADOWS > 0
- uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
- varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];
- struct SpotLightShadow {
- float shadowBias;
- float shadowNormalBias;
- float shadowRadius;
- vec2 shadowMapSize;
- };
- uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
- #endif
- #if NUM_POINT_LIGHT_SHADOWS > 0
- uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
- varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
- struct PointLightShadow {
- float shadowBias;
- float shadowNormalBias;
- float shadowRadius;
- vec2 shadowMapSize;
- float shadowCameraNear;
- float shadowCameraFar;
- };
- uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
- #endif
- float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {
- return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );
- }
- vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {
- return unpackRGBATo2Half( texture2D( shadow, uv ) );
- }
- float VSMShadow (sampler2D shadow, vec2 uv, float compare ){
- float occlusion = 1.0;
- vec2 distribution = texture2DDistribution( shadow, uv );
- float hard_shadow = step( compare , distribution.x );
- if (hard_shadow != 1.0 ) {
- float distance = compare - distribution.x ;
- float variance = max( 0.00000, distribution.y * distribution.y );
- float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );
- }
- return occlusion;
- }
- float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
- float shadow = 1.0;
- shadowCoord.xyz /= shadowCoord.w;
- shadowCoord.z += shadowBias;
- bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );
- bool inFrustum = all( inFrustumVec );
- bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );
- bool frustumTest = all( frustumTestVec );
- if ( frustumTest ) {
- #if defined( SHADOWMAP_TYPE_PCF )
- vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
- float dx0 = - texelSize.x * shadowRadius;
- float dy0 = - texelSize.y * shadowRadius;
- float dx1 = + texelSize.x * shadowRadius;
- float dy1 = + texelSize.y * shadowRadius;
- float dx2 = dx0 / 2.0;
- float dy2 = dy0 / 2.0;
- float dx3 = dx1 / 2.0;
- float dy3 = dy1 / 2.0;
- shadow = (
- texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +
- texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +
- texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +
- texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +
- texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +
- texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +
- texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +
- texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +
- texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +
- texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +
- texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +
- texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +
- texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +
- texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +
- texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +
- texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +
- texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )
- ) * ( 1.0 / 17.0 );
- #elif defined( SHADOWMAP_TYPE_PCF_SOFT )
- vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
- float dx = texelSize.x;
- float dy = texelSize.y;
- vec2 uv = shadowCoord.xy;
- vec2 f = fract( uv * shadowMapSize + 0.5 );
- uv -= f * texelSize;
- shadow = (
- texture2DCompare( shadowMap, uv, shadowCoord.z ) +
- texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +
- texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +
- texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +
- mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),
- texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),
- f.x ) +
- mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),
- texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),
- f.x ) +
- mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),
- texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),
- f.y ) +
- mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),
- texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),
- f.y ) +
- mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),
- texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),
- f.x ),
- mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),
- texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),
- f.x ),
- f.y )
- ) * ( 1.0 / 9.0 );
- #elif defined( SHADOWMAP_TYPE_VSM )
- shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );
- #else
- shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );
- #endif
- }
- return shadow;
- }
- vec2 cubeToUV( vec3 v, float texelSizeY ) {
- vec3 absV = abs( v );
- float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );
- absV *= scaleToCube;
- v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );
- vec2 planar = v.xy;
- float almostATexel = 1.5 * texelSizeY;
- float almostOne = 1.0 - almostATexel;
- if ( absV.z >= almostOne ) {
- if ( v.z > 0.0 )
- planar.x = 4.0 - v.x;
- } else if ( absV.x >= almostOne ) {
- float signX = sign( v.x );
- planar.x = v.z * signX + 2.0 * signX;
- } else if ( absV.y >= almostOne ) {
- float signY = sign( v.y );
- planar.x = v.x + 2.0 * signY + 2.0;
- planar.y = v.z * signY - 2.0;
- }
- return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );
- }
- float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
- vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );
- vec3 lightToPosition = shadowCoord.xyz;
- float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias;
- vec3 bd3D = normalize( lightToPosition );
- #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )
- vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;
- return (
- texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +
- texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +
- texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +
- texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +
- texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +
- texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +
- texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +
- texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +
- texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )
- ) * ( 1.0 / 9.0 );
- #else
- return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );
- #endif
- }
-#endif`,
- gp = `#ifdef USE_SHADOWMAP
- #if NUM_DIR_LIGHT_SHADOWS > 0
- uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];
- varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
- struct DirectionalLightShadow {
- float shadowBias;
- float shadowNormalBias;
- float shadowRadius;
- vec2 shadowMapSize;
- };
- uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
- #endif
- #if NUM_SPOT_LIGHT_SHADOWS > 0
- uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];
- varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];
- struct SpotLightShadow {
- float shadowBias;
- float shadowNormalBias;
- float shadowRadius;
- vec2 shadowMapSize;
- };
- uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
- #endif
- #if NUM_POINT_LIGHT_SHADOWS > 0
- uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];
- varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
- struct PointLightShadow {
- float shadowBias;
- float shadowNormalBias;
- float shadowRadius;
- vec2 shadowMapSize;
- float shadowCameraNear;
- float shadowCameraFar;
- };
- uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
- #endif
-#endif`,
- vp = `#ifdef USE_SHADOWMAP
- #if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0
- vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
- vec4 shadowWorldPosition;
- #endif
- #if NUM_DIR_LIGHT_SHADOWS > 0
- #pragma unroll_loop_start
- for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
- shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );
- vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;
- }
- #pragma unroll_loop_end
- #endif
- #if NUM_SPOT_LIGHT_SHADOWS > 0
- #pragma unroll_loop_start
- for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
- shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );
- vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;
- }
- #pragma unroll_loop_end
- #endif
- #if NUM_POINT_LIGHT_SHADOWS > 0
- #pragma unroll_loop_start
- for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
- shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );
- vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;
- }
- #pragma unroll_loop_end
- #endif
-#endif`,
- _p = `float getShadowMask() {
- float shadow = 1.0;
- #ifdef USE_SHADOWMAP
- #if NUM_DIR_LIGHT_SHADOWS > 0
- DirectionalLightShadow directionalLight;
- #pragma unroll_loop_start
- for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
- directionalLight = directionalLightShadows[ i ];
- shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
- }
- #pragma unroll_loop_end
- #endif
- #if NUM_SPOT_LIGHT_SHADOWS > 0
- SpotLightShadow spotLight;
- #pragma unroll_loop_start
- for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
- spotLight = spotLightShadows[ i ];
- shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;
- }
- #pragma unroll_loop_end
- #endif
- #if NUM_POINT_LIGHT_SHADOWS > 0
- PointLightShadow pointLight;
- #pragma unroll_loop_start
- for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
- pointLight = pointLightShadows[ i ];
- shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
- }
- #pragma unroll_loop_end
- #endif
- #endif
- return shadow;
-}`,
- xp = `#ifdef USE_SKINNING
- mat4 boneMatX = getBoneMatrix( skinIndex.x );
- mat4 boneMatY = getBoneMatrix( skinIndex.y );
- mat4 boneMatZ = getBoneMatrix( skinIndex.z );
- mat4 boneMatW = getBoneMatrix( skinIndex.w );
-#endif`,
- yp = `#ifdef USE_SKINNING
- uniform mat4 bindMatrix;
- uniform mat4 bindMatrixInverse;
- uniform highp sampler2D boneTexture;
- uniform int boneTextureSize;
- mat4 getBoneMatrix( const in float i ) {
- float j = i * 4.0;
- float x = mod( j, float( boneTextureSize ) );
- float y = floor( j / float( boneTextureSize ) );
- float dx = 1.0 / float( boneTextureSize );
- float dy = 1.0 / float( boneTextureSize );
- y = dy * ( y + 0.5 );
- vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );
- vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );
- vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );
- vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );
- mat4 bone = mat4( v1, v2, v3, v4 );
- return bone;
- }
-#endif`,
- Mp = `#ifdef USE_SKINNING
- vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
- vec4 skinned = vec4( 0.0 );
- skinned += boneMatX * skinVertex * skinWeight.x;
- skinned += boneMatY * skinVertex * skinWeight.y;
- skinned += boneMatZ * skinVertex * skinWeight.z;
- skinned += boneMatW * skinVertex * skinWeight.w;
- transformed = ( bindMatrixInverse * skinned ).xyz;
-#endif`,
- wp = `#ifdef USE_SKINNING
- mat4 skinMatrix = mat4( 0.0 );
- skinMatrix += skinWeight.x * boneMatX;
- skinMatrix += skinWeight.y * boneMatY;
- skinMatrix += skinWeight.z * boneMatZ;
- skinMatrix += skinWeight.w * boneMatW;
- skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;
- objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;
- #ifdef USE_TANGENT
- objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
- #endif
-#endif`,
- bp = `float specularStrength;
-#ifdef USE_SPECULARMAP
- vec4 texelSpecular = texture2D( specularMap, vUv );
- specularStrength = texelSpecular.r;
-#else
- specularStrength = 1.0;
-#endif`,
- Sp = `#ifdef USE_SPECULARMAP
- uniform sampler2D specularMap;
-#endif`,
- Tp = `#if defined( TONE_MAPPING )
- gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
-#endif`,
- Ep = `#ifndef saturate
-#define saturate( a ) clamp( a, 0.0, 1.0 )
-#endif
-uniform float toneMappingExposure;
-vec3 LinearToneMapping( vec3 color ) {
- return toneMappingExposure * color;
-}
-vec3 ReinhardToneMapping( vec3 color ) {
- color *= toneMappingExposure;
- return saturate( color / ( vec3( 1.0 ) + color ) );
-}
-vec3 OptimizedCineonToneMapping( vec3 color ) {
- color *= toneMappingExposure;
- color = max( vec3( 0.0 ), color - 0.004 );
- return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
-}
-vec3 RRTAndODTFit( vec3 v ) {
- vec3 a = v * ( v + 0.0245786 ) - 0.000090537;
- vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;
- return a / b;
-}
-vec3 ACESFilmicToneMapping( vec3 color ) {
- const mat3 ACESInputMat = mat3(
- vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ),
- vec3( 0.04823, 0.01566, 0.83777 )
- );
- const mat3 ACESOutputMat = mat3(
- vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ),
- vec3( -0.07367, -0.00605, 1.07602 )
- );
- color *= toneMappingExposure / 0.6;
- color = ACESInputMat * color;
- color = RRTAndODTFit( color );
- color = ACESOutputMat * color;
- return saturate( color );
-}
-vec3 CustomToneMapping( vec3 color ) { return color; }`,
- Ap = `#ifdef USE_TRANSMISSION
- float transmissionAlpha = 1.0;
- float transmissionFactor = transmission;
- float thicknessFactor = thickness;
- #ifdef USE_TRANSMISSIONMAP
- transmissionFactor *= texture2D( transmissionMap, vUv ).r;
- #endif
- #ifdef USE_THICKNESSMAP
- thicknessFactor *= texture2D( thicknessMap, vUv ).g;
- #endif
- vec3 pos = vWorldPosition;
- vec3 v = normalize( cameraPosition - pos );
- vec3 n = inverseTransformDirection( normal, viewMatrix );
- vec4 transmission = getIBLVolumeRefraction(
- n, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,
- pos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,
- attenuationColor, attenuationDistance );
- totalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );
- transmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor );
-#endif`,
- Cp = `#ifdef USE_TRANSMISSION
- uniform float transmission;
- uniform float thickness;
- uniform float attenuationDistance;
- uniform vec3 attenuationColor;
- #ifdef USE_TRANSMISSIONMAP
- uniform sampler2D transmissionMap;
- #endif
- #ifdef USE_THICKNESSMAP
- uniform sampler2D thicknessMap;
- #endif
- uniform vec2 transmissionSamplerSize;
- uniform sampler2D transmissionSamplerMap;
- uniform mat4 modelMatrix;
- uniform mat4 projectionMatrix;
- varying vec3 vWorldPosition;
- vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {
- vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );
- vec3 modelScale;
- modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );
- modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );
- modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );
- return normalize( refractionVector ) * thickness * modelScale;
- }
- float applyIorToRoughness( const in float roughness, const in float ior ) {
- return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );
- }
- vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {
- float framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );
- #ifdef texture2DLodEXT
- return texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );
- #else
- return texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );
- #endif
- }
- vec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {
- if ( attenuationDistance == 0.0 ) {
- return radiance;
- } else {
- vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;
- vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance * radiance;
- }
- }
- vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,
- const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,
- const in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,
- const in vec3 attenuationColor, const in float attenuationDistance ) {
- vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );
- vec3 refractedRayExit = position + transmissionRay;
- vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
- vec2 refractionCoords = ndcPos.xy / ndcPos.w;
- refractionCoords += 1.0;
- refractionCoords /= 2.0;
- vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );
- vec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );
- vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );
- return vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );
- }
-#endif`,
- Lp = `#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )
- varying vec2 vUv;
-#endif`,
- Rp = `#ifdef USE_UV
- #ifdef UVS_VERTEX_ONLY
- vec2 vUv;
- #else
- varying vec2 vUv;
- #endif
- uniform mat3 uvTransform;
-#endif`,
- Pp = `#ifdef USE_UV
- vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
-#endif`,
- Dp = `#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
- varying vec2 vUv2;
-#endif`,
- Ip = `#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
- attribute vec2 uv2;
- varying vec2 vUv2;
- uniform mat3 uv2Transform;
-#endif`,
- Fp = `#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
- vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;
-#endif`,
- Np = `#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )
- vec4 worldPosition = vec4( transformed, 1.0 );
- #ifdef USE_INSTANCING
- worldPosition = instanceMatrix * worldPosition;
- #endif
- worldPosition = modelMatrix * worldPosition;
-#endif`;
- const zp = `varying vec2 vUv;
-uniform mat3 uvTransform;
-void main() {
- vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
- gl_Position = vec4( position.xy, 1.0, 1.0 );
-}`,
- Op = `uniform sampler2D t2D;
-varying vec2 vUv;
-void main() {
- gl_FragColor = texture2D( t2D, vUv );
- #ifdef DECODE_VIDEO_TEXTURE
- gl_FragColor = vec4( mix( pow( gl_FragColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), gl_FragColor.rgb * 0.0773993808, vec3( lessThanEqual( gl_FragColor.rgb, vec3( 0.04045 ) ) ) ), gl_FragColor.w );
- #endif
- #include
- #include
-}`,
- kp = `varying vec3 vWorldDirection;
-#include
-void main() {
- vWorldDirection = transformDirection( position, modelMatrix );
- #include
- #include
- gl_Position.z = gl_Position.w;
-}`,
- Up = `#include
-uniform float opacity;
-varying vec3 vWorldDirection;
-#include
-void main() {
- vec3 vReflect = vWorldDirection;
- #include
- gl_FragColor = envColor;
- gl_FragColor.a *= opacity;
- #include
- #include
-}`,
- Bp = `#include
-#include
-#include
-#include
-#include
-#include
-#include
-varying vec2 vHighPrecisionZW;
-void main() {
- #include
- #include
- #ifdef USE_DISPLACEMENTMAP
- #include
- #include
- #include
- #endif
- #include
- #include
- #include
- #include
- #include
- #include
- #include
- vHighPrecisionZW = gl_Position.zw;
-}`,
- Vp = `#if DEPTH_PACKING == 3200
- uniform float opacity;
-#endif
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-varying vec2 vHighPrecisionZW;
-void main() {
- #include
- vec4 diffuseColor = vec4( 1.0 );
- #if DEPTH_PACKING == 3200
- diffuseColor.a = opacity;
- #endif
- #include
- #include
- #include
- #include
- float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;
- #if DEPTH_PACKING == 3200
- gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );
- #elif DEPTH_PACKING == 3201
- gl_FragColor = packDepthToRGBA( fragCoordZ );
- #endif
-}`,
- Gp = `#define DISTANCE
-varying vec3 vWorldPosition;
-#include
-#include
-#include
-#include
-#include
-#include
-void main() {
- #include
- #include
- #ifdef USE_DISPLACEMENTMAP
- #include
- #include
- #include
- #endif
- #include
- #include
- #include
- #include
- #include
- #include
- #include
- vWorldPosition = worldPosition.xyz;
-}`,
- Hp = `#define DISTANCE
-uniform vec3 referencePosition;
-uniform float nearDistance;
-uniform float farDistance;
-varying vec3 vWorldPosition;
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-void main () {
- #include
- vec4 diffuseColor = vec4( 1.0 );
- #include
- #include
- #include
- float dist = length( vWorldPosition - referencePosition );
- dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
- dist = saturate( dist );
- gl_FragColor = packDepthToRGBA( dist );
-}`,
- Wp = `varying vec3 vWorldDirection;
-#include
-void main() {
- vWorldDirection = transformDirection( position, modelMatrix );
- #include
- #include
-}`,
- jp = `uniform sampler2D tEquirect;
-varying vec3 vWorldDirection;
-#include
-void main() {
- vec3 direction = normalize( vWorldDirection );
- vec2 sampleUV = equirectUv( direction );
- gl_FragColor = texture2D( tEquirect, sampleUV );
- #include
- #include
-}`,
- Xp = `uniform float scale;
-attribute float lineDistance;
-varying float vLineDistance;
-#include
-#include
-#include
-#include
-#include
-#include
-void main() {
- vLineDistance = scale * lineDistance;
- #include
- #include
- #include
- #include
- #include
- #include
- #include
- #include
-}`,
- qp = `uniform vec3 diffuse;
-uniform float opacity;
-uniform float dashSize;
-uniform float totalSize;
-varying float vLineDistance;
-#include
-#include
-#include
-#include
-#include
-void main() {
- #include
- if ( mod( vLineDistance, totalSize ) > dashSize ) {
- discard;
- }
- vec3 outgoingLight = vec3( 0.0 );
- vec4 diffuseColor = vec4( diffuse, opacity );
- #include
- #include
- outgoingLight = diffuseColor.rgb;
- #include
- #include
- #include
- #include
- #include
-}`,
- $p = `#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-void main() {
- #include
- #include
- #include
- #include
- #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )
- #include
- #include
- #include
- #include
- #include
- #endif
- #include
- #include
- #include
- #include
- #include
- #include
- #include
- #include
- #include
-}`,
- Yp = `uniform vec3 diffuse;
-uniform float opacity;
-#ifndef FLAT_SHADED
- varying vec3 vNormal;
-#endif
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-void main() {
- #include
- vec4 diffuseColor = vec4( diffuse, opacity );
- #include
- #include
- #include
- #include
- #include
- #include
- ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
- #ifdef USE_LIGHTMAP
- vec4 lightMapTexel = texture2D( lightMap, vUv2 );
- reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;
- #else
- reflectedLight.indirectDiffuse += vec3( 1.0 );
- #endif
- #include
- reflectedLight.indirectDiffuse *= diffuseColor.rgb;
- vec3 outgoingLight = reflectedLight.indirectDiffuse;
- #include
- #include
- #include
- #include
- #include
- #include
- #include
-}`,
- Kp = `#define LAMBERT
-varying vec3 vLightFront;
-varying vec3 vIndirectFront;
-#ifdef DOUBLE_SIDED
- varying vec3 vLightBack;
- varying vec3 vIndirectBack;
-#endif
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-void main() {
- #include
- #include
- #include
- #include
- #include
- #include
- #include
- #include
- #include
- #include
- #include
- #include
- #include
- #include
- #include
- #include
- #include
- #include
- #include
- #include
-}`,
- Zp = `uniform vec3 diffuse;
-uniform vec3 emissive;
-uniform float opacity;
-varying vec3 vLightFront;
-varying vec3 vIndirectFront;
-#ifdef DOUBLE_SIDED
- varying vec3 vLightBack;
- varying vec3 vIndirectBack;
-#endif
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-void main() {
- #include
- vec4 diffuseColor = vec4( diffuse, opacity );
- ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
- vec3 totalEmissiveRadiance = emissive;
- #include
- #include
- #include
- #include
- #include
- #include
- #include
- #ifdef DOUBLE_SIDED
- reflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;
- #else
- reflectedLight.indirectDiffuse += vIndirectFront;
- #endif
- #include
- reflectedLight.indirectDiffuse *= BRDF_Lambert( diffuseColor.rgb );
- #ifdef DOUBLE_SIDED
- reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;
- #else
- reflectedLight.directDiffuse = vLightFront;
- #endif
- reflectedLight.directDiffuse *= BRDF_Lambert( diffuseColor.rgb ) * getShadowMask();
- #include
- vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
- #include
- #include
- #include
- #include
- #include
- #include
- #include
-}`,
- Jp = `#define MATCAP
-varying vec3 vViewPosition;
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-void main() {
- #include
- #include