Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
GI.Graphene.Structs.Ray
Description
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.
Instances
Eq Ray Source # | |
GBoxed Ray Source # | |
Defined in GI.Graphene.Structs.Ray | |
ManagedPtrNewtype Ray Source # | |
Defined in GI.Graphene.Structs.Ray Methods toManagedPtr :: Ray -> ManagedPtr Ray | |
TypedObject Ray Source # | |
Defined in GI.Graphene.Structs.Ray | |
HasParentTypes Ray Source # | |
Defined in GI.Graphene.Structs.Ray | |
tag ~ 'AttrSet => Constructible Ray tag Source # | |
IsGValue (Maybe Ray) Source # | Convert |
Defined in GI.Graphene.Structs.Ray Methods gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Ray -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Ray) | |
type ParentTypes Ray Source # | |
Defined in GI.Graphene.Structs.Ray |
Methods
Click to display all available methods, including inherited ones
Methods
equal, free, init, initFromRay, initFromVec3, intersectBox, intersectSphere, intersectTriangle, intersectsBox, intersectsSphere, intersectsTriangle.
Getters
getClosestPointToPoint, getDirection, getDistanceToPlane, getDistanceToPoint, getOrigin, getPositionAt.
Setters
None.
alloc
Arguments
:: (HasCallStack, MonadIO m) | |
=> m Ray | Returns: the newly allocated |
equal
Arguments
:: (HasCallStack, MonadIO m) | |
=> Ray |
|
-> Ray |
|
-> m Bool | Returns: |
Checks whether the two given Ray
are equal.
Since: 1.4
free
Arguments
:: (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
Arguments
:: (HasCallStack, MonadIO m) | |
=> Ray |
|
-> m Vec3 |
Retrieves the direction of the given Ray
.
Since: 1.4
getDistanceToPlane
rayGetDistanceToPlane Source #
Arguments
:: (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 #
Arguments
:: (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
Arguments
:: (HasCallStack, MonadIO m) | |
=> Ray |
|
-> m Point3D |
Retrieves the origin of the given Ray
.
Since: 1.4
getPositionAt
Arguments
:: (HasCallStack, MonadIO m) | |
=> Ray |
|
-> Float |
|
-> m Point3D |
Retrieves the coordinates of a point at the distance t
along the
given Ray
.
Since: 1.4
init
Arguments
:: (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
Arguments
:: (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
Arguments
:: (HasCallStack, MonadIO m) | |
=> Ray |
|
-> Box |
|
-> m (RayIntersectionKind, Float) | Returns: the type of intersection |
intersectSphere
Arguments
:: (HasCallStack, MonadIO m) | |
=> Ray |
|
-> Sphere |
|
-> m (RayIntersectionKind, Float) | Returns: the type of intersection |
intersectTriangle
Arguments
:: (HasCallStack, MonadIO m) | |
=> Ray |
|
-> Triangle |
|
-> m (RayIntersectionKind, Float) | Returns: the type of intersection |
intersectsBox
intersectsSphere
intersectsTriangle
rayIntersectsTriangle Source #
Arguments
:: (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