Diff
checker
文本
文本
圖像
文檔
Excel
文件夾
Legal
Enterprise
桌面版
定價
登入
下載 Diffchecker 桌面版
比較文本
尋找兩個文字檔案之間的差異
工具
歷史
即時編輯器
摺疊未變更行
關閉換行
檢視
拆分
統一
比對精度
智能
單詞
字符
語法突出顯示
選擇語法
忽略
文字轉換
前往第一個差異
編輯輸入
Diffchecker Desktop
執行Diffchecker最安全的方式。取得Diffchecker桌面應用程式:您的差異永遠不會離開您的電腦!
取得桌面版
Untitled diff
建立於
10 年前
差異永不過期
清除
匯出
分享
解釋
24 刪除
行
總計
刪除
字符
總計
刪除
要繼續使用此功能,請升級到
Diff
checker
Pro
查看價格
79 行
全部複製
19 新增
行
總計
新增
字符
總計
新增
要繼續使用此功能,請升級到
Diff
checker
Pro
查看價格
83 行
全部複製
// _null = [this, 0, 1] execVM "moveWithWind.sqf"; // Rotate with Wind
// _null = [this, 0, 1] execVM "moveWithWind.sqf"; // Rotate with Wind
// _null = [this, 1, 1] execVM "moveWithWind.sqf"; // Continuous rotation
// _null = [this, 1, 1] execVM "moveWithWind.sqf"; // Continuous rotation
複製
已複製
複製
已複製
private ["_obj", "_mod", "_vel", "_dif", "_wdr", "_upd"];
params [
_obj = _this select 0;
// The object being affected
"_obj",
// The object being affected
_mod
= _this select 1;
// The mode of movement (0 = wind, 1 = Rotation, 2 = TBD, etc.)
"
_mod
",
// The mode of movement (0 = wind, 1 = Rotation, 2 = TBD, etc.)
_vel
= _this select 2;
// Movement velocity (1° to 45°)
"
_vel
"
// Movement velocity (1° to 45°)
_upd = 1 / 30; // The object update rate
];
// If this isn't the server then get out
// If this isn't the server then get out
if (!isServer) exitWith {};
if (!isServer) exitWith {};
複製
已複製
複製
已複製
private _upd = 1 / 30; // The object update rate
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// Constrain velocity
// Constrain velocity
if (_mod == 0) then {
if (_mod == 0) then {
_vel = abs _vel;
_vel = abs _vel;
複製
已複製
複製
已複製
if (_vel < 1) then {
if (_vel < 1) then {
_vel = 1;
_vel = 1;
};
};
複製
已複製
複製
已複製
if (_vel > 45) then {
if (_vel > 45) then {
_vel = 45;
_vel = 45;
};
};
};
};
//----------------------------------------------------------------------
//----------------------------------------------------------------------
if (_mod == 1) then {
if (_mod == 1) then {
複製
已複製
複製
已複製
if (_vel < -360) then {
if (_vel < -360) then {
_vel = -360;
_vel = -360;
};
};
複製
已複製
複製
已複製
if (_vel > 360) then {
if (_vel > 360) then {
_vel = 360;
_vel = 360;
};
};
};
};
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// Do forever...
// Do forever...
複製
已複製
複製
已複製
while {
0 != 1
} do
while {
true
} do
{
{
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// Set direction based on wind
// Set direction based on wind
if (_mod == 0) then {
if (_mod == 0) then {
// Get current wind direction
// Get current wind direction
複製
已複製
複製
已複製
_wdr = windDir;
private
_wdr = windDir;
// Randomise wind direction
// Randomise wind direction
_wdr = _wdr + ((random (_vel * 2))- _vel);
_wdr = _wdr + ((random (_vel * 2))- _vel);
// Get difference in direction
// Get difference in direction
複製
已複製
複製
已複製
_dif = (_wdr - (getDir _obj));
private
_dif = (_wdr - (getDir _obj));
// If difference is greather than 180°
// If difference is greather than 180°
if (abs _dif > 180) then {
if (abs _dif > 180) then {
// Rotate counter-clockwise
// Rotate counter-clockwise
_dif = _vel * -1;
_dif = _vel * -1;
複製
已複製
複製
已複製
}
}
else
{
else
{
// Rotate clockwise
// Rotate clockwise
_dif = _vel;
_dif = _vel;
};
};
複製
已複製
複製
已複製
// Alternatively: _dif = [_vel, _vel * -1] select (abs _dif > 180);
// Calculate rate of change
// Calculate rate of change
_dif = _dif * _upd;
_dif = _dif * _upd;
// Increment current direction
// Increment current direction
_dif = (getDir _obj) + _dif;
_dif = (getDir _obj) + _dif;
// Set to new direction
// Set to new direction
_obj setDir _dif;
_obj setDir _dif;
};
};
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// Rotate object clockwise/counter-clockwise
// Rotate object clockwise/counter-clockwise
if (_mod == 1) then {
if (_mod == 1) then {
// Update rotation
// Update rotation
複製
已複製
複製
已複製
_dif = (getDir _obj) + (_vel * _upd);
private
_dif = (getDir _obj) + (_vel * _upd);
// Deal with out of range rotations
// Deal with out of range rotations
複製
已複製
複製
已複製
if (_dif < 0) then {
if (_dif < 0) then {
_dif = _dif + 360;
_dif = _dif + 360;
};
};
複製
已複製
複製
已複製
if (_dif > 360) then {
if (_dif > 360) then {
_dif = _dif - 360;
_dif = _dif - 360;
};
};
// Set to new rotatoin
// Set to new rotatoin
_obj setDir _dif;
_obj setDir _dif;
};
};
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// Wait for next update time
// Wait for next update time
sleep _upd;
sleep _upd;
};
};
複製
已複製
複製
已複製
已保存差異
原始文本
開啟檔案
// _null = [this, 0, 1] execVM "moveWithWind.sqf"; // Rotate with Wind // _null = [this, 1, 1] execVM "moveWithWind.sqf"; // Continuous rotation private ["_obj", "_mod", "_vel", "_dif", "_wdr", "_upd"]; _obj = _this select 0; // The object being affected _mod = _this select 1; // The mode of movement (0 = wind, 1 = Rotation, 2 = TBD, etc.) _vel = _this select 2; // Movement velocity (1° to 45°) _upd = 1 / 30; // The object update rate // If this isn't the server then get out if (!isServer) exitWith {}; //---------------------------------------------------------------------- // Constrain velocity if (_mod == 0) then { _vel = abs _vel; if (_vel < 1) then { _vel = 1; }; if (_vel > 45) then { _vel = 45; }; }; //---------------------------------------------------------------------- if (_mod == 1) then { if (_vel < -360) then { _vel = -360; }; if (_vel > 360) then { _vel = 360; }; }; //---------------------------------------------------------------------- // Do forever... while {0 != 1} do { //---------------------------------------------------------------------- // Set direction based on wind if (_mod == 0) then { // Get current wind direction _wdr = windDir; // Randomise wind direction _wdr = _wdr + ((random (_vel * 2))- _vel); // Get difference in direction _dif = (_wdr - (getDir _obj)); // If difference is greather than 180° if (abs _dif > 180) then { // Rotate counter-clockwise _dif = _vel * -1; } else { // Rotate clockwise _dif = _vel; }; // Calculate rate of change _dif = _dif * _upd; // Increment current direction _dif = (getDir _obj) + _dif; // Set to new direction _obj setDir _dif; }; //---------------------------------------------------------------------- // Rotate object clockwise/counter-clockwise if (_mod == 1) then { // Update rotation _dif = (getDir _obj) + (_vel * _upd); // Deal with out of range rotations if (_dif < 0) then { _dif = _dif + 360; }; if (_dif > 360) then { _dif = _dif - 360; }; // Set to new rotatoin _obj setDir _dif; }; //---------------------------------------------------------------------- // Wait for next update time sleep _upd; };
更改後文本
開啟檔案
// _null = [this, 0, 1] execVM "moveWithWind.sqf"; // Rotate with Wind // _null = [this, 1, 1] execVM "moveWithWind.sqf"; // Continuous rotation params [ "_obj", // The object being affected "_mod", // The mode of movement (0 = wind, 1 = Rotation, 2 = TBD, etc.) "_vel" // Movement velocity (1° to 45°) ]; // If this isn't the server then get out if (!isServer) exitWith {}; private _upd = 1 / 30; // The object update rate //---------------------------------------------------------------------- // Constrain velocity if (_mod == 0) then { _vel = abs _vel; if (_vel < 1) then { _vel = 1; }; if (_vel > 45) then { _vel = 45; }; }; //---------------------------------------------------------------------- if (_mod == 1) then { if (_vel < -360) then { _vel = -360; }; if (_vel > 360) then { _vel = 360; }; }; //---------------------------------------------------------------------- // Do forever... while {true} do { //---------------------------------------------------------------------- // Set direction based on wind if (_mod == 0) then { // Get current wind direction private _wdr = windDir; // Randomise wind direction _wdr = _wdr + ((random (_vel * 2))- _vel); // Get difference in direction private _dif = (_wdr - (getDir _obj)); // If difference is greather than 180° if (abs _dif > 180) then { // Rotate counter-clockwise _dif = _vel * -1; } else { // Rotate clockwise _dif = _vel; }; // Alternatively: _dif = [_vel, _vel * -1] select (abs _dif > 180); // Calculate rate of change _dif = _dif * _upd; // Increment current direction _dif = (getDir _obj) + _dif; // Set to new direction _obj setDir _dif; }; //---------------------------------------------------------------------- // Rotate object clockwise/counter-clockwise if (_mod == 1) then { // Update rotation private _dif = (getDir _obj) + (_vel * _upd); // Deal with out of range rotations if (_dif < 0) then { _dif = _dif + 360; }; if (_dif > 360) then { _dif = _dif - 360; }; // Set to new rotatoin _obj setDir _dif; }; //---------------------------------------------------------------------- // Wait for next update time sleep _upd; };
尋找差異