Package toxi.geom
Class SphereIntersectorReflector
java.lang.Object
toxi.geom.SphereIntersectorReflector
- All Implemented Interfaces:
Intersector3D
,Reflector3D
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetReflectedRayPointAtDistance
(float dist) Returns the point on the reflected ray at given distance from the intersection pointfloat
float
Calculates the distance of the vector to the given sphere in the specified direction.boolean
intersectsRay
(Ray3D ray) Checks if entity intersects with the given ray.reflectRay
(Ray3D ray) Reflects given ray on the entity's surfacevoid
-
Constructor Details
-
SphereIntersectorReflector
-
SphereIntersectorReflector
-
-
Method Details
-
getIntersectionData
- Specified by:
getIntersectionData
in interfaceIntersector3D
- Returns:
- intersection data parcel
-
getReflectedRayPointAtDistance
Description copied from interface:Reflector3D
Returns the point on the reflected ray at given distance from the intersection point- Specified by:
getReflectedRayPointAtDistance
in interfaceReflector3D
- Parameters:
dist
- distance from isect position- Returns:
- point on reflected ray
-
getReflectionAngle
public float getReflectionAngle()- Specified by:
getReflectionAngle
in interfaceReflector3D
- Returns:
- angle between incident ray and surface normal
-
getSphere
- Returns:
- the sphere
-
intersectRayDistance
Calculates the distance of the vector to the given sphere in the specified direction. A sphere is defined by a 3D point and a radius. Normalized directional vectors expected.- Parameters:
ray
- intersection ray- Returns:
- distance to sphere in world units, -1 if no intersection.
-
intersectsRay
Description copied from interface:Intersector3D
Checks if entity intersects with the given ray. Further intersection details can then be queried via theIsectData3D
instance returned byIntersector3D.getIntersectionData()
.- Specified by:
intersectsRay
in interfaceIntersector3D
- Parameters:
ray
- ray to check- Returns:
- true, if ray hits the entity
-
reflectRay
Description copied from interface:Reflector3D
Reflects given ray on the entity's surface- Specified by:
reflectRay
in interfaceReflector3D
- Parameters:
ray
- incident ray- Returns:
- reflected ray starting from intersection point
-
setSphere
- Parameters:
sphere
- the sphere to set
-