/** Rotates the Vector2 by the given angle, counter-clockwise assuming the y-axis points up. * @param degrees the angle in degrees */ public Vector2 rotate (float degrees) { return rotateRad(degrees * MathUtils.degreesToRadians); }
/** Rotates the Vector2 by the given angle, counter-clockwise assuming the y-axis points up. * @param degrees the angle in degrees */ public Vector2 rotate (float degrees) { return rotateRad(degrees * MathUtils.degreesToRadians); }
/** Sets the angle of the vector in radians relative to the x-axis, towards the positive y-axis (typically counter-clockwise). * @param radians The angle in radians to set. */ public Vector2 setAngleRad (float radians) { this.set(len(), 0f); this.rotateRad(radians); return this; }
/** Rotates the Vector2 by the given angle around reference vector, counter-clockwise assuming the y-axis points up. * @param radians the angle in radians * @param reference center Vector2 */ public Vector2 rotateAroundRad (Vector2 reference, float radians) { return this.sub(reference).rotateRad(radians).add(reference); }
/** Sets the angle of the vector in radians relative to the x-axis, towards the positive y-axis (typically counter-clockwise). * @param radians The angle in radians to set. */ public Vector2 setAngleRad (float radians) { this.set(len(), 0f); this.rotateRad(radians); return this; }
/** Rotates the Vector2 by the given angle around reference vector, counter-clockwise assuming the y-axis points up. * @param radians the angle in radians * @param reference center Vector2 */ public Vector2 rotateAroundRad (Vector2 reference, float radians) { return this.sub(reference).rotateRad(radians).add(reference); }
/** Rotates the Vector2 by the given angle, counter-clockwise assuming the y-axis points up. * @param degrees the angle in degrees */ public Vector2 rotate (float degrees) { return rotateRad(degrees * MathUtils.degreesToRadians); }
/** Rotates the Vector2 by the given angle, counter-clockwise assuming the y-axis points up. * @param degrees the angle in degrees */ public Vector2 rotate (float degrees) { return rotateRad(degrees * MathUtils.degreesToRadians); }
/** Rotates the Vector2 by the given angle around reference vector, counter-clockwise assuming the y-axis points up. * @param radians the angle in radians * @param reference center Vector2 */ public Vector2 rotateAroundRad (Vector2 reference, float radians) { return this.sub(reference).rotateRad(radians).add(reference); }
/** Sets the angle of the vector in radians relative to the x-axis, towards the positive y-axis (typically counter-clockwise). * @param radians The angle in radians to set. */ public Vector2 setAngleRad (float radians) { this.set(len(), 0f); this.rotateRad(radians); return this; }
/** Sets the angle of the vector in radians relative to the x-axis, towards the positive y-axis (typically counter-clockwise). * @param radians The angle in radians to set. */ public Vector2 setAngleRad (float radians) { this.set(len(), 0f); this.rotateRad(radians); return this; }
endAngle, position / segmentLengths.items[i]); float angle = rayAngle.angle(); vRayOffset.set(this.rayStartOffset, 0).rotateRad(angle); v1.set(vDirection).scl(position).add(vSegmentStart).add(vRayOffset); v2.set(distance, 0).rotateRad(angle).add(v1); this.endX[rayNumber] = v2.x; this.endY[rayNumber] = v2.y;
endAngle, position / segmentLengths.items[i]); float angle = rayAngle.angle(); vRayOffset.set(this.rayStartOffset, 0).rotateRad(angle); v1.set(vDirection).scl(position).add(vSegmentStart).add(vRayOffset); v2.set(distance, 0).rotateRad(angle).add(v1); this.endX[rayNumber] = v2.x; this.endY[rayNumber] = v2.y;