stringTools.ts 1.1 KB

12345678910111213141516171819202122232425
  1. import { NodeMaterialBlockConnectionPointTypes } from 'babylonjs/Materials/Node/nodeMaterialBlockConnectionPointTypes';
  2. export class StringTools {
  3. /**
  4. * Gets the base math type of node material block connection point.
  5. * @param type Type to parse.
  6. */
  7. public static GetBaseType(type: NodeMaterialBlockConnectionPointTypes): string {
  8. switch (type) {
  9. case NodeMaterialBlockConnectionPointTypes.Vector3OrColor3:
  10. case NodeMaterialBlockConnectionPointTypes.Vector4OrColor4:
  11. case NodeMaterialBlockConnectionPointTypes.Vector3OrVector4:
  12. case NodeMaterialBlockConnectionPointTypes.Vector3OrColor3OrVector4OrColor4:
  13. return "Vector";
  14. case NodeMaterialBlockConnectionPointTypes.Color3:
  15. case NodeMaterialBlockConnectionPointTypes.Color3OrColor4:
  16. case NodeMaterialBlockConnectionPointTypes.Color4: {
  17. return "Color";
  18. }
  19. default: {
  20. return NodeMaterialBlockConnectionPointTypes[type];
  21. }
  22. }
  23. }
  24. }