summaryrefslogtreecommitdiff
path: root/src/tesseract/objects/HalfSpace.java
blob: df3f71567106558b365b14913660f2c4a4cf4133 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package tesseract.objects;

import javax.vecmath.Vector3f;

public class HalfSpace extends PhysicalObject {
	public Vector3f normal;
	// Right-hand side of the plane equation: Ax + By + Cz = D
	public float intercept;

	public HalfSpace(Vector3f position, Vector3f normal) {
		super(position, Float.POSITIVE_INFINITY);

		this.normal = new Vector3f(normal);
		this.normal.normalize();
		this.intercept = this.normal.dot(position);
	}
}