babylon.solidParticle.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. var BABYLON;
  2. (function (BABYLON) {
  3. var SolidParticle = (function () {
  4. function SolidParticle(particleIndex, positionIndex, model, shapeId, idxInShape) {
  5. this.color = new BABYLON.Color4(1, 1, 1, 1); // color
  6. this.position = BABYLON.Vector3.Zero(); // position
  7. this.rotation = BABYLON.Vector3.Zero(); // rotation
  8. this.scaling = new BABYLON.Vector3(1, 1, 1); // scaling
  9. this.uvs = new BABYLON.Vector4(0, 0, 1, 1); // uvs
  10. this.velocity = BABYLON.Vector3.Zero(); // velocity
  11. this.alive = true; // alive
  12. this.isVisible = true; // visibility
  13. this.idx = particleIndex;
  14. this._pos = positionIndex;
  15. this._model = model;
  16. this.shapeId = shapeId;
  17. this.idxInShape = idxInShape;
  18. }
  19. Object.defineProperty(SolidParticle.prototype, "scale", {
  20. //legacy support, changed scale to scaling
  21. get: function () {
  22. return this.scaling;
  23. },
  24. set: function (scale) {
  25. this.scaling = scale;
  26. },
  27. enumerable: true,
  28. configurable: true
  29. });
  30. Object.defineProperty(SolidParticle.prototype, "quaternion", {
  31. //legacy support, changed quaternion to rotationQuaternion
  32. get: function () {
  33. return this.rotationQuaternion;
  34. },
  35. set: function (q) {
  36. this.rotationQuaternion = q;
  37. },
  38. enumerable: true,
  39. configurable: true
  40. });
  41. return SolidParticle;
  42. })();
  43. BABYLON.SolidParticle = SolidParticle;
  44. var ModelShape = (function () {
  45. function ModelShape(id, shape, shapeUV, posFunction, vtxFunction) {
  46. this.shapeID = id;
  47. this._shape = shape;
  48. this._shapeUV = shapeUV;
  49. this._positionFunction = posFunction;
  50. this._vertexFunction = vtxFunction;
  51. }
  52. return ModelShape;
  53. })();
  54. BABYLON.ModelShape = ModelShape;
  55. })(BABYLON || (BABYLON = {}));