Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
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.
Since: 1.4
Synopsis
- newtype Ray = Ray (ManagedPtr Ray)
- newZeroRay :: MonadIO m => m Ray
- rayAlloc :: (HasCallStack, MonadIO m) => m Ray
- rayEqual :: (HasCallStack, MonadIO m) => Ray -> Ray -> m Bool
- rayFree :: (HasCallStack, MonadIO m) => Ray -> m ()
- rayGetClosestPointToPoint :: (HasCallStack, MonadIO m) => Ray -> Point3D -> m Point3D
- rayGetDirection :: (HasCallStack, MonadIO m) => Ray -> m Vec3
- rayGetDistanceToPlane :: (HasCallStack, MonadIO m) => Ray -> Plane -> m Float
- rayGetDistanceToPoint :: (HasCallStack, MonadIO m) => Ray -> Point3D -> m Float
- rayGetOrigin :: (HasCallStack, MonadIO m) => Ray -> m Point3D
- rayGetPositionAt :: (HasCallStack, MonadIO m) => Ray -> Float -> m Point3D
- rayInit :: (HasCallStack, MonadIO m) => Ray -> Maybe Point3D -> Maybe Vec3 -> m Ray
- rayInitFromRay :: (HasCallStack, MonadIO m) => Ray -> Ray -> m Ray
- rayInitFromVec3 :: (HasCallStack, MonadIO m) => Ray -> Maybe Vec3 -> Maybe Vec3 -> m Ray
- rayIntersectBox :: (HasCallStack, MonadIO m) => Ray -> Box -> m (RayIntersectionKind, Float)
- rayIntersectSphere :: (HasCallStack, MonadIO m) => Ray -> Sphere -> m (RayIntersectionKind, Float)
- rayIntersectTriangle :: (HasCallStack, MonadIO m) => Ray -> Triangle -> m (RayIntersectionKind, Float)
- rayIntersectsBox :: (HasCallStack, MonadIO m) => Ray -> Box -> m Bool
- rayIntersectsSphere :: (HasCallStack, MonadIO m) => Ray -> Sphere -> m Bool
- rayIntersectsTriangle :: (HasCallStack, MonadIO m) => Ray -> Triangle -> m Bool
Exported types
Memory-managed wrapper type.
Ray (ManagedPtr Ray) |
Instances
Eq Ray Source # | |
IsGValue Ray Source # | Convert |
ManagedPtrNewtype Ray Source # | |
Defined in GI.Graphene.Structs.Ray toManagedPtr :: Ray -> ManagedPtr Ray # | |
TypedObject Ray Source # | |
Defined in GI.Graphene.Structs.Ray | |
GBoxed Ray Source # | |
Defined in GI.Graphene.Structs.Ray | |
HasParentTypes Ray Source # | |
Defined in GI.Graphene.Structs.Ray | |
tag ~ 'AttrSet => Constructible Ray tag Source # | |
Defined in GI.Graphene.Structs.Ray | |
type ParentTypes Ray Source # | |
Defined in GI.Graphene.Structs.Ray |
Methods
Overloaded methods
alloc
:: (HasCallStack, MonadIO m) | |
=> m Ray | Returns: the newly allocated |
equal
:: (HasCallStack, MonadIO m) | |
=> Ray |
|
-> Ray |
|
-> m Bool | Returns: |
Checks whether the two given Ray
are equal.
Since: 1.4
free
:: (HasCallStack, MonadIO m) | |
=> Ray |
|
-> m () |
Frees the resources allocated by rayAlloc
.
Since: 1.4
getClosestPointToPoint
rayGetClosestPointToPoint Source #
Computes the point on the given Ray
that is closest to the
given point p
.
Since: 1.4
getDirection
:: (HasCallStack, MonadIO m) | |
=> Ray |
|
-> m Vec3 |
Retrieves the direction of the given Ray
.
Since: 1.4
getDistanceToPlane
rayGetDistanceToPlane Source #
:: (HasCallStack, MonadIO m) | |
=> Ray |
|
-> Plane |
|
-> m Float | Returns: the distance of the origin of the ray from the plane |
Computes the distance of the origin of the given Ray
from the
given plane.
If the ray does not intersect the plane, this function returns INFINITY
.
Since: 1.4
getDistanceToPoint
rayGetDistanceToPoint Source #
:: (HasCallStack, MonadIO m) | |
=> Ray |
|
-> Point3D |
|
-> m Float | Returns: the distance of the point |
Computes the distance of the closest approach between the
given Ray
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.
Since: 1.4
getOrigin
:: (HasCallStack, MonadIO m) | |
=> Ray |
|
-> m Point3D |
Retrieves the origin of the given Ray
.
Since: 1.4
getPositionAt
Retrieves the coordinates of a point at the distance t
along the
given Ray
.
Since: 1.4
init
:: (HasCallStack, MonadIO m) | |
=> Ray |
|
-> Maybe Point3D |
|
-> Maybe Vec3 |
|
-> m Ray | Returns: the initialized ray |
Initializes the given Ray
using the given origin
and direction
values.
Since: 1.4
initFromRay
initFromVec3
:: (HasCallStack, MonadIO m) | |
=> Ray |
|
-> Maybe Vec3 |
|
-> Maybe Vec3 |
|
-> m Ray | Returns: the initialized ray |
Initializes the given Ray
using the given vectors.
Since: 1.4
intersectBox
:: (HasCallStack, MonadIO m) | |
=> Ray |
|
-> Box |
|
-> m (RayIntersectionKind, Float) | Returns: the type of intersection |
intersectSphere
:: (HasCallStack, MonadIO m) | |
=> Ray |
|
-> Sphere |
|
-> m (RayIntersectionKind, Float) | Returns: the type of intersection |
intersectTriangle
:: (HasCallStack, MonadIO m) | |
=> Ray |
|
-> Triangle |
|
-> m (RayIntersectionKind, Float) | Returns: the type of intersection |
intersectsBox
intersectsSphere
intersectsTriangle
rayIntersectsTriangle Source #
:: (HasCallStack, MonadIO m) | |
=> Ray |
|
-> Triangle |
|
-> m Bool | Returns: |
Checks whether the given Ray
r
intersects the
given Triangle
b
.
See also: rayIntersectTriangle
Since: 1.10