@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
|
@@ -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
|
-
|
|
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
|
-
|
|
156
|
+
getOffsetInWorldCoords(offset: Vector3): Vector3;
|
|
157
157
|
/**
|
|
158
|
-
* @deprecated use [[
|
|
158
|
+
* @deprecated use [[getOffsetInRelativeCoords]] instead
|
|
159
159
|
*/
|
|
160
160
|
getPositionOffset(worldCoords: Vector3): Vector3;
|
|
161
161
|
/**
|
|
162
|
-
* @deprecated use [[
|
|
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
|
-
|
|
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
|
-
|
|
389
|
+
getOffsetInWorldCoords(offset) {
|
|
390
390
|
return Vector3.fromArray(GetOffsetFromEntityInWorldCoords(this.handle, offset.x, offset.y, offset.z));
|
|
391
391
|
}
|
|
392
392
|
/**
|
|
393
|
-
* @deprecated use [[
|
|
393
|
+
* @deprecated use [[getOffsetInRelativeCoords]] instead
|
|
394
394
|
*/
|
|
395
395
|
getPositionOffset(worldCoords) {
|
|
396
|
-
return this.
|
|
396
|
+
return this.getOffsetInRelativeCoords(worldCoords);
|
|
397
397
|
}
|
|
398
398
|
/**
|
|
399
|
-
* @deprecated use [[
|
|
399
|
+
* @deprecated use [[getOffsetInWorldCoords]]
|
|
400
400
|
*/
|
|
401
401
|
getOffsetPosition(offset) {
|
|
402
|
-
return this.
|
|
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) {
|
package/common/utils/Vector.d.ts
CHANGED
|
@@ -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
|
*/
|
package/common/utils/Vector.js
CHANGED
|
@@ -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
|
*/
|