Diff
checker
Texte
Texte
Images
Documents
Excel
Dossiers
Legal
Enterprise
Application de bureau
Prix
Se connecter
Télécharger Diffchecker Desktop
Comparer le texte
Trouver la différence entre deux fichiers texte
Outils
Historique
Éditeur live
Cacher identiques
Sans retour à la ligne
Vue
Divisé
Unifié
Niveau de précision
Intelligent
Mot
Caractère
Coloration syntaxique
Choisir la syntaxe
Ignorer
Transformer le texte
Aller au premier écart
Modifier l'entrée
Diffchecker Desktop
La façon la plus sécurisée d'utiliser Diffchecker. Obtenez l'application Diffchecker Desktop : vos diffs ne quittent jamais votre ordinateur !
Obtenir Desktop
Untitled diff
Créé
il y a 10 ans
Le diff n'expire jamais
Effacer
Exporter
Partager
Expliquer
24 suppressions
Lignes
Total
Supprimé
Caractères
Total
Supprimé
Pour continuer à utiliser cette fonctionnalité, passez à
Diff
checker
Pro
Voir les prix
79 lignes
Copier tout
19 ajouts
Lignes
Total
Ajouté
Caractères
Total
Ajouté
Pour continuer à utiliser cette fonctionnalité, passez à
Diff
checker
Pro
Voir les prix
83 lignes
Copier tout
// _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
Copier
Copié
Copier
Copié
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 {};
Copier
Copié
Copier
Copié
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;
Copier
Copié
Copier
Copié
if (_vel < 1) then {
if (_vel < 1) then {
_vel = 1;
_vel = 1;
};
};
Copier
Copié
Copier
Copié
if (_vel > 45) then {
if (_vel > 45) then {
_vel = 45;
_vel = 45;
};
};
};
};
//----------------------------------------------------------------------
//----------------------------------------------------------------------
if (_mod == 1) then {
if (_mod == 1) then {
Copier
Copié
Copier
Copié
if (_vel < -360) then {
if (_vel < -360) then {
_vel = -360;
_vel = -360;
};
};
Copier
Copié
Copier
Copié
if (_vel > 360) then {
if (_vel > 360) then {
_vel = 360;
_vel = 360;
};
};
};
};
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// Do forever...
// Do forever...
Copier
Copié
Copier
Copié
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
Copier
Copié
Copier
Copié
_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
Copier
Copié
Copier
Copié
_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;
Copier
Copié
Copier
Copié
}
}
else
{
else
{
// Rotate clockwise
// Rotate clockwise
_dif = _vel;
_dif = _vel;
};
};
Copier
Copié
Copier
Copié
// 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
Copier
Copié
Copier
Copié
_dif = (getDir _obj) + (_vel * _upd);
private
_dif = (getDir _obj) + (_vel * _upd);
// Deal with out of range rotations
// Deal with out of range rotations
Copier
Copié
Copier
Copié
if (_dif < 0) then {
if (_dif < 0) then {
_dif = _dif + 360;
_dif = _dif + 360;
};
};
Copier
Copié
Copier
Copié
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;
};
};
Copier
Copié
Copier
Copié
Différences enregistrées
Texte d'origine
Ouvrir un fichier
// _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; };
Texte modifié
Ouvrir un fichier
// _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; };
Trouver la différence