Class Intersection
- java.lang.Object
-
- com.bombinggames.wurfelengine.core.map.Intersection
-
public class Intersection extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Intersection(Point point, Side normal, float distance)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcalcNormal(Point p)Calcualte the normal based of the position of the point.floatgetDistance()SidegetNormal()PointgetPoint()static Intersectionintersect(Coordinate target, Point p, com.badlogic.gdx.math.Vector3 dir)performs a line-box intersection.
The result are outside the coordiante grid field, so they are forced in it.
-
-
-
Method Detail
-
getNormal
public Side getNormal()
- Returns:
- the normal
-
getPoint
public Point getPoint()
- Returns:
- intersection point
-
getDistance
public float getDistance()
- Returns:
- distance of the ray
-
intersect
public static Intersection intersect(Coordinate target, Point p, com.badlogic.gdx.math.Vector3 dir)
performs a line-box intersection.
The result are outside the coordiante grid field, so they are forced in it.- Parameters:
target- target coordinatep- starting pointdir- direction of ray- Returns:
- null if not hitting
-
calcNormal
public void calcNormal(Point p)
Calcualte the normal based of the position of the point.- Parameters:
p-
-
-