@shopware-ag/dive
Advanced tools
Comparing version 1.11.0 to 1.12.0
@@ -238,4 +238,6 @@ import { ShadowMapType, ToneMapping, WebGLRenderer, Scene, Camera, PerspectiveCamera, Box3, Vector3Like, Texture, Mesh, ColorRepresentation, Object3D, Intersection, Vector2, Raycaster, Vector3 } from 'three'; | ||
type COMMaterial = { | ||
vertexColors: boolean; | ||
color: string | number; | ||
map: Texture | null; | ||
normalMap: Texture | null; | ||
roughness: number; | ||
@@ -242,0 +244,0 @@ roughnessMap: Texture | null; |
{ | ||
"name": "@shopware-ag/dive", | ||
"version": "1.11.0", | ||
"version": "1.12.0", | ||
"description": "Shopware Spatial Framework", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -40,4 +40,6 @@ import { type Texture, type Vector3Like } from "three"; | ||
export type COMMaterial = { | ||
vertexColors: boolean; | ||
color: string | number; | ||
map: Texture | null; | ||
normalMap: Texture | null; | ||
roughness: number; | ||
@@ -44,0 +46,0 @@ roughnessMap: Texture | null; |
@@ -359,3 +359,5 @@ import Model from '../Model'; | ||
color: 0xff00ff, | ||
vertexColors: true, | ||
map: 'This_Is_A_Texture' as unknown as Texture, | ||
normalMap: 'This_Is_A_Texture' as unknown as Texture, | ||
roughness: 0, | ||
@@ -362,0 +364,0 @@ roughnessMap: 'This_Is_A_Texture' as unknown as Texture, |
@@ -88,12 +88,28 @@ import { Box3, Color, Mesh, MeshStandardMaterial, Object3D, Raycaster, Vector3, Vector3Like } from 'three'; | ||
if (material.vertexColors !== undefined) { | ||
this._material.vertexColors = material.vertexColors; | ||
} | ||
// apply color if supplied | ||
if (material.color !== undefined) this._material.color = new Color(material.color); | ||
if (material.color !== undefined) { | ||
this._material.color = new Color(material.color); | ||
} | ||
// apply albedo map if supplied | ||
if (material.map !== undefined) this._material.map = material.map; | ||
if (material.map !== undefined) { | ||
this._material.map = material.map; | ||
} | ||
// apply normal map | ||
if (material.normalMap !== undefined) { | ||
this._material.normalMap = material.normalMap; | ||
} | ||
// set roughness value | ||
// if supplied, apply roughness map | ||
// if we applied a roughness map, set roughness to 1.0 | ||
if (material.roughness !== undefined) this._material.roughness = material.roughness; | ||
if (material.roughness !== undefined) { | ||
this._material.roughness = material.roughness; | ||
} | ||
if (material.roughnessMap !== undefined) { | ||
@@ -110,3 +126,6 @@ this._material.roughnessMap = material.roughnessMap; | ||
// if we applied a metalness map, set metalness to 1.0 | ||
if (material.metalness !== undefined) this._material.metalness = material.metalness; | ||
if (material.metalness !== undefined) { | ||
this._material.metalness = material.metalness; | ||
} | ||
if (material.metalnessMap !== undefined) { | ||
@@ -121,3 +140,6 @@ this._material.metalnessMap = material.metalnessMap; | ||
// if the mesh is already set, update the material | ||
if (this._mesh) this._mesh.material = this._material; | ||
if (this._mesh) { | ||
this._mesh.material = this._material; | ||
this._mesh.material.needsUpdate = true; | ||
} | ||
} | ||
@@ -124,0 +146,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
920360
14492