babylon.solidParticle.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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.idx = particleIndex;
  13. this._pos = positionIndex;
  14. this._model = model;
  15. this.shapeId = shapeId;
  16. this.idxInShape = idxInShape;
  17. }
  18. Object.defineProperty(SolidParticle.prototype, "scale", {
  19. //legacy support, changed scale to scaling
  20. get: function () {
  21. return this.scaling;
  22. },
  23. set: function (scale) {
  24. this.scaling = scale;
  25. },
  26. enumerable: true,
  27. configurable: true
  28. });
  29. Object.defineProperty(SolidParticle.prototype, "quaternion", {
  30. //legacy support, changed quaternion to rotationQuaternion
  31. get: function () {
  32. return this.rotationQuaternion;
  33. },
  34. set: function (q) {
  35. this.rotationQuaternion = q;
  36. },
  37. enumerable: true,
  38. configurable: true
  39. });
  40. return SolidParticle;
  41. })();
  42. BABYLON.SolidParticle = SolidParticle;
  43. var ModelShape = (function () {
  44. function ModelShape(id, shape, shapeUV, posFunction, vtxFunction) {
  45. this.shapeID = id;
  46. this._shape = shape;
  47. this._shapeUV = shapeUV;
  48. this._positionFunction = posFunction;
  49. this._vertexFunction = vtxFunction;
  50. }
  51. return ModelShape;
  52. })();
  53. BABYLON.ModelShape = ModelShape;
  54. })(BABYLON || (BABYLON = {}));