Babylonjs笔记——相机和粒子系统源码部分

babylonjs中arcrotateCamera和粒子系统的部分源码注释,感觉babylonjs有个不好的就是源码没有什么注释,有些变量根本就不知道是什么意思,要自己一个个试。

一。ArcRotateCamera相机构造函数中成员变量注释,没用专业名词, 全是自己的话

            this.alpha = alpha;//相机绕y轴旋转的角度
            this.beta = beta;//相机绕x轴旋转的角度
            this.radius = radius;//视野半径
            this.target = target;//目标
            this.inertialAlphaOffset = 0;//绕y轴旋转偏移量
            this.inertialBetaOffset = 0;//绕x轴旋转偏移量,用于限制旋转角度
            this.inertialRadiusOffset = 0;//视野范围偏移量
            this.lowerAlphaLimit = null;//
            this.upperAlphaLimit = null;
            this.lowerBetaLimit = 0.01;//
            this.upperBetaLimit = Math.PI;//从y的正半轴可绕x轴旋转最大角度
            this.lowerRadiusLimit = null;//视点拉近的最大距离,用于限制视野范围
            this.upperRadiusLimit = null;//视点拉远的最大距离
            this.angularSensibilityX = 1000.0;
            this.angularSensibilityY = 1000.0;
            this.wheelPrecision = 3.0;
            this.pinchPrecision = 2.0;
            this.panningSensibility = 50.0;//平移系数
            this.inertialPanningX = 0;
            this.inertialPanningY = 0;
            this.keysUp = [38];
            this.keysDown = [40];
            this.keysLeft = [37];
            this.keysRight = [39];
            this.zoomOnFactor = 1;
            this.targetScreenOffset = BABYLON.Vector2.Zero();
            this.pinchInwards = true;
            this.allowUpsideDown = true;
            this._keys = [];
            this._viewMatrix = new BABYLON.Matrix();
            // Panning
            this.panningAxis = new BABYLON.Vector3(1, 1, 0);
            this._isRightClick = false;
            this._isCtrlPushed = false;//ctrl键盘:ctrl+鼠标任意键为拖拽
            this.checkCollisions = false;//碰撞检测
            this.collisionRadius = new BABYLON.Vector3(0.5, 0.5, 0.5);//碰撞检测的半径
            this._collider = new BABYLON.Collider();
            this._previousPosition = BABYLON.Vector3.Zero();
            this._collisionVelocity = BABYLON.Vector3.Zero();
            this._newPosition = BABYLON.Vector3.Zero();

二粒子系统ParticleSystem,构造函数中的成员变量注释

            this.animations = [];//动画
            this.renderingGroupId = 0;
            this.emitter = null;//发射器
            this.emitRate = 10;//发射速率,不是粒子的速度,是粒子系统单位时间内发射多少粒子
            this.manualEmitCount = -1;
            this.updateSpeed = 0.01;更新速率
            this.targetStopDuration = 0;
            this.disposeOnStop = false;
            this.minEmitPower = 1;最小发射力量
            this.maxEmitPower = 1;最大发射力量
            this.minLifeTime = 1;粒子的最小生命周期
            this.maxLifeTime = 1;粒子的最大生命周期
            this.minSize = 1;粒子的最小尺寸
            this.maxSize = 1;粒子的最大尺寸
            this.minAngularSpeed = 0;
            this.maxAngularSpeed = 0;
            this.layerMask = 0x0FFFFFFF;
            this.blendMode = ParticleSystem.BLENDMODE_ONEONE;
            this.forceDepthWrite = false;
            this.gravity = BABYLON.Vector3.Zero();重力
            this.direction1 = new BABYLON.Vector3(0, 1.0, 0);粒子的发射方向,是相对于发射器的方向!!!不是相对于场景中的方向
            this.direction2 = new BABYLON.Vector3(0, 1.0, 0);粒子的发射方向2,同上
            this.minEmitBox = new BABYLON.Vector3(-0.5, -0.5, -0.5);发射器中最小的发射部位;比如一个长方体的左下前角
            this.maxEmitBox = new BABYLON.Vector3(0.5, 0.5, 0.5);发射器中最大的发射部分:比如长方体发射器的右(x)上(y)后(z)角
            this.color1 = new BABYLON.Color4(1.0, 1.0, 1.0, 1.0);粒子的颜色
            this.color2 = new BABYLON.Color4(1.0, 1.0, 1.0, 1.0);
            this.colorDead = new BABYLON.Color4(0, 0, 0, 1.0);
            this.textureMask = new BABYLON.Color4(1.0, 1.0, 1.0, 1.0);
            this.particles = new Array();
            this._vertexDeclaration = [3, 4, 4];
            this._vertexStrideSize = 11 * 4; // 11 floats per particle (x, y, z, r, g, b, a, angle, size, offsetX, offsetY)
            this._stockParticles = new Array();
            this._newPartsExcess = 0;
            this._scaledColorStep = new BABYLON.Color4(0, 0, 0, 0);
            this._colorDiff = new BABYLON.Color4(0, 0, 0, 0);
            this._scaledDirection = BABYLON.Vector3.Zero();
            this._scaledGravity = BABYLON.Vector3.Zero();
            this._currentRenderId = -1;
            this._started = false;
            this._stopped = false;
            this._actualFrame = 0;
            this.id = name;
            this._capacity = capacity;粒子的数量
            this._scene = scene;
            this._customEffect = customEffect;

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
连续系统的时域分析是信号与系统学习中的重要部分。时域分析研究的是信号在时间域内的变化规律,常用的分析方法包括冲激响应法、单位阶跃响应法和相应方程法。 1. 冲激响应法 冲激响应法是一种基于系统输入信号的冲激函数的响应来分析系统时域特性的方法。具体来说,将系统输入信号表示为一个冲激序列的加权和,然后计算出系统对每个冲激的响应,得到系统的冲激响应函数。然后,通过线性时不变系统的特性,可以将任何输入信号都表示为冲激序列的加权和,从而得到系统对任何输入信号的响应。 2. 单位阶跃响应法 单位阶跃响应法是一种基于系统输入信号的单位阶跃函数的响应来分析系统时域特性的方法。具体来说,将系统输入信号表示为一个单位阶跃函数的加权和,然后计算出系统对每个单位阶跃函数的响应,得到系统的单位阶跃响应函数。然后,通过线性时不变系统的特性,可以将任何输入信号都表示为单位阶跃函数的加权和,从而得到系统对任何输入信号的响应。 3. 相应方程法 相应方程法是一种基于系统微分方程的解析解来分析系统时域特性的方法。具体来说,根据系统微分方程的特性,可以得到系统的传递函数,然后通过拉普拉斯变换将输入信号和传递函数变换到频域内,最终通过反变换得到系统的时域响应。 以上三种方法都是分析连续系统时域特性的重要方法,各自适用于不同的情况。掌握这些方法可以帮助我们更好地理解和分析连续系统的时域特性。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值