User Tools

Site Tools


DzBox3

Describes a parametrically defined box in three dimensional space.

More...

Inherits :

Properties

Constructors

DAZ Script
DzBox3 ()
DzBox3 ( Number xMin, Number yMin, Number zMin, Number xMax, Number yMax, Number zMax )
DzBox3 ( DzVec3 min, DzVec3 max )
DzBox3 ( DzBox3 box )

Methods

DAZ Script
DzVec3closestPoint ( DzVec3 point )
BooleancontainsPoint ( DzVec3 point )
DzVec3getCenter ()
BooleangetIntersection ( DzLine3 ray, DzVec3 firstIntersection, DzVec3 lastIntersection )
NumbergetSize ()
DzBox3getTransformedBox ( DzMatrix3 matrix )
voidinclude ( DzVec3 vec )
voidinclude ( DzBox3 box )
BooleanisValid ()
BooleantestIntersection ( DzLine3 ray, Number tolerance )
voidtranslate ( DzVec3 vec )

Detailed Description

Represents a three dimensional box by storing two three dimensional floating point vectors; an upper and lower corner for the box.

Properties


DzVec3 : max

Holds the maximum corner of the box.


Number : maxX

Holds the maximum value of the box on the x axis.


Number : maxY

Holds the maximum value of the box on the y axis.


Number : maxZ

Holds the maximum value of the box on the z axis.


DzVec3 : min

Holds the minimum corner of the box.


Number : minX

Holds the minimum value of the box on the x axis.


Number : minY

Holds the minimum value of the box on the y axis.


Number : minZ

Holds the minimum value of the box on the z axis.

Constructors


DzBox3()

Creates an uninitialized box - the first point included in an uninitialized box will become the min and max for the box.


DzBox3( Number xMin, Number yMin, Number zMin, Number xMax, Number yMax, Number zMax )

Creates an initialized box with the given min and max values.

Parameter(s):

  • xmin - The minimum value for the box on the x axis.
  • ymin - The minimum value for the box on the y axis.
  • zmin - The minimum value for the box on the z axis.
  • xmax - The maximum value for the box on the x axis.
  • ymax - The maximum value for the box on the y axis.
  • zmax - The maximum value for the box on the z axis.

DzBox3( DzVec3 min, DzVec3 max )

Creates an initialized box with the given min and max values.

Parameter(s):

  • min - The minimum corner of the box.
  • max - The maximum corner of the box.

DzBox3( DzBox3 box )

Copy Constructor.

Parameter(s):

  • box - The box to copy.

Methods


DzVec3 : closestPoint( DzVec3 point )

Parameter(s):

  • point - The point to find the closest point in the box to.

Return Value:

  • The closest point in the box to point. Returns point if point is already in the box.

Since:

  • 4.9.3.33

Boolean : containsPoint( DzVec3 point )

Parameter(s):

  • point - The point to check whether or not the box contains it.

Return Value:

  • true if point is inside the box, otherwise false.

Since:

  • 4.9.3.48

DzVec3 : getCenter()

Return Value:

  • The center point of the box.

Boolean : getIntersection( DzLine3 ray, DzVec3 firstIntersection, DzVec3 lastIntersection )

Tests the box for intersection with the ray, and determines the two points on the box intersected by the line.

Parameter(s):

  • ray - The line to test for intersection with the box.
  • firstIntersection - The variable that will be set to the first intersection of the ray with the box.
  • lastIntersection - The variable that will be set to the second intersection of the ray with the box.

Return Value:

  • true if the given ray intersects the box. Sets firstIntersection and secondIntersection to the points where the ray intersects the box.

Since:

  • 4.9.3.33

Number : getSize()

Return Value:

  • The corner to corner distance of this box.

DzBox3 : getTransformedBox( DzMatrix3 matrix )

Creates a new box by transforming the corners of this box through the given matrix and then including them.

Return Value:

  • A copy of this box that has been transformed by the matrix.

void : include( DzVec3 vec )

Parameter(s):

  • vec - The point to include in the box.

void : include( DzBox3 box )

Grows the box, if necessary, to include the given box.

Parameter(s):

  • box - The box to include in the box.

Boolean : isValid()

Return Value:

  • true if the box is valid, false if it is uninitialized.

Since:

  • 4.9.3.33

Boolean : testIntersection( DzLine3 ray, Number tolerance )

Provides a fast intersection test without returning the intersection locations. This function is much faster than getIntersection().

Parameter(s):

  • ray - The line to test for intersection with the box.

Return Value:

  • true if the ray intersects the box, otherwise false.

Since:

  • 4.9.3.33

void : translate( DzVec3 vec )

Translates the corners of the box by adding the given vector.