gi-graphene-1.0.2: Graphene bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

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

Exported types

newtype Ray Source #

Memory-managed wrapper type.

Constructors

Ray (ManagedPtr Ray) 

Instances

Instances details
Eq Ray Source # 
Instance details

Defined in GI.Graphene.Structs.Ray

Methods

(==) :: Ray -> Ray -> Bool #

(/=) :: Ray -> Ray -> Bool #

IsGValue Ray Source #

Convert Ray to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Graphene.Structs.Ray

ManagedPtrNewtype Ray Source # 
Instance details

Defined in GI.Graphene.Structs.Ray

TypedObject Ray Source # 
Instance details

Defined in GI.Graphene.Structs.Ray

Methods

glibType :: IO GType #

GBoxed Ray Source # 
Instance details

Defined in GI.Graphene.Structs.Ray

HasParentTypes Ray Source # 
Instance details

Defined in GI.Graphene.Structs.Ray

tag ~ 'AttrSet => Constructible Ray tag Source # 
Instance details

Defined in GI.Graphene.Structs.Ray

Methods

new :: MonadIO m => (ManagedPtr Ray -> Ray) -> [AttrOp Ray tag] -> m Ray #

type ParentTypes Ray Source # 
Instance details

Defined in GI.Graphene.Structs.Ray

type ParentTypes Ray = '[] :: [Type]

newZeroRay :: MonadIO m => m Ray Source #

Construct a Ray struct initialized to zero.

Methods

Overloaded methods

alloc

rayAlloc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m Ray

Returns: the newly allocated Ray. Use rayFree to free the resources allocated by this function

Allocates a new Ray structure.

The contents of the returned structure are undefined.

Since: 1.4

equal

rayEqual Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Ray

a: a Ray

-> Ray

b: a Ray

-> m Bool

Returns: true if the given rays are equal

Checks whether the two given Ray are equal.

Since: 1.4

free

rayFree Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Ray

r: a Ray

-> m () 

Frees the resources allocated by rayAlloc.

Since: 1.4

getClosestPointToPoint

rayGetClosestPointToPoint Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Ray

r: a Ray

-> Point3D

p: a Point3D

-> m Point3D 

Computes the point on the given Ray that is closest to the given point p.

Since: 1.4

getDirection

rayGetDirection Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Ray

r: a Ray

-> m Vec3 

Retrieves the direction of the given Ray.

Since: 1.4

getDistanceToPlane

rayGetDistanceToPlane Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Ray

r: a Ray

-> Plane

p: a 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

r: a Ray

-> Point3D

p: a 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

rayGetOrigin Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Ray

r: a Ray

-> m Point3D 

Retrieves the origin of the given Ray.

Since: 1.4

getPositionAt

rayGetPositionAt Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Ray

r: a Ray

-> Float

t: the distance along the ray

-> m Point3D 

Retrieves the coordinates of a point at the distance t along the given Ray.

Since: 1.4

init

rayInit Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Ray

r: the Ray to initialize

-> Maybe Point3D

origin: the origin of the ray

-> Maybe Vec3

direction: the direction vector

-> m Ray

Returns: the initialized ray

Initializes the given Ray using the given origin and direction values.

Since: 1.4

initFromRay

rayInitFromRay Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Ray

r: the Ray to initialize

-> Ray

src: a Ray

-> m Ray

Returns: the initialized ray

Initializes the given Ray using the origin and direction values of another Ray.

Since: 1.4

initFromVec3

rayInitFromVec3 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Ray

r: the Ray to initialize

-> Maybe Vec3

origin: a Vec3

-> Maybe Vec3

direction: a Vec3

-> m Ray

Returns: the initialized ray

Initializes the given Ray using the given vectors.

Since: 1.4

intersectBox

rayIntersectBox Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Ray

r: a Ray

-> Box

b: a Box

-> m (RayIntersectionKind, Float)

Returns: the type of intersection

Intersects the given Ray r with the given Box b.

Since: 1.10

intersectSphere

rayIntersectSphere Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Ray

r: a Ray

-> Sphere

s: a Sphere

-> m (RayIntersectionKind, Float)

Returns: the type of intersection

Intersects the given Ray r with the given Sphere s.

Since: 1.10

intersectTriangle

rayIntersectTriangle Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Ray

r: a Ray

-> Triangle

t: a Triangle

-> m (RayIntersectionKind, Float)

Returns: the type of intersection

Intersects the given Ray r with the given Triangle t.

Since: 1.10

intersectsBox

rayIntersectsBox Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Ray

r: a Ray

-> Box

b: a Box

-> m Bool

Returns: true if the ray intersects the box

Checks whether the given Ray r intersects the given Box b.

See also: rayIntersectBox

Since: 1.10

intersectsSphere

rayIntersectsSphere Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Ray

r: a Ray

-> Sphere

s: a Sphere

-> m Bool

Returns: true if the ray intersects the sphere

Checks if the given Ray r intersects the given Sphere s.

See also: rayIntersectSphere

Since: 1.10

intersectsTriangle

rayIntersectsTriangle Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Ray

r: a Ray

-> Triangle

t: a Triangle

-> m Bool

Returns: true if the ray intersects the triangle

Checks whether the given Ray r intersects the given Triangle b.

See also: rayIntersectTriangle

Since: 1.10