@nativewrappers/fivem 0.0.37 → 0.0.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/client/World.d.ts CHANGED
@@ -363,7 +363,8 @@ export declare abstract class World {
363
363
  * @returns {@see AsynchronousRaycastResult} object that must be awaited to get its results.
364
364
  */
365
365
  static raycast(start: Vector3, end: Vector3, losFlags?: IntersectFlags, shapeTestOptions?: number, ignoreEntity?: BaseEntity): AsynchronousRaycastResult;
366
- static raycastDirection(source: Vector3, direction: Vector3, maxDistance: number, losFlags?: IntersectFlags, shapeTestOptions?: number, ignoreEntity?: BaseEntity): AsynchronousRaycastResult;
366
+ static raycastDirection(useExpensiveRaycast: true, source: Vector3, direction: Vector3, maxDistance: number, losFlags?: IntersectFlags, shapeTestOptions?: number, ignoreEntity?: BaseEntity): SynchronousRaycastResult;
367
+ static raycastDirection(useExpensiveRaycast: false, source: Vector3, direction: Vector3, maxDistance: number, losFlags?: IntersectFlags, shapeTestOptions?: number, ignoreEntity?: BaseEntity): AsynchronousRaycastResult;
367
368
  /**
368
369
  * Cast a ray from the local players camera until it hits an entity
369
370
  *
package/client/World.js CHANGED
@@ -612,8 +612,11 @@ export class World {
612
612
  static raycast(start, end, losFlags = IntersectFlags.All, shapeTestOptions = SHAPE_TEST_DEFAULT, ignoreEntity) {
613
613
  return new AsynchronousRaycastResult(StartShapeTestLosProbe(start.x, start.y, start.z, end.x, end.y, end.z, losFlags, ignoreEntity?.Handle ?? 0, shapeTestOptions));
614
614
  }
615
- static raycastDirection(source, direction, maxDistance, losFlags = IntersectFlags.All, shapeTestOptions = SHAPE_TEST_DEFAULT, ignoreEntity) {
615
+ static raycastDirection(useExpensiveRaycast, source, direction, maxDistance, losFlags = IntersectFlags.All, shapeTestOptions = SHAPE_TEST_DEFAULT, ignoreEntity) {
616
616
  const target = Vector3.add(source, Vector3.multiply(direction, maxDistance));
617
+ if (useExpensiveRaycast) {
618
+ return new SynchronousRaycastResult(StartExpensiveSynchronousShapeTestLosProbe(source.x, source.y, source.z, target.x, target.y, target.z, losFlags, ignoreEntity?.Handle ?? 0, shapeTestOptions));
619
+ }
617
620
  return new AsynchronousRaycastResult(StartShapeTestLosProbe(source.x, source.y, source.z, target.x, target.y, target.z, losFlags, ignoreEntity?.Handle ?? 0, shapeTestOptions));
618
621
  }
619
622
  /**
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "author": "Remco Troost <d0p3t>",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
- "version": "0.0.37",
7
+ "version": "0.0.40",
8
8
  "publishConfig": {
9
9
  "directory": "lib"
10
10
  },