MCPcopy Index your code
hub / github.com/g3n/engine / RemoveTexture

Method RemoveTexture

material/material.go:350–360  ·  view source on GitHub ↗

RemoveTexture removes the specified Texture2d from the material

(tex *texture.Texture2D)

Source from the content-addressed store, hash-verified

348
349// RemoveTexture removes the specified Texture2d from the material
350func (mat *Material) RemoveTexture(tex *texture.Texture2D) {
351
352 for pos, curr := range mat.textures {
353 if curr == tex {
354 copy(mat.textures[pos:], mat.textures[pos+1:])
355 mat.textures[len(mat.textures)-1] = nil
356 mat.textures = mat.textures[:len(mat.textures)-1]
357 break
358 }
359 }
360}
361
362// HasTexture checks if the material contains the specified texture
363func (mat *Material) HasTexture(tex *texture.Texture2D) bool {

Callers 6

SetBaseColorMapMethod · 0.80
SetNormalMapMethod · 0.80
SetOcclusionMapMethod · 0.80
SetEmissiveMapMethod · 0.80
SetTextureMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected