User Tools

Site Tools


DzBox3

Describes a parametrically defined box in three dimensional space.

More...

Inherits :

Properties

Constructors

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

Methods

Detailed Description

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

Properties


DzVec3 : max

Holds the maximum corner of this box.


Number : maxX

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


Number : maxY

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


Number : maxZ

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


DzVec3 : min

Holds the minimum corner of this box.


Number : minX

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


Number : minY

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


Number : minZ

Holds the minimum value of this 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 this box.


DzBox3( String box )

Creates a box by parsing a string.

Parameter(s):

  • box - A string representation of the box in the form "[[ minX, minY, minZ ],[ maxX, maxY, maxZ ]]"

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 this box on the x axis.
  • ymin - The minimum value for this box on the y axis.
  • zmin - The minimum value for this box on the z axis.
  • xmax - The maximum value for this box on the x axis.
  • ymax - The maximum value for this box on the y axis.
  • zmax - The maximum value for this 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 this box.
  • max - The maximum corner of this 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 this box to.

Return Value:

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

Since:

  • 4.9.3.33

Boolean : containsPoint( DzVec3 point )

Parameter(s):

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

Return Value:

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

Since:

  • 4.9.3.48

DzVec3 : getCenter()

Return Value:

  • The center point of this box.

Object : getIntersection( DzLine3 ray )

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

Parameter(s):

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

Return Value:

  • An object where the “intersects” property represents whether or not this box intersects with the given line, the “firstIntersection” property represents the first intersection point, and the “lastIntersection” property represents the last intersection point if ray intersects.

Since:

  • 4.14.1.36

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.

Parameter(s):

  • matrix - The transform to apply.

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 this box.

void : include( DzBox3 box )

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

Parameter(s):

  • box - The box to include in this box.

Boolean : isValid()

Return Value:

  • true if this 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 this box.
  • tolerance - The amount of deviation allowed and still be considered an intersection.

Return Value:

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

Since:

  • 4.9.3.33

String : toString()

Return Value:

  • A string representation of this box in the form "[[ minX, minY, minZ ],[ maxX, maxY, maxZ ]]".

void : translate( DzVec3 vec )

Translates this box by adding the given vector.

Parameter(s):

  • vec - The vector to translate by.