@nativewrappers/fivem 0.0.32 → 0.0.34

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/Raycast.js CHANGED
@@ -33,7 +33,7 @@ class RaycastResult {
33
33
  * Whether the entity hit exists.
34
34
  */
35
35
  get DidHitEntity() {
36
- return this.entityHandleArg?.Handle !== 0;
36
+ return this.entityHandleArg !== null && this.entityHandleArg.Handle !== 0;
37
37
  }
38
38
  /**
39
39
  * Material type that was hit.
@@ -136,7 +136,7 @@ export declare class BaseEntity {
136
136
  * @param offset: the amount to offset from the entity
137
137
  * @returns the offset position from the entity in world coords
138
138
  */
139
- getAbsolutePositionOffset(worldCoords: Vector3): Vector3;
139
+ getOffsetInRelativeCoords(worldCoords: Vector3): Vector3;
140
140
  /**
141
141
  * @example
142
142
  * ```typescript
@@ -153,13 +153,13 @@ export declare class BaseEntity {
153
153
  * @param worldCoords: the offset given the world coords
154
154
  * @returns the offset position from the entity in relative coords
155
155
  */
156
- getRelativePositionOffset(offset: Vector3): Vector3;
156
+ getOffsetInWorldCoords(offset: Vector3): Vector3;
157
157
  /**
158
- * @deprecated use [[getAbsolutePositionOffset]] instead
158
+ * @deprecated use [[getOffsetInRelativeCoords]] instead
159
159
  */
160
160
  getPositionOffset(worldCoords: Vector3): Vector3;
161
161
  /**
162
- * @deprecated use [[getRelativePositionOffset]]
162
+ * @deprecated use [[getOffsetInWorldCoords]]
163
163
  */
164
164
  getOffsetPosition(offset: Vector3): Vector3;
165
165
  attachTo(entity: BaseEntity, position: Vector3, rotation: Vector3, collisions?: boolean, unk9?: boolean, useSoftPinning?: boolean, rotationOrder?: number): void;
@@ -366,7 +366,7 @@ export class BaseEntity {
366
366
  * @param offset: the amount to offset from the entity
367
367
  * @returns the offset position from the entity in world coords
368
368
  */
369
- getAbsolutePositionOffset(worldCoords) {
369
+ getOffsetInRelativeCoords(worldCoords) {
370
370
  return Vector3.fromArray(GetOffsetFromEntityGivenWorldCoords(this.handle, worldCoords.x, worldCoords.y, worldCoords.z));
371
371
  }
372
372
  // TODO: Better example
@@ -386,20 +386,20 @@ export class BaseEntity {
386
386
  * @param worldCoords: the offset given the world coords
387
387
  * @returns the offset position from the entity in relative coords
388
388
  */
389
- getRelativePositionOffset(offset) {
389
+ getOffsetInWorldCoords(offset) {
390
390
  return Vector3.fromArray(GetOffsetFromEntityInWorldCoords(this.handle, offset.x, offset.y, offset.z));
391
391
  }
392
392
  /**
393
- * @deprecated use [[getAbsolutePositionOffset]] instead
393
+ * @deprecated use [[getOffsetInRelativeCoords]] instead
394
394
  */
395
395
  getPositionOffset(worldCoords) {
396
- return this.getAbsolutePositionOffset(worldCoords);
396
+ return this.getOffsetInRelativeCoords(worldCoords);
397
397
  }
398
398
  /**
399
- * @deprecated use [[getRelativePositionOffset]]
399
+ * @deprecated use [[getOffsetInWorldCoords]]
400
400
  */
401
401
  getOffsetPosition(offset) {
402
- return this.getRelativePositionOffset(offset);
402
+ return this.getOffsetInWorldCoords(offset);
403
403
  }
404
404
  attachTo(entity, position, rotation, collisions = false, unk9 = true, useSoftPinning = true, rotationOrder = 1) {
405
405
  if (this.handle == entity.Handle) {
@@ -149,6 +149,13 @@ export declare class Vector {
149
149
  * @returns A new vector resulting from the operation.
150
150
  */
151
151
  private static operateAbsolute;
152
+ /**
153
+ * Adds two vectors or a scalar value to a vector.
154
+ * @param a - The first vector or scalar value.
155
+ * @param b - The second vector or scalar value.
156
+ * @returns A new vector with incremented components.
157
+ */
158
+ static addAbsolute<T extends VectorType, U extends VectorLike>(this: T, a: U, b: VectorLike | number): U;
152
159
  /**
153
160
  * Subtracts one vector from another or subtracts a scalar value from a vector.
154
161
  * @param a - The vector.
@@ -272,6 +279,10 @@ export declare class Vector {
272
279
  * @see Vector.divide
273
280
  */
274
281
  divide(v: VectorLike | number): this;
282
+ /**
283
+ * @see Vector.addAbsolute
284
+ */
285
+ addAbsolute(v: VectorLike): this;
275
286
  /**
276
287
  * @see Vector.subtractAbsolute
277
288
  */
@@ -163,6 +163,15 @@ export class Vector {
163
163
  w = operator(Math.abs(w), isNumber ? b : Math.abs(b.w ?? 0));
164
164
  return this.create(x, y, z, w);
165
165
  }
166
+ /**
167
+ * Adds two vectors or a scalar value to a vector.
168
+ * @param a - The first vector or scalar value.
169
+ * @param b - The second vector or scalar value.
170
+ * @returns A new vector with incremented components.
171
+ */
172
+ static addAbsolute(a, b) {
173
+ return this.operateAbsolute(a, b, (x, y) => x + y);
174
+ }
166
175
  /**
167
176
  * Subtracts one vector from another or subtracts a scalar value from a vector.
168
177
  * @param a - The vector.
@@ -377,6 +386,12 @@ export class Vector {
377
386
  divide(v) {
378
387
  return Vector.divide(this, v);
379
388
  }
389
+ /**
390
+ * @see Vector.addAbsolute
391
+ */
392
+ addAbsolute(v) {
393
+ return Vector.addAbsolute(this, v);
394
+ }
380
395
  /**
381
396
  * @see Vector.subtractAbsolute
382
397
  */
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.32",
7
+ "version": "0.0.34",
8
8
  "publishConfig": {
9
9
  "directory": "lib"
10
10
  },