You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ENTITY/ApplyForceToEntity.md
+36-51Lines changed: 36 additions & 51 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,76 +5,61 @@ ns: ENTITY
5
5
6
6
```c
7
7
// 0xC5F68BE9613E2D18 0xC1C0855A
8
-
voidAPPLY_FORCE_TO_ENTITY(Entity entity, int forceType, float x, float y, float z, float offX, float offY, float offZ, int boneIndex, BOOL isDirectionRel, BOOL ignoreUpVec, BOOL isForceRel, BOOL p12, BOOL p13);
8
+
voidAPPLY_FORCE_TO_ENTITY(Entity entity, int forceType, float x, float y, float z, float offX, float offY, float offZ, int nComponent, BOOL bLocalForce, BOOL bLocalOffset, BOOL bScaleByMass, BOOL bPlayAudio, BOOL bScaleByTimeWarp);
9
9
```
10
10
11
-
Applies a force to the specified entity.
12
11
13
12
```c
14
-
enum eForceType
15
-
{
16
-
MinForce = 0,
17
-
MaxForceRot = 1,
18
-
MinForce2 = 2,
19
-
MaxForceRot2 = 3,
20
-
ForceNoRot = 4,
21
-
ForceRotPlusForce = 5
13
+
enum eApplyForceTypes {
14
+
APPLY_TYPE_FORCE = 0,
15
+
APPLY_TYPE_IMPULSE = 1,
16
+
APPLY_TYPE_EXTERNAL_FORCE = 2,
17
+
APPLY_TYPE_EXTERNAL_IMPULSE = 3,
18
+
APPLY_TYPE_TORQUE = 4,
19
+
APPLY_TYPE_ANGULAR_IMPULSE = 5
22
20
}
23
21
```
24
22
25
-
Research/documentation on the gtaforums can be found [here](https://gtaforums.com/topic/885669-precisely-define-object-physics/) and [here](https://gtaforums.com/topic/887362-apply-forces-and-momentums-to-entityobject/).
26
-
27
-
28
23
## Parameters
29
-
***entity**: The entity you want to apply a force on
30
-
***forceType**: Refer to `eForceType`
31
-
***x**: Force amount (X)
32
-
***y**: Force amount (Y)
33
-
***z**: Force amount (Z)
34
-
***offX**: Rotation/offset force (X)
35
-
***offY**: Rotation/offset force (Y)
36
-
***offZ**: Rotation/offset force (Z)
37
-
***boneIndex**: (Often 0) Entity bone index
38
-
***isDirectionRel**: (Usually false) Vector defined in local (body-fixed) coordinate frame
39
-
***ignoreUpVec**: (Usually true)
40
-
***isForceRel**: (Usually true) When true, force gets multiplied with the objects mass and different objects will have the same acceleration
41
-
***p12**: (Usually false)
42
-
***p13**: (Usually true)
43
-
24
+
***entity**: The entity handle
25
+
***forceType**: The force type
26
+
***x**: The x component of the force to apply
27
+
***y**: The y component of the force to apply
28
+
***z**: The z component of the force to apply
29
+
***offX**: Offset from center of entity (X)
30
+
***offY**: Offset from center of entity (Y)
31
+
***offZ**: Offset from center of entity (Z)
32
+
***nComponent**: Component of the entity to apply the force too. Only matters for breakable or articulated (ragdoll) physics. 0 means the root or parent component
33
+
***bLocalForce**: Specifies whether the force vector passed in is in local or world coordinates. `true` means the force will get automatically transformed into world space before being applied
34
+
***bLocalOffset**: Specifies whether the offset passed in is in local or world coordinates
35
+
***bScaleByMass**: Specifies whether to scale the force by mass
36
+
***bPlayAudio**: Specifies whether to play audio events related to the force being applied. The audio will depend on the entity type. Currently vehicles are the only entity types supported, and will play a suspension squeal depending on the magnitude of the force
37
+
***bScaleByTimeWarp**: Specifies whether to scale the force by time warp. Default is `true`
Copy file name to clipboardExpand all lines: ENTITY/ApplyForceToEntityCenterOfMass.md
+12-11Lines changed: 12 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,17 +5,18 @@ ns: ENTITY
5
5
6
6
```c
7
7
// 0x18FF00FC7EFF559E 0x28924E98
8
-
voidAPPLY_FORCE_TO_ENTITY_CENTER_OF_MASS(Entity entity, int forceType, float x, float y, float z, BOOL p5, BOOL isDirectionRel, BOOL isForceRel, BOOL p8);
8
+
voidAPPLY_FORCE_TO_ENTITY_CENTER_OF_MASS(Entity entity, int forceType, float x, float y, float z, cs_type(BOOL) int nComponent, BOOL bLocalForce, BOOL bScaleByMass, BOOL bApplyToChildren);
9
9
```
10
10
11
-
## Parameters
12
-
* **entity**:
13
-
* **forceType**: Refer to [APPLY_FORCE_TO_ENTITY](#_0xC5F68BE9613E2D18)
14
-
* **x**:
15
-
* **y**:
16
-
* **z**:
17
-
* **p5**:
18
-
* **isDirectionRel**:
19
-
* **isForceRel**:
20
-
* **p8**:
11
+
Apply a force to an entities center of mass.
21
12
13
+
## Parameters
14
+
* **entity**: The entity handle
15
+
* **forceType**: The force type, see [`APPLY_FORCE_TO_ENTITY`](#_0xC5F68BE9613E2D18)
16
+
* **x**: The x component of the force to apply
17
+
* **y**: The y component of the force to apply
18
+
* **z**: The z component of the force to apply
19
+
* **nComponent**: Component of the entity to apply the force too. Only matters for breakable or articulated (ragdoll) physics. 0 means the root or parent component
20
+
* **bLocalForce**: Specifies whether the force vector passed in is in local or world coordinates. `true` means the force will get automatically transformed into world space before being applied
21
+
* **bScaleByMass**: Specifies whether to scale the force by mass
22
+
* **bApplyToChildren**: Default `false`. If the force should be applied to any attached children
0 commit comments