N-Frustum

#------------------------------------------------------------------------------- #--[Class Description]---------------------------------------------------------- #-------------------------------------------------------------------------------

Gnome::Graphene::N-Frustum

Description

A 3D volume delimited by 2D clip planes.

The contents of the Gnome::Graphene::N-Frustum are private, and should not be modified directly.

#------------------------------------------------------------------------------- #--[Class Initialization]------------------------------------------------------- #-------------------------------------------------------------------------------

Class initialization

new

:native-object

Create an object using a native object from elsewhere. See also Gnome::N::TopLevelSupportClass.

multi method new ( N-Object :$native-object! )

#-------------------------------------------------------------------------------

alloc

Allocates a new Gnome::Graphene::N-Frustum structure.

The contents of the returned structure are undefined.

method alloc ( --> Gnome::Graphene::Frustum \)

#------------------------------------------------------------------------------- #--[Methods]-------------------------------------------------------------------- #-------------------------------------------------------------------------------

Methods

#-------------------------------------------------------------------------------

contains-point

Checks whether a point is inside the volume defined by the given Gnome::Graphene::N-Frustum.

method contains-point ( N-Object $point --> gboolean )
  • $point; a graphene_point3d_t

Return value; true if the point is inside the frustum.

#-------------------------------------------------------------------------------

equal

Checks whether the two given Gnome::Graphene::N-Frustum are equal.

method equal ( N-Object $b --> gboolean )
  • $b; a Gnome::Graphene::N-Frustum

Return value; true if the given frustums are equal.

#-------------------------------------------------------------------------------

free

Frees the resources allocated by .alloc().

method free ( )

#-------------------------------------------------------------------------------

get-planes

Retrieves the planes that define the given Gnome::Graphene::N-Frustum.

method get-planes ( N-Object $planes )
  • $planes; return location for an array of 6 Gnome::Graphene::N-Plane

#-------------------------------------------------------------------------------

init

Initializes the given Gnome::Graphene::N-Frustum using the provided clipping planes.

method init ( N-Object $p0, N-Object $p1, N-Object $p2, N-Object $p3, N-Object $p4, N-Object $p5 --> N-Object )
  • $p0; a clipping plane

  • $p1; a clipping plane

  • $p2; a clipping plane

  • $p3; a clipping plane

  • $p4; a clipping plane

  • $p5; a clipping plane

Return value; the initialized frustum.

#-------------------------------------------------------------------------------

init-from-frustum

Initializes the given Gnome::Graphene::N-Frustum using the clipping planes of another Gnome::Graphene::N-Frustum.

method init-from-frustum ( N-Object $src --> N-Object )
  • $src; a Gnome::Graphene::N-Frustum

Return value; the initialized frustum.

#-------------------------------------------------------------------------------

init-from-matrix

Initializes a Gnome::Graphene::N-Frustum using the given $matrix.

method init-from-matrix ( N-Object $matrix --> N-Object )
  • $matrix; a Gnome::Graphene::N-Matrix

Return value; the initialized frustum.

#-------------------------------------------------------------------------------

intersects-box

Checks whether the given $box intersects a plane of a Gnome::Graphene::N-Frustum.

method intersects-box ( N-Object $box --> gboolean )
  • $box; a Gnome::Graphene::N-Box

Return value; true if the box intersects the frustum.

#-------------------------------------------------------------------------------

intersects-sphere

Checks whether the given $sphere intersects a plane of a Gnome::Graphene::N-Frustum.

method intersects-sphere ( N-Object $sphere --> gboolean )
  • $sphere; a Gnome::Graphene::N-Sphere

Return value; true if the sphere intersects the frustum.

Gnome::Graphene v0.1.11

Graphene is a library of data types commonly used to implement 2D-in-3D or full 3D canvases

Authors

  • Marcel Timmerman

License

Artistic-2.0

Dependencies

Gnome::GObject:api<2>Gnome::Glib:api<2>Gnome::N:api<2>

Test Dependencies

Provides

  • Gnome::Graphene::N-Box
  • Gnome::Graphene::N-Euler
  • Gnome::Graphene::N-Frustum
  • Gnome::Graphene::N-Matrix
  • Gnome::Graphene::N-Plane
  • Gnome::Graphene::N-Point
  • Gnome::Graphene::N-Point3D
  • Gnome::Graphene::N-Quad
  • Gnome::Graphene::N-Quaternion
  • Gnome::Graphene::N-Ray
  • Gnome::Graphene::N-Rect
  • Gnome::Graphene::N-Size
  • Gnome::Graphene::N-Sphere
  • Gnome::Graphene::N-Triangle
  • Gnome::Graphene::N-Vec2
  • Gnome::Graphene::N-Vec3
  • Gnome::Graphene::N-Vec4
  • Gnome::Graphene::T-box
  • Gnome::Graphene::T-config
  • Gnome::Graphene::T-euler
  • Gnome::Graphene::T-frustum
  • Gnome::Graphene::T-matrix
  • Gnome::Graphene::T-plane
  • Gnome::Graphene::T-point
  • Gnome::Graphene::T-point3d
  • Gnome::Graphene::T-quad
  • Gnome::Graphene::T-quaternion
  • Gnome::Graphene::T-ray
  • Gnome::Graphene::T-rect
  • Gnome::Graphene::T-size
  • Gnome::Graphene::T-sphere
  • Gnome::Graphene::T-triangle
  • Gnome::Graphene::T-vec

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.