WorldBoundSphere Class
The scope of applications for UnigineScript is limited to implementing materials-related logic (material expressions, scriptable materials, brush materials). Do not use UnigineScript as a language for application logic, please consider C#/C++ instead, as these APIs are the preferred ones. Availability of new Engine features in UnigineScipt (beyond its scope of applications) is not guaranteed, as the current level of support assumes only fixing critical issues.
This class serves to construct the bounding sphere in double precision coordinates.
By using this class you can easily find the common bounding sphere for several objects by expanding the bounding sphere.
WorldBoundSphere Class
Members
static WorldBoundSphere ( ) #
Constructor. Creates an empty bounding sphere.WorldBoundSphere ( dvec3 center, double radius ) #
Constructor. Initializes bounding sphere by the center and radius of the bounding sphere.Arguments
- dvec3 center - The bounding sphere center.
- double radius - The bounding sphere radius.
WorldBoundSphere ( WorldBoundSphere bs ) #
Constructor. Initializes by given bounding sphere.Arguments
- WorldBoundSphere bs - The bounding sphere.
WorldBoundSphere ( WorldBoundBox bb ) #
Constructor. Initializes by given bounding box.Arguments
- WorldBoundBox bb - The bounding box.
WorldBoundSphere ( BoundSphere bs, dmat4 transform ) #
Initialization by the bounding sphere and setting the given transformation matrix to the new bounding sphere.Arguments
- BoundSphere bs - The bounding sphere.
- dmat4 transform - Transformation matrix.
void clear ( ) #
Clears the bounding sphere.void set ( dvec3 center, double radius ) #
Sets the bounding sphere by its center and radius.Arguments
- dvec3 center - The bounding sphere center.
- double radius - The bounding sphere radius.
void set ( WorldBoundSphere bs ) #
Sets the bounding sphere.Arguments
- WorldBoundSphere bs - The bounding sphere.
void set ( WorldBoundBox bb ) #
Sets the bounding sphere by the bounding box.Arguments
- WorldBoundBox bb - The bounding box.
void set ( BoundSphere bs, dmat4 transform ) #
Sets the bounding sphere by a bounding sphere with a transformation matrix taken into account.Arguments
- BoundSphere bs - The bounding sphere.
- dmat4 transform - Transformation matrix.
void expand ( dvec3 point ) #
Expands the current bounding sphere for including given point.Arguments
- dvec3 point - Point coordinates.
void expand ( WorldBoundSphere bs ) #
Expands the current bounding sphere for including given bounding sphere.Arguments
- WorldBoundSphere bs - The bounding sphere.
void expand ( WorldBoundBox bb ) #
Expands the current bounding sphere for including given bounding box.Arguments
- WorldBoundBox bb - The bounding box.
int inside ( dvec3 point ) #
Checks if the given point is inside the current bounding sphere.Arguments
- dvec3 point - Point coordinates.
Return value
1 if the given point is inside the bounding sphere; otherwise, 0.int inside ( dvec3 point, double radius ) #
Checks if the sphere is inside the bounding sphere.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 sphere; otherwise, 0.int inside ( dvec3 min, dvec3 max ) #
Checks if the box is inside the bounding sphere.Arguments
- dvec3 min - The box minimum coordinates.
- dvec3 max - The box maximum coordinates.
Return value
1 if the box is inside the bounding sphere; otherwise, 0.int inside ( WorldBoundSphere bs ) #
Checks if the specified bounding sphere is inside the current bounding sphere.Arguments
- WorldBoundSphere bs - The bounding sphere.
Return value
1 if the specified bounding sphere is inside the current bounding sphere; otherwise, 0.int inside ( WorldBoundBox bb ) #
Checks if the bounding box is inside the bounding sphere.Arguments
- WorldBoundBox bb - The bounding box.
Return value
1 if the bounding box is inside the bounding sphere; otherwise, 0.int insideAll ( WorldBoundSphere bs ) #
Checks if the whole specified bounding sphere is inside the current bounding sphere.Arguments
- WorldBoundSphere bs - The bounding sphere.
Return value
1 if the whole specified sphere is inside the current bounding sphere; otherwise, 0.int insideAll ( WorldBoundBox bb ) #
Checks if the whole bounding box is inside the bounding sphere.Arguments
- WorldBoundBox bb - The bounding box.
Return value
1 if the whole box is inside the bounding sphere; otherwise, 0.bool isValid ( ) #
Checks the bounding sphere status.Return value
1 if the bounding sphere radius has a positive value.dvec3 getCenter ( ) #
Gets the bounding sphere center.Return value
The bounding sphere center.double getRadius ( ) #
Gets the bounding sphere radius.Return value
The bounding sphere radius.Last update:
2020-07-31
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)