Package ch.bailu.gtk.graphene
Class Ray
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.type.Record
ch.bailu.gtk.graphene.Ray
- All Implemented Interfaces:
PointerInterface
A ray emitted from an origin in a given direction.
The contents of the `graphene_ray_t` structure are private, and should not
be modified directly.
The contents of the `graphene_ray_t` structure are private, and should not
be modified directly.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Ray
allocRay()
Allocates a new #graphene_ray_t structure.boolean
Checks whether the two given #graphene_ray_t are equal.void
free()
Frees the resources allocated by graphene_ray_alloc().static ClassHandler
void
getClosestPointToPoint
(Point3D p, Point3D res) Computes the point on the given #graphene_ray_t that is closest to the
given point @p.void
getDirection
(Vec3 direction) Retrieves the direction of the given #graphene_ray_t.float
Computes the distance of the origin of the given #graphene_ray_t from the
given plane.float
Computes the distance of the closest approach between the
given #graphene_ray_t @r and the point @p.static int
void
Retrieves the origin of the given #graphene_ray_t.static long
static TypeSystem.TypeSize
void
getPositionAt
(float t, Point3D position) Retrieves the coordinates of a point at the distance @t along the
given #graphene_ray_t.static long
static TypeSystem.TypeSize
Initializes the given #graphene_ray_t using the given @origin
and @direction values.initFromRay
(Ray src) Initializes the given #graphene_ray_t using the origin and direction
values of another #graphene_ray_t.initFromVec3
(Vec3 origin, Vec3 direction) Initializes the given #graphene_ray_t using the given vectors.int
intersectBox
(Box b, Flt t_out) Intersects the given #graphene_ray_t @r with the given
#graphene_box_t @b.boolean
intersectsBox
(Box b) Checks whether the given #graphene_ray_t @r intersects the
given #graphene_box_t @b.int
intersectSphere
(Sphere s, Flt t_out) Intersects the given #graphene_ray_t @r with the given
#graphene_sphere_t @s.boolean
Checks if the given #graphene_ray_t @r intersects the
given #graphene_sphere_t @s.boolean
Checks whether the given #graphene_ray_t @r intersects the
given #graphene_triangle_t @b.int
intersectTriangle
(Triangle t, Flt t_out) Intersects the given #graphene_ray_t @r with the given
#graphene_triangle_t @t.Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Field Details
-
ORIGIN
Private field: direct-type- See Also:
-
DIRECTION
Private field: direct-type- See Also:
-
-
Constructor Details
-
Ray
-
Ray
public Ray()
-
-
Method Details
-
getClassHandler
-
allocRay
Allocates a new #graphene_ray_t structure.
The contents of the returned structure are undefined.- Returns:
- the newly allocated #graphene_ray_t. Use graphene_ray_free() to free the resources allocated by this function
-
equal
Checks whether the two given #graphene_ray_t are equal.- Parameters:
b
- a #graphene_ray_t- Returns:
- `true` if the given rays are equal
-
free
public void free()Frees the resources allocated by graphene_ray_alloc(). -
getClosestPointToPoint
Computes the point on the given #graphene_ray_t that is closest to the
given point @p.- Parameters:
p
- a #graphene_point3d_tres
- return location for the closest point3d
-
getDirection
Retrieves the direction of the given #graphene_ray_t.- Parameters:
direction
- return location for the direction
-
getDistanceToPlane
Computes the distance of the origin of the given #graphene_ray_t from the
given plane.
If the ray does not intersect the plane, this function returns `INFINITY`.- Parameters:
p
- a #graphene_plane_t- Returns:
- the distance of the origin of the ray from the plane
-
getDistanceToPoint
Computes the distance of the closest approach between the
given #graphene_ray_t @r and the point @p.
The closest approach to a ray from a point is the distance
between the point and the projection of the point on the
ray itself.- Parameters:
p
- a #graphene_point3d_t- Returns:
- the distance of the point
-
getOrigin
Retrieves the origin of the given #graphene_ray_t.- Parameters:
origin
- return location for the origin
-
getPositionAt
Retrieves the coordinates of a point at the distance @t along the
given #graphene_ray_t.- Parameters:
t
- the distance along the rayposition
- return location for the position
-
init
Initializes the given #graphene_ray_t using the given @origin
and @direction values.- Parameters:
origin
- the origin of the raydirection
- the direction vector- Returns:
- the initialized ray
-
initFromRay
Initializes the given #graphene_ray_t using the origin and direction
values of another #graphene_ray_t.- Parameters:
src
- a #graphene_ray_t- Returns:
- the initialized ray
-
initFromVec3
Initializes the given #graphene_ray_t using the given vectors.- Parameters:
origin
- a #graphene_vec3_tdirection
- a #graphene_vec3_t- Returns:
- the initialized ray
-
intersectBox
Intersects the given #graphene_ray_t @r with the given
#graphene_box_t @b.- Parameters:
b
- a #graphene_box_tt_out
- the distance of the point on the ray that intersects the box- Returns:
- the type of intersection
-
intersectSphere
Intersects the given #graphene_ray_t @r with the given
#graphene_sphere_t @s.- Parameters:
s
- a #graphene_sphere_tt_out
- the distance of the point on the ray that intersects the sphere- Returns:
- the type of intersection
-
intersectTriangle
Intersects the given #graphene_ray_t @r with the given
#graphene_triangle_t @t.- Parameters:
t
- a #graphene_triangle_tt_out
- the distance of the point on the ray that intersects the triangle- Returns:
- the type of intersection
-
intersectsBox
Checks whether the given #graphene_ray_t @r intersects the
given #graphene_box_t @b.
See also: graphene_ray_intersect_box()- Parameters:
b
- a #graphene_box_t- Returns:
- `true` if the ray intersects the box
-
intersectsSphere
Checks if the given #graphene_ray_t @r intersects the
given #graphene_sphere_t @s.
See also: graphene_ray_intersect_sphere()- Parameters:
s
- a #graphene_sphere_t- Returns:
- `true` if the ray intersects the sphere
-
intersectsTriangle
Checks whether the given #graphene_ray_t @r intersects the
given #graphene_triangle_t @b.
See also: graphene_ray_intersect_triangle()- Parameters:
t
- a #graphene_triangle_t- Returns:
- `true` if the ray intersects the triangle
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-