Utils / QueryUtil
QueryUtil Class 
Radiographic detect tools
Table of contents 
Methods 
boxOverlap(boxCenter: Vector, boxExtent: Vector, drawDebug?: boolean, objectsToIgnore?: string[], ignoreByType?: boolean, source?: GameObject): GameObject[] other | 
|---|
| Rectangular range detection | 
boxTrace(start: Vector, end: Vector, halfSize: Vector, orientation: Rotation, multiTrace?: boolean, drawDebug?: boolean, objectsToIgnore?: string[], ignoreByType?: boolean, source?: GameObject): HitResult[] other | 
| Box body radiographic testing | 
capsuleOverlap(capsuleCenter: Vector, radius: number, halfHeight: number, drawDebug?: boolean, objectsToIgnore?: string[], ignoreByType?: boolean, source?: GameObject): GameObject[] other | 
| Capsule body range detect | 
capsuleTrace(start: Vector, end: Vector, radius: number, halfHeight: number, multiTrace?: boolean, drawDebug?: boolean, objectsToIgnore?: string[], ignoreByType?: boolean, source?: GameObject): HitResult[] other | 
| Radiographic detect of capsule body | 
lineTrace(start: Vector, end: Vector, multiTrace?: boolean, drawDebug?: boolean, objectsToIgnore?: string[], ignoreByType?: boolean, traceSkeletonOnly?: boolean, source?: GameObject): HitResult[] other | 
| Radiographic testing | 
sphereOverlap(sphereCenter: Vector, sphereRadius: number, drawDebug?: boolean, objectsToIgnore?: string[], ignoreByType?: boolean, source?: GameObject): GameObject[] other | 
| Spherical range detect | 
sphereTrace(start: Vector, end: Vector, radius: number, multiTrace?: boolean, drawDebug?: boolean, objectsToIgnore?: string[], ignoreByType?: boolean, source?: GameObject): HitResult[] other | 
| Spherical radiographic testing | 
Methods 
boxOverlap 
• Static boxOverlap(boxCenter, boxExtent, drawDebug?, objectsToIgnore?, ignoreByType?, source?): GameObject[] other
Rectangular range detection
Parameters 
boxCenter Vector | Usage: Center position of rectangle | 
|---|---|
boxExtent Vector | Usage: Size of the box body | 
drawDebug? boolean | Usage: Visualize drawing default: false | 
objectsToIgnore? string[] | Usage: Block object's UUID array default: [] range: Unrestricted | 
ignoreByType? boolean | Usage: Do you want to block based on the type of the incoming object? Default: false | 
source? GameObject | Usage: Object initiating detection (detection source does not participate in detection) default: null | 
Returns 
GameObject[] | GameObject array | 
|---|
Usage example: The following example shows the basic process of using rectangle range detect
const goList = QueryUtil.boxOverlap(new mw.Vector(0,0,0), new mw.Vector(1000,0,0), true);
for (const item of goList) {
    // item: Detect Objects
}const goList = QueryUtil.boxOverlap(new mw.Vector(0,0,0), new mw.Vector(1000,0,0), true);
for (const item of goList) {
    // item: Detect Objects
}boxTrace 
• Static boxTrace(start, end, halfSize, orientation, multiTrace?, drawDebug?, objectsToIgnore?, ignoreByType?, source?): HitResult[] other
Box body radiographic testing
Parameters 
start Vector | Usage: start position | 
|---|---|
end Vector | Usage: End position | 
halfSize Vector | Usage: Box half length, width, and height | 
orientation Rotation | Usage: Box orientation | 
multiTrace? boolean | Usage: Whether to penetrate detect default: false | 
drawDebug? boolean | Usage: Visualize drawing default: false | 
objectsToIgnore? string[] | Usage: Block object guided array default: [] range: No restrictions | 
ignoreByType? boolean | Usage: Do you want to block based on the type of the incoming object? Default: false | 
source? GameObject | Usage: Object initiating detection (detection source does not participate in detection) default: null | 
Returns 
HitResult[] | HitResult array | 
|---|
Usage example: The following example shows the basic process of using box ray detect
const ResultList = QueryUtil.boxTrace(new mw.Vector(0,0,0), new mw.Vector(300,0,0), new mw.Vector(10,10,10), new mw.Rotation(0,0,0), true, false, [], false, gameObject);
for (const item of ResultList) {
    // item: Detect Objects
}const ResultList = QueryUtil.boxTrace(new mw.Vector(0,0,0), new mw.Vector(300,0,0), new mw.Vector(10,10,10), new mw.Rotation(0,0,0), true, false, [], false, gameObject);
for (const item of ResultList) {
    // item: Detect Objects
}capsuleOverlap 
• Static capsuleOverlap(capsuleCenter, radius, halfHeight, drawDebug?, objectsToIgnore?, ignoreByType?, source?): GameObject[] other
Capsule body range detect
Parameters 
capsuleCenter Vector | Usage: Center position of capsule body | 
|---|---|
radius number | Usage: Capsule body radius range: No restrictions, but please use an appropriate radius scale. Type: Floating point type | 
halfHeight number | Usage: Half height range of capsule body: No limit, but please use an appropriate scale. Type: Floating point type | 
drawDebug? boolean | Usage: Visualize drawing default: false | 
objectsToIgnore? string[] | Usage: Block object's UUID array default: [] range: Unrestricted | 
ignoreByType? boolean | Usage: Do you want to block based on the type of the incoming object? Default: false | 
source? GameObject | Usage: Object initiating detection (detection source does not participate in detection) default: null | 
Returns 
GameObject[] | GameObject array | 
|---|
Usage example: The following example shows the basic process of using cylinder range detect
const ResultList = QueryUtil.capsuleOverlap(new mw.Vector(0,0,0), 100, false, [], false, gameObject);
for (const item of ResultList) {
    // item: Detect Objects
}const ResultList = QueryUtil.capsuleOverlap(new mw.Vector(0,0,0), 100, false, [], false, gameObject);
for (const item of ResultList) {
    // item: Detect Objects
}capsuleTrace 
• Static capsuleTrace(start, end, radius, halfHeight, multiTrace?, drawDebug?, objectsToIgnore?, ignoreByType?, source?): HitResult[] other
Radiographic detect of capsule body
Parameters 
start Vector | Usage: start position | 
|---|---|
end Vector | Usage: End position | 
radius number | Usage: Capsule body radius range: No restrictions, but please use an appropriate radius scale. Type: Floating point type | 
halfHeight number | Usage: Half height range of capsule body: No limit, but please use an appropriate scale. Type: Floating point type | 
multiTrace? boolean | Usage: Whether to penetrate detect default: false | 
drawDebug? boolean | Usage: Visualize drawing default: false | 
objectsToIgnore? string[] | Usage: Block object guided array default: [] range: No restrictions | 
ignoreByType? boolean | Usage: Do you want to block based on the type of the incoming object? Default: false | 
source? GameObject | Usage: Object initiating detection (detection source does not participate in detection) default: null | 
Returns 
HitResult[] | HitResult array | 
|---|
Usage example: The following example demonstrates the basic process of using capsule body X-ray detection
const ResultList = QueryUtil.capsuleTrace(new mw.Vector(0,0,0), new mw.Vector(300,0,0), 5, 10, true, false, [], false, gameObject);
for (const item of ResultList) {
    // item: Detect Objects
}const ResultList = QueryUtil.capsuleTrace(new mw.Vector(0,0,0), new mw.Vector(300,0,0), 5, 10, true, false, [], false, gameObject);
for (const item of ResultList) {
    // item: Detect Objects
}lineTrace 
• Static lineTrace(start, end, multiTrace?, drawDebug?, objectsToIgnore?, ignoreByType?, traceSkeletonOnly?, source?): HitResult[] other
Radiographic testing
Parameters 
start Vector | Usage: start position | 
|---|---|
end Vector | Usage: End position | 
multiTrace? boolean | Usage: Whether to penetrate detect default: false | 
drawDebug? boolean | Usage: Visualize drawing default: false | 
objectsToIgnore? string[] | Usage: Block object guided array default: [] range: No restrictions | 
ignoreByType? boolean | Usage: Do you want to block based on the type of the incoming object? Default: false | 
traceSkeletonOnly? boolean | Usage: whether to perform detect on specific parts default: false | 
source? GameObject | Usage: Object initiating detection (detection source does not participate in detection) default: null | 
Returns 
HitResult[] | HitResult array | 
|---|
Usage example: The following example demonstrates the basic process of using radiographic testing
const ResultList = QueryUtil.lineTrace(new mw.Vector(0,0,0), new mw.Vector(300,0,0), true, false, [], false, gameObject, false);
for (const item of ResultList) {
    // item: Detect Objects
}const ResultList = QueryUtil.lineTrace(new mw.Vector(0,0,0), new mw.Vector(300,0,0), true, false, [], false, gameObject, false);
for (const item of ResultList) {
    // item: Detect Objects
}sphereOverlap 
• Static sphereOverlap(sphereCenter, sphereRadius, drawDebug?, objectsToIgnore?, ignoreByType?, source?): GameObject[] other
Spherical range detect
Parameters 
sphereCenter Vector | Usage: Center position of sphere | 
|---|---|
sphereRadius number | Usage: Sphere radius range: No restrictions, but please use an appropriate radius scale. Type: Floating point type | 
drawDebug? boolean | Usage: Visualize drawing default: false | 
objectsToIgnore? string[] | Usage: Block object's UUID array default: [] range: Unrestricted | 
ignoreByType? boolean | Usage: Do you want to block based on the type of the incoming object? Default: false | 
source? GameObject | Usage: Object initiating detection (detection source does not participate in detection) default: null | 
Returns 
GameObject[] | GameObject array | 
|---|
Usage example: The following example shows the basic process of detect using spherical range
const ResultList = QueryUtil.sphereOverlap(new mw.Vector(0,0,0), 100, false, [], false, gameObject);
for (const item of ResultList) {
    // item: Detect Objects
}const ResultList = QueryUtil.sphereOverlap(new mw.Vector(0,0,0), 100, false, [], false, gameObject);
for (const item of ResultList) {
    // item: Detect Objects
}sphereTrace 
• Static sphereTrace(start, end, radius, multiTrace?, drawDebug?, objectsToIgnore?, ignoreByType?, source?): HitResult[] other
Spherical radiographic testing
Parameters 
start Vector | Usage: start position | 
|---|---|
end Vector | Usage: End position | 
radius number | Usage: Sphere radius range: [0,+∞] However, please use an appropriate radius scale. Type: Floating point type | 
multiTrace? boolean | Usage: Whether to penetrate detect default: false | 
drawDebug? boolean | Usage: Visualize drawing default: false | 
objectsToIgnore? string[] | Usage: Block object guided array default: [] range: No restrictions | 
ignoreByType? boolean | Usage: Do you want to block based on the type of the incoming object? Default: false | 
source? GameObject | Usage: Object initiating detection (detection source does not participate in detection) default: null | 
Returns 
HitResult[] | HitResult array | 
|---|
Usage example: The following example shows the basic process of using sphere ray detect
const ResultList = QueryUtil.sphereTrace(new mw.Vector(0,0,0), new mw.Vector(300,0,0), 5, true, false, [], false, gameObject);
for (const item of ResultList) {
    // item: Detect Objects
}const ResultList = QueryUtil.sphereTrace(new mw.Vector(0,0,0), new mw.Vector(300,0,0), 5, true, false, [], false, gameObject);
for (const item of ResultList) {
    // item: Detect Objects
}
Editor API