Last updated

API / geotoolkit3d / scene / surface / contour / Ray / Ray

Class: Ray

contour.Ray.Ray

Contour Ray class
Ray is used to travese contour mesh and find intersections for building labels

Table of contents

Constructors
Methods

Contents

Constructors

new Ray(origin, direction, contourLevel)

new Ray(origin?, direction?, contourLevel?)

Parameters

Name Type Description
Optional originVector3The origin of Ray
Optional directionVector3The direction of Ray
Optional contourLevelnumberThe contour level that Ray is located at
Methods

at

at(distance, target): Vector3

Get a Vector3 that is a given distance along this Ray

Parameters

Name Type Description
distancenumberthe distance in float
targetVector3the target vector

Returns

Vector3

result vector


clone

clone(): Ray

Return a new Ray with the same origin and direction

Returns

Ray

this


copy

copy(ray): Ray

Copy the passed ray's properties to this ray

Parameters

Name Type Description
rayRaythe passed ray

Returns

Ray

this


getClassName

getClassName(): string

Returns

string


getContourLevel

getContourLevel(): number

Get contour level of this ray

Returns

number

elevation


getDirection

getDirection(): Vector3

Get the direction of ray

Returns

Vector3

direction


getOrigin

getOrigin(): Vector3

Get the origin of ray

Returns

Vector3

origin


intersectTriangle

intersectTriangle(a, b, c, backfaceCulling, target, normal): Vector3

Check if ray intersects the triangle // from http://www.geometrictools.com/GTEngine/Include/Mathematics/GteIntrRay3Triangle3.h

Parameters

Name Type Description
aVector3the first vertex in triangle
bVector3the second vertex in triangle
cVector3the third vertex in triangle
backfaceCullingbooleanif true then not checking the backface
targetVector3the target that stored possible intersection
normalVector3the normal of triangle

Returns

Vector3

intersected point


set

set(origin, direction): Ray

Set origin and direction for Ray

Parameters

Name Type Description
originVector3the origin of ray
directionVector3the direction of ray

Returns

Ray

this


getClassName

Static getClassName(): string

Returns

string