Skip to content

Commit

Permalink
Merge pull request #83 from LeXXik/fix-ang-imp
Browse files Browse the repository at this point in the history
Fix impulse commands
  • Loading branch information
LeXXik authored Sep 3, 2024
2 parents 7876fe9 + f552ba1 commit 745fd23
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@gamebop/physics",
"description": "Physics components for PlayCanvas engine",
"version": "0.3.1",
"version": "0.3.2",
"main": "dist/physics.min.mjs",
"author": "Gamebop",
"license": "MIT",
Expand Down
7 changes: 4 additions & 3 deletions src/physics/jolt/front/body/component.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import {
CMD_SET_KIN_COL_NON_DYN, CMD_SET_APPLY_GYRO_FORCE, CMD_SET_INTERNAL_EDGE,
CMD_RESET_SLEEP_TIMER, CMD_SET_LIN_VEL_CLAMPED, CMD_SET_ANG_VEL_CLAMPED, CMD_RESET_MOTION,
CMD_SET_MAX_ANG_VEL, CMD_SET_MAX_LIN_VEL, CMD_CLAMP_ANG_VEL, CMD_CLAMP_LIN_VEL,
CMD_SET_VEL_STEPS, CMD_SET_POS_STEPS
CMD_SET_VEL_STEPS, CMD_SET_POS_STEPS, CMD_ADD_ANGULAR_IMPULSE,
CMD_ADD_TORQUE
} from '../../constants.mjs';

const vec3 = new Vec3();
Expand Down Expand Up @@ -1060,7 +1061,7 @@ class BodyComponent extends ShapeComponent {
*/
addAngularImpulse(impulse) {
this.system.addCommand(
OPERATOR_MODIFIER, CMD_ADD_IMPULSE, this._index,
OPERATOR_MODIFIER, CMD_ADD_ANGULAR_IMPULSE, this._index,
impulse, BUFFER_WRITE_VEC32, false
);
}
Expand All @@ -1073,7 +1074,7 @@ class BodyComponent extends ShapeComponent {
*/
addTorque(torque) {
this.system.addCommand(
OPERATOR_MODIFIER, CMD_ADD_FORCE, this._index,
OPERATOR_MODIFIER, CMD_ADD_TORQUE, this._index,
torque, BUFFER_WRITE_VEC32, false
);
}
Expand Down

0 comments on commit 745fd23

Please sign in to comment.