This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
UnigineEditor
界面概述
资产工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
Setting Up Properties
照明
Landscape Tool
Sandworm (Experimental)
使用编辑器工具执行特定任务
Extending Editor Functionality
嵌入式节点类型
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Objects
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine.WorldBoundBox Class

This class serves to construct the bounding box in double precision coordinates.

Bounding boxes has better precision quality but it takes more time for calculation in comparison with bounding spheres.

By using this class you can easily find the common bounding box for several objects by expanding the bounding box.

WorldBoundBox Class

Properties

dvec3 Center#

Center point of the bounding box.

dvec3 Max#

The maximum coordinates of the bounding box.

dvec3 Min#

The minimum coordinates of the bounding box.

bool IsValid#

Checks if the bounding box coordinates are valid (minimum coordinate along the X axis is less or equal to the maximum coordinate along the X axis).

Members


static WorldBoundBox ( ) #

Default constructor. Creates an empty bounding box.

WorldBoundBox ( dvec3 min, dvec3 max ) #

Constructor. Initializes new bounding box by minimum and maximum coordinates of the bounding box.

Arguments

  • dvec3 min - The bounding box minimum coordinates.
  • dvec3 max - The bounding box maximum coordinates.

WorldBoundBox ( WorldBoundBox bb ) #

Constructor. Initializes new bounding box by using given bounding box.

Arguments

  • WorldBoundBox bb - Bounding box.

WorldBoundBox ( WorldBoundSphere bs ) #

Constructor. Initializes new bounding box by the using given bounding sphere.

Arguments

WorldBoundBox ( BoundBox bb, dmat4 transform ) #

Arguments

void Clear ( ) #

Clears the bounding box.

void Set ( dvec3 min, dvec3 max ) #

Sets the bounding box by its minimum and maximum coordinates.

Arguments

  • dvec3 min - Minimum coordinates of the bounding box.
  • dvec3 max - Maximum coordinates of the bounding box.

void Set ( dvec3[] points ) #

Sets the bounding box by the coordinates of points in space to be enclosed by it.

Arguments

  • dvec3[] points - Array of points to be enclosed by the bounding box.

void Set ( BoundBox bb, dmat4 transform ) #

Sets the bounding box by the given bounding box with the given transformation matrix taken into account.

Arguments

  • BoundBox bb - Source bounding box.
  • dmat4 transform - Transformation matrix.

void Set ( WorldBoundSphere bs ) #

Sets the bounding box by the bounding sphere.

Arguments

void Set ( WorldBoundBox bb ) #

Sets the bounding box.

Arguments

  • WorldBoundBox bb - The bounding box.

void SetTransform ( dmat4 transform ) #

Sets the given transformation matrix to the bounding box.

Arguments

  • dmat4 transform - Transformation matrix.

int Compare ( WorldBoundBox bb ) #

Compares the current bounding box with the given one.

Arguments

  • WorldBoundBox bb - The bounding box to compare with.

Return value

1 if the size and position of both bounding boxes are equal; otherwise, 0.

void Expand ( dvec3 point ) #

Expands the current bounding box to include the given point.

Arguments

  • dvec3 point - Coordinates of the point.

void Expand ( dvec3[] points ) #

Expands the current bounding box to enclose all given points.

Arguments

  • dvec3[] points - Array of points to be enclosed by the bounding box.

void Expand ( WorldBoundSphere bs ) #

Expands the current bounding box to include the given bounding sphere.

Arguments

void Expand ( WorldBoundBox bb ) #

Expands the current bounding box to include the given bounding box.

Arguments

  • WorldBoundBox bb - The bounding box.

int Inside ( dvec3 point ) #

Checks if the specified point is inside the current bounding box.

Arguments

  • dvec3 point - Coordinates of the point.

Return value

1 if the point is inside the bounding box; otherwise, 0.

int Inside ( dvec3 point, double radius ) #

Checks if the specified sphere is inside the current bounding box.

Arguments

  • dvec3 point - The coordinates of the center of the sphere.
  • double radius - The sphere radius.

Return value

1 if the sphere is inside the bounding box; otherwise, 0.

int Inside ( dvec3 min, dvec3 max ) #

Checks if the given box is inside the current bounding box.

Arguments

  • dvec3 min - Minimum coordinates of the box.
  • dvec3 max - Maximum coordinates of the box.

Return value

1 if the box is inside the bounding box; otherwise, 0.

int Inside ( WorldBoundSphere bs ) #

Checks if the specified bounding sphere is inside the current bounding box.

Arguments

Return value

1 if the bounding sphere is inside the bounding box; otherwise, 0.

int Inside ( WorldBoundBox bb ) #

Checks if the given bounding box is inside the current bounding box.

Arguments

  • WorldBoundBox bb - The bounding box.

Return value

1 if the bounding box is inside the bounding box; otherwise, 0.

int InsideAll ( WorldBoundSphere bs ) #

Checks if the whole given bounding sphere is inside the current bounding box.

Arguments

Return value

1 if the whole sphere is inside the bounding box; otherwise, 0.

int InsideAll ( WorldBoundBox bb ) #

Checks if the whole given bounding box is inside the current bounding box.

Arguments

  • WorldBoundBox bb - The bounding box.

Return value

1 if the whole box is inside the bounding box; otherwise, 0.

int InsideCube ( int face, dvec3 point ) #

Checks if a face of the current bounding box is inside the cube represented by minimum and maximum coordinates of the bounding box.

Arguments

  • int face - The face index from 0 to 5.
  • dvec3 point - Offset.

Return value

1 if the face is inside the bounding cube; otherwise, 0.

int IrayIntersectionValid ( dvec3 p, dvec3 idirection ) #

Checks for an intersection between a ray and the current bounding box. This function uses the inverse direction of the ray, which increases performance.

Arguments

  • dvec3 p - Starting point of the ray.
  • dvec3 idirection - Inverse direction of the ray.

Return value

1 if the given ray intersects the bounding box; otherwise, 0.

double DistanceValid ( dvec3 point ) #

Returns the distance from the given point to the closest vertex of the bounding box.

Arguments

  • dvec3 point - Coordinates of the point.

Return value

Distance from the given point to the closest vertex of the bounding box, in units.
Last update: 2020-11-24
Build: ()