This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
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
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Unigine.Geometry Class

This class is used to represent a collection of generic 3d math functions such as line plane intersection, closest points on two lines, etc.

Geometry Class

Members


void GetClosestPointOnLine ( dvec3 point, dvec3 p0, dvec3 p1, out dvec3 ret ) #

Scans the specified line segment and searches for the point closest to the reference point. The found point will be put to the return vector.

Arguments

  • dvec3 point - Reference point.
  • dvec3 p0 - Line start point.
  • dvec3 p1 - Line end point.
  • out dvec3 ret - Return vector.

void GetClosestPointOnLine ( vec3 point, vec3 p0, vec3 p1, out vec3 ret ) #

Scans the specified line segment and searches for the point closest to the reference point. The found point will be put to the return vector.

Arguments

  • vec3 point - Reference point.
  • vec3 p0 - Line start point.
  • vec3 p1 - Line end point.
  • out vec3 ret - Return vector.

int GetClosestPointOnTriangle ( dvec3 point, dvec3 v0, dvec3 v1, dvec3 v2, out dvec3 ret ) #

Scans the specified triangle and searches for the point closest to the reference point. The found point will be put to the return vector.

Arguments

  • dvec3 point - Reference point.
  • dvec3 v0 - The first vertex of the triangle.
  • dvec3 v1 - The second vertex of the triangle.
  • dvec3 v2 - The third vertex of the triangle.
  • out dvec3 ret - Return vector.

Return value

1 if the point is inside the triangle; otherwise, 0

int GetClosestPointOnTriangle ( vec3 point, vec3 v0, vec3 v1, vec3 v2, out vec3 ret ) #

Scans the specified triangle and searches for the point closest to the reference point. The found point will be put to the return vector.

Arguments

  • vec3 point - Reference point.
  • vec3 v0 - The first vertex of the triangle.
  • vec3 v1 - The second vertex of the triangle.
  • vec3 v2 - The third vertex of the triangle.
  • out vec3 ret - Return vector.

Return value

1 if the point is inside the triangle; otherwise, 0

int GetClosestPointsOnLines ( dvec3 p00, dvec3 p01, dvec3 p10, dvec3 p11, out dvec3 ret_0, out dvec3 ret_1 ) #

Scans the two specified lines and searches for the pair of closest points. The closest points of the first and the second lines will be put to the respective return vector.

Arguments

  • dvec3 p00 - Start point of the first line.
  • dvec3 p01 - End point of the first line.
  • dvec3 p10 - Start point of the second line.
  • dvec3 p11 - End point of the second line.
  • out dvec3 ret_0 - First return vector.
  • out dvec3 ret_1 - Second return vector.

Return value

1 if the lines cross; otherwise, 0

int GetClosestPointsOnLines ( vec3 p00, vec3 p01, vec3 p10, vec3 p11, out vec3 ret_0, out vec3 ret_1 ) #

Scans the two specified lines and searches for the pair of closest points. The closest points of the first and the second lines will be put to the respective return vectors.

Arguments

  • vec3 p00 - Start point of the first line.
  • vec3 p01 - End point of the first line.
  • vec3 p10 - Start point of the second line.
  • vec3 p11 - End point of the second line.
  • out vec3 ret_0 - First return vector.
  • out vec3 ret_1 - Second return vector.

Return value

1 if the lines cross; otherwise, 0

int IrayBoundBoxIntersection ( dvec3 point, dvec3 idirection, dvec3 min, dvec3 max ) #

Checks if there is an intersection between a ray and a bounding box. The same function as rayBoundBoxIntersection(), but it uses the inverse of the ray direction, which increases performance.

Arguments

  • dvec3 point - Starting point of the ray.
  • dvec3 idirection - Inverse direction of the ray.
  • dvec3 min - Min coordinates of the axis-aligned bounding box.
  • dvec3 max - Max coordinates of the axis-aligned bounding box.

Return value

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

int IrayBoundBoxIntersection ( vec3 point, vec3 idirection, vec3 min, vec3 max ) #

Checks if there is an intersection between a ray and a bounding box. The same function as rayBoundBoxIntersection(), but it uses the inverse of the ray direction, which increases performance.

Arguments

  • vec3 point - Starting point of the ray.
  • vec3 idirection - Inverse direction of the ray.
  • vec3 min - Min coordinates of the axis-aligned bounding box.
  • vec3 max - Max coordinates of the axis-aligned bounding box.

Return value

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

int LinePlaneIntersection ( vec3 p0, vec3 p1, vec4 plane ) #

Checks if there is an intersection between a line and a plane.

Arguments

  • vec3 p0 - Start point of the line.
  • vec3 p1 - End point of the line.
  • vec4 plane - Plane.

Return value

1 if the given line intersects the given plane; otherwise, 0.

int LinePlaneIntersection ( vec3 p0, vec3 p1, vec3 plane_point, vec3 plane_normal, out vec3 ret ) #

Calculates the intersection of a line and a plane. If the function returns 1, the point of intersection will be put to the return vector.

Arguments

  • vec3 p0 - Start point of the line.
  • vec3 p1 - End point of the line.
  • vec3 plane_point - Point of the plane.
  • vec3 plane_normal - Normal to the plane.
  • out vec3 ret - Return vector.

Return value

1 if the given line intersects the given plane; otherwise, 0.

int LinePlaneIntersection ( dvec3 p0, dvec3 p1, dvec3 plane_point, dvec3 plane_normal ) #

Checks if there is an intersection between a line and a plane.

Arguments

  • dvec3 p0 - Start point of the line.
  • dvec3 p1 - Start point of the line.
  • dvec3 plane_point - Point of the plane.
  • dvec3 plane_normal - Normal to the plane.

Return value

1 if the given line intersects the given plane; otherwise, 0.

int LinePlaneIntersection ( dvec3 p0, dvec3 p1, dvec3 plane_point, dvec3 plane_normal, out dvec3 ret ) #

Calculates the intersection of a line and a plane. If the function returns 1, the point of intersection will be put to the return vector.

Arguments

  • dvec3 p0 - Start point of the line.
  • dvec3 p1 - End point of the line.
  • dvec3 plane_point - Point of the plane.
  • dvec3 plane_normal - Normal to the plane.
  • out dvec3 ret - Return vector.

Return value

1 if the given line intersects the given plane; otherwise, 0.

int LinePlaneIntersection ( vec3 p0, vec3 p1, vec3 plane_point, vec3 plane_normal ) #

Checks if there is an intersection between a line and a plane.

Arguments

  • vec3 p0 - Start point of the line.
  • vec3 p1 - End point of the line.
  • vec3 plane_point - Point of the plane.
  • vec3 plane_normal - Normal to the plane.

Return value

1 if the given line intersects the given plane; otherwise, 0.

int LinePlaneIntersection ( dvec3 p0, dvec3 p1, dvec4 plane, out dvec3 ret ) #

Calculates the intersection of a line and a plane. If the function returns 1, the point of intersection will be put to the return vector.

Arguments

  • dvec3 p0 - Start point of the line.
  • dvec3 p1 - End point of the line.
  • dvec4 plane - Plane.
  • out dvec3 ret - Return vector.

Return value

1 if the given line intersects the given plane; otherwise, 0.

int LinePlaneIntersection ( vec3 p0, vec3 p1, vec4 plane, out vec3 ret ) #

Calculates the intersection of a line and a plane. If the function returns 1, the point of intersection will be put to the return vector.

Arguments

  • vec3 p0 - Start point of the line.
  • vec3 p1 - End point of the line.
  • vec4 plane - Plane.
  • out vec3 ret - Return vector.

Return value

1 if the given line intersects the given plane; otherwise, 0.

int LinePlaneIntersection ( dvec3 p0, dvec3 p1, dvec4 plane ) #

Checks if there is an intersection between a line and a plane.

Arguments

  • dvec3 p0 - Start point of the line.
  • dvec3 p1 - End point of the line.
  • dvec4 plane - Plane.

Return value

1 if the given line intersects the given plane; otherwise, 0.

float NormalizeAngle ( float angle ) #

Normalizes the angle in [-180, 180 ] range.

Arguments

  • float angle - Input angle.

Return value

Normalized angle, in degrees.

void OrthoBasis ( vec3 v, out vec3 tangent, out vec3 binormal ) #

Creates an ortho transformation. Output tangent and binormal vectors will be put to corresponding return vector.

Arguments

  • vec3 v - Input vector.
  • out vec3 tangent - Return vector.
  • out vec3 binormal - Return vector.

void OrthoBasis ( dvec3 v, out dvec3 tangent, out dvec3 binormal ) #

Creates an ortho transformation. Output tangent and binormal vectors will be put to corresponding return vectors.

Arguments

  • dvec3 v - Input vector.
  • out dvec3 tangent - Return vector.
  • out dvec3 binormal - Return vector.

quat OrthoTangent ( vec3 tangent, vec3 binormal, vec3 normal ) #

Creates the ortho triangle tangent space basis.

Arguments

  • vec3 tangent - Tangent vector.
  • vec3 binormal - Binormal vector.
  • vec3 normal - Normal vector.

Return value

Tangent basis.

quat OrthoTangent ( vec4 tangent, vec3 normal ) #

Creates the ortho triangle tangent space basis.

Arguments

  • vec4 tangent - Tangent vector.
  • vec3 normal - Normal vector.

Return value

Tangent basis.

void OrthoTransform ( dvec3 v, out dmat4 transform ) #

Creates an ortho transformation. The transformation will be put to the return matrix.

Arguments

  • dvec3 v - Input vector.
  • out dmat4 transform - Return matrix.

void OrthoTransform ( vec3 v, out mat4 transform ) #

Creates an ortho transformation. The transformation will be put to the return matrix.

Arguments

  • vec3 v - Input vector.
  • out mat4 transform - Return matrix.

float PointPolygonDistance ( vec3 point, vec3[] vertex, int[] indices, vec4 plane ) #

Returns the distance from a point to a polygon.

Arguments

  • vec3 point - Point.
  • vec3[] vertex - Pointer to vertex structure.
  • int[] indices - Array of vertex indices.
  • vec4 plane - Polygon plane.

Return value

Distance.

double PointPolygonDistance ( dvec3 point, dvec3[] vertex, int[] indices, dvec4 plane ) #

Returns the distance from a point to a polygon.

Arguments

  • dvec3 point - Point.
  • dvec3[] vertex - Pointer to vertex structure.
  • int[] indices - Array of vertex indices.
  • dvec4 plane - Polygon plane.

Return value

Distance.

int PointPolygonInside ( vec3 point, vec3[] vertex, int[] indices, vec3 normal ) #

Checks if a point is inside a polygon.

Arguments

  • vec3 point - Point.
  • vec3[] vertex - Pointer to vertex structure.
  • int[] indices - Array of vertex indices.
  • vec3 normal - Normal to the polygon plane.

Return value

1 if the point is inside the given polygon; otherwise, 0.

int PointPolygonInside ( dvec3 point, dvec3[] vertex, int[] indices, dvec3 normal ) #

Checks if a point is inside a polygon.

Arguments

  • dvec3 point - Point.
  • dvec3[] vertex - Pointer to vertex structure.
  • int[] indices - Array of vertex indices.
  • dvec3 normal - Normal to the polygon plane.

Return value

1 if the point is inside the given polygon; otherwise, 0.

void PointTriangleCoordinates ( vec3 point, vec3 v0, vec3 v1, vec3 v2, out float a, out float b ) #

Calculates barycentric triangle coordinates. The coordinates will be put to corresponding return variables.

Arguments

  • vec3 point - Point.
  • vec3 v0 - The first vertex of the triangle.
  • vec3 v1 - The second vertex of the triangle.
  • vec3 v2 - The third vertex of the triangle.
  • out float a - Return variable.
  • out float b - Return variable.

void PointTriangleCoordinates ( dvec3 point, dvec3 v0, dvec3 v1, dvec3 v2, out double a, out double b ) #

Calculates barycentric triangle coordinates. The coordinates will be put to corresponding return variables.

Arguments

  • dvec3 point - Point.
  • dvec3 v0 - The first vertex of the triangle.
  • dvec3 v1 - The second vertex of the triangle.
  • dvec3 v2 - The third vertex of the triangle.
  • out double a - Return variable.
  • out double b - Return variable.

double PointTriangleDistance ( dvec3 point, dvec3 v0, dvec3 v1, dvec3 v2, dvec4 plane ) #

Returns the closest distance from a point to a triangle.

Arguments

  • dvec3 point - Point.
  • dvec3 v0 - The first vertex of the triangle.
  • dvec3 v1 - The second vertex of the triangle.
  • dvec3 v2 - The third vertex of the triangle.
  • dvec4 plane - Triangle plane.

Return value

Distance.

float PointTriangleDistance ( vec3 point, vec3 v0, vec3 v1, vec3 v2, vec4 plane ) #

Returns the closest distance from a point to a triangle.

Arguments

  • vec3 point - Point.
  • vec3 v0 - The first vertex of the triangle.
  • vec3 v1 - The second vertex of the triangle.
  • vec3 v2 - The third vertex of the triangle.
  • vec4 plane - Triangle plane.

Return value

Distance.

int PointTriangleInside ( vec3 point, vec3 v0, vec3 v1, vec3 v2, vec3 normal ) #

Checks if a point is inside a triangle.

Arguments

  • vec3 point - Point.
  • vec3 v0 - The first vertex of the triangle.
  • vec3 v1 - The second vertex of the triangle.
  • vec3 v2 - The third vertex of the triangle.
  • vec3 normal - Normal to the triangle plane.

Return value

1 if the point is inside the given triangle; otherwise, 0.

int PointTriangleInside ( dvec3 point, dvec3 v0, dvec3 v1, dvec3 v2, dvec3 normal ) #

Checks if a point is inside a triangle.

Arguments

  • dvec3 point - Point.
  • dvec3 v0 - The first vertex of the triangle.
  • dvec3 v1 - The second vertex of the triangle.
  • dvec3 v2 - The third vertex of the triangle.
  • dvec3 normal - Normal to the triangle plane.

Return value

1 if the point is inside the given triangle; otherwise, 0.

int PointTriangleInside ( dvec3 point, dvec3 v0, dvec3 v1, dvec3 v2 ) #

Checks if a point is inside a triangle.

Arguments

  • dvec3 point - Point.
  • dvec3 v0 - The first vertex of the triangle.
  • dvec3 v1 - The second vertex of the triangle.
  • dvec3 v2 - The third vertex of the triangle.

Return value

1 if the point is inside the given triangle; otherwise, 0.

int PointTriangleInside ( vec3 point, vec3 v0, vec3 v1, vec3 v2 ) #

Checks if a point is inside a triangle.

Arguments

  • vec3 point - Point.
  • vec3 v0 - The first vertex of the triangle.
  • vec3 v1 - The second vertex of the triangle.
  • vec3 v2 - The third vertex of the triangle.

Return value

1 if the point is inside the given triangle; otherwise, 0.

vec4 PolygonPlane ( vec3[] vertex, int[] indices ) #

Returns the polygon plane.

Arguments

  • vec3[] vertex - Pointer to vertex structure.
  • int[] indices - Array of vertex indices.

Return value

Polygon plane.

dvec4 PolygonPlane ( dvec3[] vertex, int[] indices ) #

Returns the polygon plane.

Arguments

  • dvec3[] vertex - Pointer to vertex structure.
  • int[] indices - Array of vertex indices.

Return value

Polygon plane.

vec3 ProjectOntoPlane ( vec3 v, vec3 plane_normal ) #

Calculates the projection of a vector onto a given plane.

Arguments

  • vec3 v - Input vector.
  • vec3 plane_normal - Normal to the plane.

Return value

Projection of the input vector onto the plane.

dvec3 ProjectOntoPlane ( dvec3 v, dvec3 plane_normal ) #

Calculates the projection of a vector onto a given plane.

Arguments

  • dvec3 v - Input vector.
  • dvec3 plane_normal - Normal to the plane.

Return value

Projection of the input vector onto the plane.

int RayBoundBoxIntersection ( dvec3 point, dvec3 direction, dvec3 min, dvec3 max ) #

Checks if a ray intersects a bounding box. The same function as irayBoundBoxIntersection(), but the latter has higher performance due to reduction of division operations, as the ray direction is replaced by the pre-calculated inverse of the ray direction.

Arguments

  • dvec3 point - Starting point of the ray.
  • dvec3 direction - Direction of the ray.
  • dvec3 min - Min coordinates of the axis-aligned bounding box.
  • dvec3 max - Max coordinates of the axis-aligned bounding box.

Return value

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

int RayBoundBoxIntersection ( vec3 point, vec3 direction, vec3 min, vec3 max ) #

Checks if a ray intersects a bounding box. The same function as irayBoundBoxIntersection(), but the latter has higher performance due to reduction of division operations, as the ray direction is replaced by the pre-calculated inverse of the ray direction.

Arguments

  • vec3 point - Starting point of the ray.
  • vec3 direction - Direction of the ray.
  • vec3 min - Min coordinates of the axis-aligned bounding box.
  • vec3 max - Max coordinates of the axis-aligned bounding box.

Return value

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

int RayPlaneIntersection ( vec3 point, vec3 direction, vec4 plane ) #

Checks if a ray intersects a plane.

Arguments

  • vec3 point - Starting point of the ray.
  • vec3 direction - Direction of the ray.
  • vec4 plane - Plane.

Return value

1 if the given ray intersects the given plane; otherwise, 0.

int RayPlaneIntersection ( vec3 point, vec3 direction, vec3 plane_point, vec3 plane_normal ) #

Checks if a ray intersects a plane.

Arguments

  • vec3 point - Starting point of the ray.
  • vec3 direction - Direction of the ray.
  • vec3 plane_point - Point on the plane.
  • vec3 plane_normal - Normal to the plane.

Return value

1 if the given ray intersects the given plane; otherwise, 0.

int RayPlaneIntersection ( dvec3 point, dvec3 direction, dvec4 plane, out dvec3 ret ) #

Calculates the intersection of a ray and a plane. If the function returns 1, the point of intersection will be put to the return vector.

Arguments

  • dvec3 point - Starting point of the ray.
  • dvec3 direction - Direction of the ray.
  • dvec4 plane - Plane.
  • out dvec3 ret - Return vector.

Return value

1 if the given ray intersects the given plane; otherwise, 0.

int RayPlaneIntersection ( vec3 point, vec3 direction, vec3 plane_point, vec3 plane_normal, out vec3 ret ) #

Calculates the intersection of a ray and a plane. If the function returns 1, the point of intersection will be put to the return vector.

Arguments

  • vec3 point - Starting point of the ray.
  • vec3 direction - Direction of the ray.
  • vec3 plane_point - Point on the plane.
  • vec3 plane_normal - Normal to the plane.
  • out vec3 ret - Return vector.

Return value

1 if the given ray intersects the given plane; otherwise, 0.

int RayPlaneIntersection ( vec3 point, vec3 direction, vec4 plane, out vec3 ret ) #

Calculates the intersection of a ray and a plane. If the function returns 1, the point of intersection will be put to the return vector.

Arguments

  • vec3 point - Starting point of the ray.
  • vec3 direction - Direction of the ray.
  • vec4 plane - Plane.
  • out vec3 ret - Return vector.

Return value

1 if the given ray intersects the given plane; otherwise, 0.

int RayPlaneIntersection ( dvec3 point, dvec3 direction, dvec3 plane_point, dvec3 plane_normal ) #

Checks if a ray intersects a plane.

Arguments

  • dvec3 point - Starting point of the ray.
  • dvec3 direction - Direction of the ray.
  • dvec3 plane_point - Point on the plane.
  • dvec3 plane_normal - Normal to the plane.

Return value

1 if the given ray intersects the given plane; otherwise, 0.

int RayPlaneIntersection ( dvec3 point, dvec3 direction, dvec3 plane_point, dvec3 plane_normal, out dvec3 ret ) #

Calculates the intersection of a ray and a plane. If the function returns 1, the point of intersection will be put to the return vector.

Arguments

  • dvec3 point - Starting point of the ray.
  • dvec3 direction - Direction of the ray.
  • dvec3 plane_point - Point on the plane.
  • dvec3 plane_normal - Normal to the plane.
  • out dvec3 ret - Return vector.

Return value

1 if the given ray intersects the given plane; otherwise, 0.

int RayPlaneIntersection ( dvec3 point, dvec3 direction, dvec4 plane ) #

Checks if a ray intersects a plane.

Arguments

  • dvec3 point - Starting point of the ray.
  • dvec3 direction - Direction of the ray.
  • dvec4 plane - Plane.

Return value

1 if the given ray intersects the given plane; otherwise, 0.

int RayTriangleIntersection ( vec3 point, vec3 direction, vec3 v0, vec3 v1, vec3 v2 ) #

Checks if a ray intersects a triangle.

Arguments

  • vec3 point - Starting point of the ray.
  • vec3 direction - Direction of the ray.
  • vec3 v0 - The first triangle vertex.
  • vec3 v1 - The second triangle vertex.
  • vec3 v2 - The third triangle vertex.

Return value

1 if the given ray intersects the given triangle; otherwise, 0.

int RayTriangleIntersection ( dvec3 point, dvec3 direction, dvec3 v0, dvec3 v1, dvec3 v2 ) #

Checks if a ray intersects a triangle.

Arguments

  • dvec3 point - Starting point of the ray.
  • dvec3 direction - Direction of the ray.
  • dvec3 v0 - The first triangle vertex.
  • dvec3 v1 - The second triangle vertex.
  • dvec3 v2 - The third triangle vertex.

Return value

1 if the given ray intersects the given triangle; otherwise, 0.

int SegmentPlaneIntersection ( vec3 p0, vec3 p1, vec4 plane, out vec3 ret ) #

Calculates the intersection of a segment and a plane. If the function returns 1, the point of intersection will be put to the return vector.

Arguments

  • vec3 p0 - Start point of the line segment.
  • vec3 p1 - End point of the line segment.
  • vec4 plane - Plane.
  • out vec3 ret - Return vector.

Return value

1 if the given ray intersects the given triangle; otherwise, 0.

int SegmentPlaneIntersection ( vec3 p0, vec3 p1, vec3 plane_point, vec3 plane_normal ) #

Checks if a segment intersects a plane.

Arguments

  • vec3 p0 - Start point of the line segment.
  • vec3 p1 - End point of the line segment.
  • vec3 plane_point - Point on the plane.
  • vec3 plane_normal - Normal to the plane.

Return value

1 if the given segment intersects the given plane; otherwise, 0.

int SegmentPlaneIntersection ( vec3 p0, vec3 p1, vec4 plane ) #

Checks if a segment intersects a plane.

Arguments

  • vec3 p0 - Start point of the line segment.
  • vec3 p1 - End point of the line segment.
  • vec4 plane - Plane.

Return value

1 if the given segment intersects the given plane; otherwise, 0.

int SegmentPlaneIntersection ( vec3 p0, vec3 p1, vec3 plane_point, vec3 plane_normal, out vec3 ret ) #

Calculates the intersection of a line segment and a plane. If the function returns 1, the point of intersection will be put to the return vector.

Arguments

  • vec3 p0 - Start point of the line segment.
  • vec3 p1 - End point of the line segment.
  • vec3 plane_point - Point on the plane.
  • vec3 plane_normal - Normal to the plane.
  • out vec3 ret - Return vector.

Return value

1 if the given segment intersects the given plane; otherwise, 0.

int SegmentPlaneIntersection ( dvec3 p0, dvec3 p1, dvec4 plane ) #

Checks if a segment intersects a plane.

Arguments

  • dvec3 p0 - Start point of the line segment.
  • dvec3 p1 - End point of the line segment.
  • dvec4 plane - Plane.

Return value

1 if the given segment intersects the given plane; otherwise, 0.

int SegmentPlaneIntersection ( dvec3 p0, dvec3 p1, dvec3 plane_point, dvec3 plane_normal ) #

Checks if a segment intersects a plane.

Arguments

  • dvec3 p0 - Start point of the line segment.
  • dvec3 p1 - End point of the line segment.
  • dvec3 plane_point - Point on the plane.
  • dvec3 plane_normal - Normal to the plane.

Return value

1 if the given segment intersects the given plane; otherwise, 0.

int SegmentPlaneIntersection ( dvec3 p0, dvec3 p1, dvec4 plane, out dvec3 ret ) #

Calculates the intersection of a line segment and a plane. If the function returns 1, the point of intersection will be put to the return vector.

Arguments

  • dvec3 p0 - Start point of the line segment.
  • dvec3 p1 - End point of the line segment.
  • dvec4 plane - Plane.
  • out dvec3 ret - Return vector.

Return value

1 if the given segment intersects the given plane; otherwise, 0.

int SegmentPlaneIntersection ( dvec3 p0, dvec3 p1, dvec3 plane_point, dvec3 plane_normal, out dvec3 ret ) #

Calculates the intersection of a line segment and a plane. If the function returns 1, the point of intersection will be put to the return vector.

Arguments

  • dvec3 p0 - Start point of the line segment.
  • dvec3 p1 - End point of the line segment.
  • dvec3 plane_point - Point on the plane.
  • dvec3 plane_normal - Normal to the plane.
  • out dvec3 ret - Return vector.

Return value

1 if the given segment intersects the given plane; otherwise, 0.

double TriangleArea ( dvec3 v0, dvec3 v1, dvec3 v2 ) #

Returns the triangle area.

Arguments

  • dvec3 v0 - The first triangle vertex.
  • dvec3 v1 - The second triangle vertex.
  • dvec3 v2 - The third triangle vertex.

Return value

Triangle area.

float TriangleArea ( vec3 v0, vec3 v1, vec3 v2 ) #

Returns the triangle area.

Arguments

  • vec3 v0 - The first triangle vertex.
  • vec3 v1 - The second triangle vertex.
  • vec3 v2 - The third triangle vertex.

Return value

Triangle area.

dvec3 TriangleNormal ( dvec3 v0, dvec3 v1, dvec3 v2 ) #

Returns the triangle normal vector.

Arguments

  • dvec3 v0 - The first triangle vertex.
  • dvec3 v1 - The second triangle vertex.
  • dvec3 v2 - The third triangle vertex.

Return value

Triangle normal vector.

vec3 TriangleNormal ( vec3 v0, vec3 v1, vec3 v2 ) #

Returns the triangle normal vector.

Arguments

  • vec3 v0 - The first triangle vertex.
  • vec3 v1 - The second triangle vertex.
  • vec3 v2 - The third triangle vertex.

Return value

Triangle normal vector.

vec4 TrianglePlane ( vec3 v0, vec3 v1, vec3 v2 ) #

Returns the triangle plane.

Arguments

  • vec3 v0 - The first triangle vertex.
  • vec3 v1 - The second triangle vertex.
  • vec3 v2 - The third triangle vertex.

Return value

Triangle plane.

dvec4 TrianglePlane ( dvec3 v0, dvec3 v1, dvec3 v2 ) #

Returns the triangle plane.

Arguments

  • dvec3 v0 - The first triangle vertex.
  • dvec3 v1 - The second triangle vertex.
  • dvec3 v2 - The third triangle vertex.

Return value

Triangle plane.

vec4 TriangleTangent ( vec3 v0, vec3 v1, vec3 v2, vec2 t0, vec2 t1, vec2 t2 ) #

Returns the triangle tangent space.

Arguments

  • vec3 v0 - The first triangle vertex.
  • vec3 v1 - The second triangle vertex.
  • vec3 v2 - The third triangle vertex.
  • vec2 t0 - Tangent vector of the first triangle vertex.
  • vec2 t1 - Tangent vector of the second triangle vertex.
  • vec2 t2 - Tangent vector of the third triangle vertex.

Return value

Triangle tangent space vector.

vec4 TriangleTangent ( vec3 v0, vec3 v1, vec3 v2, vec2 t0, vec2 t1, vec2 t2, vec3 normal ) #

Returns the triangle tangent space.

Arguments

  • vec3 v0 - The first triangle vertex.
  • vec3 v1 - The second triangle vertex.
  • vec3 v2 - The third triangle vertex.
  • vec2 t0 - Tangent vector of the first triangle vertex.
  • vec2 t1 - Tangent vector of the second triangle vertex.
  • vec2 t2 - Tangent vector of the third triangle vertex.
  • vec3 normal - Normal.

Return value

Triangle tangent space vector.

vec4 TriangleTangent ( vec3 v0, vec3 v1, vec3 v2 ) #

Returns the triangle tangent space.

Arguments

  • vec3 v0 - The first triangle vertex.
  • vec3 v1 - The second triangle vertex.
  • vec3 v2 - The third triangle vertex.

Return value

Triangle tangent space vector.
Last update: 2022-12-14
Build: ()