r3-legacy/src/game-lib-solver.js

39 lines
809 B
JavaScript

/**
* Physics Solver Superset
* @param id
* @param name
* @param solverType
* @param iterations
* @param tolerance
* @constructor
*/
GameLib.D3.Physics.Solver = function(
id,
name,
solverType,
iterations,
tolerance
) {
this.id = id;
if (typeof name == 'undefined') {
if (solverType == GameLib.D3.Physics.SPLIT_SOLVER) {
name = 'split solver';
} else if (solverType == GameLib.D3.Physics.GS_SOLVER) {
name = 'gs solver';
} else {
name = 'unknown solver';
}
}
this.name = name;
this.solverType = solverType;
this.iterations = iterations;
this.tolerance = tolerance;
};
/**
* Solver Types
* @type {number}
*/
GameLib.D3.Physics.SPLIT_SOLVER = 0x1;
GameLib.D3.Physics.GS_SOLVER = 0x2;