Skip to main content

ConicRay

ConicRay

Represents a direction vector+angle Mainly used inside particle systems for pick a motion direction at spawn

Kind: global class
Author: Alex Goldring
Copyright: Company Named Limited (c) 2025

conicRay.direction : Vector3

Must be normalized

Kind: instance property of ConicRay
Read only: true

conicRay.angle : number

Half-angle of the cone that is the angle between the center axis and the edge of the cone

Kind: instance property of ConicRay

conicRay.isConicRay : boolean

Kind: instance property of ConicRay
Read only: true

conicRay.toBinaryBuffer(buffer)

Kind: instance method of ConicRay

ParamType
bufferBinaryBuffer

conicRay.fromBinaryBuffer(buffer)

Kind: instance method of ConicRay

ParamType
bufferBinaryBuffer

conicRay.equals(other) ⇒ boolean

Kind: instance method of ConicRay

ParamType
otherConicRay

conicRay.roughlyEquals(other, [tolerance]) ⇒ boolean

Kind: instance method of ConicRay

ParamType
otherConicRay
[tolerance]number

conicRay.hash() ⇒ number

Kind: instance method of ConicRay

conicRay.copy(other)

Kind: instance method of ConicRay

ParamType
otherConicRay

conicRay.containsDirectionVector(v3) ⇒ boolean

Includes boundary matches

Kind: instance method of ConicRay

ParamType
v3Vector3

conicRay.sampleRandomDirection(random, result)

NOTE: Heavily based on a stackoverflow answer

Kind: instance method of ConicRay
See: https://stackoverflow.com/questions/38997302/create-random-unit-vector-inside-a-defined-conical-region/39003745#39003745

ParamType
randomfunction
resultVector3

ConicRay.typeName : string

Kind: static property of ConicRay
Read only: true

ConicRay.fromScalars(x, y, z, half_angle) ⇒ ConicRay

Kind: static method of ConicRay

ParamType
xnumber
ynumber
znumber
half_anglenumber