1.3 <GrapheneFrustum>

Structure: <GrapheneFrustum>

A 3D volume delimited by 2D clip planes.

The contents of the <GrapheneFrustum> are private, and should not be modified directly.

Procedures

Procedure: frustum:alloc ⇒ %return

Allocates a new <GrapheneFrustum> structure.

The contents of the returned structure are undefined.

%return

Returned: a <GrapheneFrustum>.

the newly allocated <GrapheneFrustum> structure. Use frustum:free to free the resources allocated by this function.

Method: frustum:contains-point? self point ⇒ %return
Method: contains-point? self point ⇒ %return

Checks whether a point is inside the volume defined by the given <GrapheneFrustum>.

self

Passed: a <GrapheneFrustum>.

a <GrapheneFrustum>

point

Passed: a <GraphenePoint3D>.

a <GraphenePoint3D>

%return

Returned: a boolean.

true if the point is inside the frustum

Method: frustum:equal? self b ⇒ %return
Method: equal? self b ⇒ %return

Checks whether the two given <GrapheneFrustum> are equal.

self

Passed: a <GrapheneFrustum>.

a <GrapheneFrustum>

b

Passed: a <GrapheneFrustum>.

a <GrapheneFrustum>

%return

Returned: a boolean.

true if the given frustums are equal

Method: frustum:free self
Method: free self

Frees the resources allocated by frustum:alloc.

self

Passed: a <GrapheneFrustum>.

a <GrapheneFrustum>

Method: frustum:get-planes! self planes ⇒ planes
Method: get-planes! self planes ⇒ planes

Retrieves the planes that define the given <GrapheneFrustum>.

self

Passed: a <GrapheneFrustum>.

a <GrapheneFrustum>

planes

Passed: a list or vector, each a <GraphenePlane>. It is filled in, and returned: a vector, each a <GraphenePlane>.

return location for an array of 6 <GraphenePlane>

Method: frustum:init self p0 p1 p2 p3 p4 p5 ⇒ %return
Method: init self p0 p1 p2 p3 p4 p5 ⇒ %return

Initializes the given <GrapheneFrustum> using the provided clipping planes.

self

Passed: a <GrapheneFrustum>.

the <GrapheneFrustum> to initialize

p0

Passed: a <GraphenePlane>.

a clipping plane

p1

Passed: a <GraphenePlane>.

a clipping plane

p2

Passed: a <GraphenePlane>.

a clipping plane

p3

Passed: a <GraphenePlane>.

a clipping plane

p4

Passed: a <GraphenePlane>.

a clipping plane

p5

Passed: a <GraphenePlane>.

a clipping plane

%return

Returned: a <GrapheneFrustum>.

the initialized frustum

Method: frustum:init-from-frustum self src ⇒ %return
Method: init-from-frustum self src ⇒ %return

Initializes the given <GrapheneFrustum> using the clipping planes of another <GrapheneFrustum>.

self

Passed: a <GrapheneFrustum>.

the <GrapheneFrustum> to initialize

src

Passed: a <GrapheneFrustum>.

a <GrapheneFrustum>

%return

Returned: a <GrapheneFrustum>.

the initialized frustum

Method: frustum:init-from-matrix self matrix ⇒ %return
Method: init-from-matrix self matrix ⇒ %return

Initializes a <GrapheneFrustum> using the given matrix.

self

Passed: a <GrapheneFrustum>.

a <GrapheneFrustum>

matrix

Passed: a <GrapheneMatrix>.

a <GrapheneMatrix>

%return

Returned: a <GrapheneFrustum>.

the initialized frustum

Method: frustum:intersects-box? self box ⇒ %return
Method: intersects-box? self box ⇒ %return

Checks whether the given box intersects a plane of a <GrapheneFrustum>.

self

Passed: a <GrapheneFrustum>.

a <GrapheneFrustum>

box

Passed: a <GrapheneBox>.

a <GrapheneBox>

%return

Returned: a boolean.

true if the box intersects the frustum

Method: frustum:intersects-sphere? self sphere ⇒ %return
Method: intersects-sphere? self sphere ⇒ %return

Checks whether the given sphere intersects a plane of a <GrapheneFrustum>.

self

Passed: a <GrapheneFrustum>.

a <GrapheneFrustum>

sphere

Passed: a <GrapheneSphere>.

a <GrapheneSphere>

%return

Returned: a boolean.

true if the sphere intersects the frustum