Methods
-
M addVectors( vectors: Array.<Vector> ) → { Vector }
-
Parameters:
Name Type Description vectorsArray.<Vector> -
M angleBetweenVectors( vector1: Vector, vector2: Vector, type: "degree" ) → { number }
-
Parameters:
Name Type Description vector1Vector vector2Vector type"degree" | "radian" -
M blastParticle( particle: Particle )
-
Blasts the particle
Not yet implementedParameters:
Name Type Description particleParticle the input particle
-
M calculateFPS( lasttime: number, currenttime: number ) → { number }
-
Parameters:
Name Type Description lasttimenumber currenttimenumber the result of the calculation
-
M distanceBetweenVectors( vector1: Vector, vector2: Vector ) → { number }
-
Parameters:
Name Type Description vector1Vector vector2Vector -
M getlength( ) → { number }
-
get length
-
M getNewVelocityByAccelaration( velocity: Vector, accelation: Vector ) → { Vector }
-
returns a new velocity vector if the acceleration is applied to the velocity
Parameters:
Name Type Description velocityVector accelationVector -
M getRandomColor( ) → { string }
-
a random hex color
-
M moveTowardVector( vector1: Vector, vector2: Vector, distance: number ) → { Vector }
-
returns a vector if a vector1 moves to vector2 by distance
Parameters:
Name Type Description vector1Vector vector2Vector distancenumber -
M rotateVector( vector: Vector, angle: number ) → { Vector }
-
Rotates a vector by an angle
Parameters:
Name Type Description vectorVector anglenumber -
M scaleVector( vector: Vector, scale: number ) → { Vector }
-
Scales a vector by a factor
Parameters:
Name Type Description vectorVector scalenumber -
M showFPS( fps: number, color: string )
-
Parameters:
Name Type Description fpsnumber colorstring draws the fps on the screen
-
M subtractVectors( vectors: Array.<Vector> ) → { Vector }
-
Parameters:
Name Type Description vectorsArray.<Vector> -
M translateVector( vector: Vector, translation: Vector ) → { Vector }
-
Translates a vector by a vector
Parameters:
Name Type Description vectorVector translationVector