<commit_before>package com.badlogic.gdx.graphics.g3d;

import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.math.Vector3;

/** Basic general light class which can represent an ambient, directional, point and spot light.
 * Extend this class to add additional data.
 * @author Xoppa */
public class Light {
	/** The (diffuse) color of the light */
	public final Color color = new Color();
	/** The position of the light or null of not applicable. */ 
	public Vector3 position;
	/** The direction of the light or null of not applicable. */
	public Vector3 direction;
	/** The cut off angle of the light, only applicable if both direction and position aren't null. */ 
	public float angle = 0f;
	/** The power of the light */
	public float power = 1f;
	
	/** Create a new ambient light */
	public Light(final Color color) {
		this.color.set(color);
	}
	
	/** Create a new ambient light */
	public Light(float r, float g, float b, float a) {
		this.color.set(r, g, b, a);
	}
	
	/** Create a new directional light */
	public Light(final Color color, final Vector3 direction) {
		this.color.set(color);
		this.direction = new Vector3(direction);
	}
	
	/** Create a new directional light */
	public Light(float r, float g, float b, float a, float x, float y, float z) {
		this.color.set(r, g, b, a);
		this.direction = new Vector3(x, y, z);
	}
	
	/** Create a new point light */
	public Light(final Color color, final Vector3 position, final float power) {
		this(color.r, color.g, color.b, color.a, position.x, position.y, position.z, power);
	}
	
	/** Create a new point light */
	public Light(final float red, final float green, final float blue, final float alpha, 
					final float x, final float y, final float z, final float power) {
		color.set(red, green, blue, alpha);
		this.position = new Vector3(x, y, z);
		this.power = power;
	}
	
	/** Create a new spot light */
	public Light(final Color color, final Vector3 position, final Vector3 direction, final float angle, final float power) {
		this.color.set(color);
		this.position = new Vector3(position);
		this.direction = new Vector3(direction);
		this.angle = angle;
		this.power = power;
	}
	
	public boolean equals(Light other) {
		if (other == null) return false;
		if (other == this) return true;
		if (!color.equals(other.color))
			return false;
		if ((position == null) != (other.position == null))
			return false;
		if (position != null && !position.equals(other.position))
			return false;
		if ((direction == null) != (other.direction == null))
			return false;
		if (direction != null && !direction.equals(other.direction))
			return false;
		if (position != null && power != other.power)
			return false;
		if (direction != null && position != null && angle != other.angle)
			return false;
		return true;
	}
	
	@Override
	public boolean equals (Object arg0) {
		if (arg0 == null) return false;
		if (arg0 == this) return true;
		if (!(arg0 instanceof Light)) return false;
		return equals((Light)arg0);
	}
	
	public boolean isAmbientLight() {
		return position == null && direction == null;
	}
	
	public boolean isPointLight() {
		return position != null && direction == null;
	}
	
	public boolean isDirectionalLight() {
		return position == null && direction != null;
	}
	
	public boolean isSpotLight() {
		return position != null && direction != null;
	}
}
<commit_msg>Minor doc changes<commit_after>package com.badlogic.gdx.graphics.g3d;

import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.math.Vector3;

/** Basic general light class which can represent an ambient, directional, point and spot light.
 * Extend this class to add additional data.
 * @author Xoppa */
public class Light {
	/** The (diffuse) color of the light */
	public final Color color = new Color();
	/** The position of the light or null if not applicable. */ 
	public Vector3 position;
	/** The direction of the light or null if not applicable. */
	public Vector3 direction;
	/** The cut off angle of the light, only applicable if both direction and position aren't null. */ 
	public float angle = 0f;
	/** The power of the light, only applicable if position isn't null */
	public float power = 1f;
	
	/** Create a new ambient light */
	public Light(final Color color) {
		this.color.set(color);
	}
	
	/** Create a new ambient light */
	public Light(float r, float g, float b, float a) {
		this.color.set(r, g, b, a);
	}
	
	/** Create a new directional light */
	public Light(final Color color, final Vector3 direction) {
		this.color.set(color);
		this.direction = new Vector3(direction);
	}
	
	/** Create a new directional light */
	public Light(float r, float g, float b, float a, float x, float y, float z) {
		this.color.set(r, g, b, a);
		this.direction = new Vector3(x, y, z);
	}
	
	/** Create a new point light */
	public Light(final Color color, final Vector3 position, final float power) {
		this(color.r, color.g, color.b, color.a, position.x, position.y, position.z, power);
	}
	
	/** Create a new point light */
	public Light(final float red, final float green, final float blue, final float alpha, 
					final float x, final float y, final float z, final float power) {
		color.set(red, green, blue, alpha);
		this.position = new Vector3(x, y, z);
		this.power = power;
	}
	
	/** Create a new spot light */
	public Light(final Color color, final Vector3 position, final Vector3 direction, final float angle, final float power) {
		this.color.set(color);
		this.position = new Vector3(position);
		this.direction = new Vector3(direction);
		this.angle = angle;
		this.power = power;
	}
	
	public boolean equals(Light other) {
		if (other == null) return false;
		if (other == this) return true;
		if (!color.equals(other.color))
			return false;
		if ((position == null) != (other.position == null))
			return false;
		if (position != null && !position.equals(other.position))
			return false;
		if ((direction == null) != (other.direction == null))
			return false;
		if (direction != null && !direction.equals(other.direction))
			return false;
		if (position != null && power != other.power)
			return false;
		if (direction != null && position != null && angle != other.angle)
			return false;
		return true;
	}
	
	@Override
	public boolean equals (Object arg0) {
		if (arg0 == null) return false;
		if (arg0 == this) return true;
		if (!(arg0 instanceof Light)) return false;
		return equals((Light)arg0);
	}
	
	public boolean isAmbientLight() {
		return position == null && direction == null;
	}
	
	public boolean isPointLight() {
		return position != null && direction == null;
	}
	
	public boolean isDirectionalLight() {
		return position == null && direction != null;
	}
	
	public boolean isSpotLight() {
		return position != null && direction != null;
	}
}

{'fraction_non_alphanumeric': 0.12533333333333332, 'fraction_numerical': 0.005925925925925926, 'mean_word_length': 3.5645706558485464, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6533517', 'n_tokens_mistral': 2207, 'n_tokens_neox': 2019, 'n_words': 780}