xr-shining-star.ts 833 B

12345678910111213141516171819202122
  1. import XrFrame from 'XrFrame';
  2. const xrFrameSystem = wx.getXrFrameSystem();
  3. xrFrameSystem.registerMaterial('shining', scene => {
  4. return scene.createMaterial(scene.assets.getAsset<XrFrame.Effect>('effect', 'shining'));
  5. });
  6. const ShiningStarDefaultComponents: XrFrame.IEntityComponents = Object.assign({
  7. mesh: {
  8. geometry: 'star',
  9. material: 'shining'
  10. }
  11. }, xrFrameSystem.NodeDefaultComponents);
  12. const ShiningStarDataMapping: {[key: string]: string[];} = Object.assign({
  13. uniforms: ['mesh', 'uniforms']
  14. }, xrFrameSystem.NodeDataMapping);
  15. xrFrameSystem.registerElement('shining-star', class XRShiningStar extends xrFrameSystem.Element {
  16. public readonly defaultComponents: XrFrame.IEntityComponents = ShiningStarDefaultComponents;
  17. public readonly dataMapping: {[key: string]: string[];} = ShiningStarDataMapping;
  18. });