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
Copyright: "Company Named Limited"

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 In radians

Kind: instance property of ConicRay

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
tolerancenumber

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.fromScalars(x, y, z, angle) ⇒ ConicRay

Kind: static method of ConicRay

ParamType
xnumber
ynumber
znumber
anglenumber