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
- instance
- .direction :
Vector3 - .angle :
number - .isConicRay :
boolean - .toBinaryBuffer(buffer)
- .fromBinaryBuffer(buffer)
- .equals(other) ⇒
boolean - .roughlyEquals(other, [tolerance]) ⇒
boolean - .hash() ⇒
number - .copy(other)
- .containsDirectionVector(v3) ⇒
boolean - .sampleRandomDirection(random, result)
- .direction :
- static
- .typeName :
string - .fromScalars(x, y, z, half_angle) ⇒
ConicRay
- .typeName :
- instance
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
| Param | Type |
|---|---|
| buffer | BinaryBuffer |
conicRay.fromBinaryBuffer(buffer)
Kind: instance method of ConicRay
| Param | Type |
|---|---|
| buffer | BinaryBuffer |
conicRay.equals(other) ⇒ boolean
Kind: instance method of ConicRay
| Param | Type |
|---|---|
| other | ConicRay |
conicRay.roughlyEquals(other, [tolerance]) ⇒ boolean
Kind: instance method of ConicRay
| Param | Type |
|---|---|
| other | ConicRay |
| [tolerance] | number |
conicRay.hash() ⇒ number
Kind: instance method of ConicRay
conicRay.copy(other)
Kind: instance method of ConicRay
| Param | Type |
|---|---|
| other | ConicRay |
conicRay.containsDirectionVector(v3) ⇒ boolean
Includes boundary matches
Kind: instance method of ConicRay
| Param | Type |
|---|---|
| v3 | Vector3 |
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
| Param | Type |
|---|---|
| random | function |
| result | Vector3 |
ConicRay.typeName : string
Kind: static property of ConicRay
Read only: true
ConicRay.fromScalars(x, y, z, half_angle) ⇒ ConicRay
Kind: static method of ConicRay
| Param | Type |
|---|---|
| x | number |
| y | number |
| z | number |
| half_angle | number |