Skip to content

Commit

Permalink
Merge pull request #1171 from overte-org/fix/rotation_velocity
Browse files Browse the repository at this point in the history
Change minimum angular velocity to a lower one
  • Loading branch information
ksuprynowicz authored Oct 22, 2024
2 parents 1576351 + ba78d25 commit ff8c4ca
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libraries/entities/src/EntityItem.cpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -1659,7 +1659,7 @@ void EntityItem::setAngularVelocity(const glm::vec3& value) {
if (angularVelocity != value) {
float speed = glm::length(value);
if (!glm::isnan(speed)) {
const float MIN_ANGULAR_SPEED = 0.0002f;
const float MIN_ANGULAR_SPEED = 0.00001f;
const float MAX_ANGULAR_SPEED = 9.0f * TWO_PI; // 1/10 rotation per step at 90Hz
if (speed < MIN_ANGULAR_SPEED) {
angularVelocity = ENTITY_ITEM_ZERO_VEC3;
Expand Down
2 changes: 1 addition & 1 deletion libraries/physics/src/ObjectMotionState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const float ACTIVATION_POSITION_DELTA = 0.005f;
const float ACTIVATION_ALIGNMENT_DOT = 0.99990f;
const float ACTIVATION_LINEAR_VELOCITY_DELTA = 0.01f;
const float ACTIVATION_GRAVITY_DELTA = 0.1f;
const float ACTIVATION_ANGULAR_VELOCITY_DELTA = 0.03f;
const float ACTIVATION_ANGULAR_VELOCITY_DELTA = 0.0004f;


// origin of physics simulation in world-frame
Expand Down
2 changes: 1 addition & 1 deletion libraries/shared/src/PhysicsHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const float PHYSICS_ENGINE_FIXED_SUBSTEP = 1.0f / (float)NUM_SUBSTEPS_PER_SECOND
const float DYNAMIC_LINEAR_SPEED_THRESHOLD = 0.05f; // 5 cm/sec
const float DYNAMIC_ANGULAR_SPEED_THRESHOLD = 0.087266f; // ~5 deg/sec
const float KINEMATIC_LINEAR_SPEED_THRESHOLD = 0.001f; // 1 mm/sec
const float KINEMATIC_ANGULAR_SPEED_THRESHOLD = 0.008f; // ~0.5 deg/sec
const float KINEMATIC_ANGULAR_SPEED_THRESHOLD = 0.0004f; // ~0.025 deg/sec

// return incremental rotation (Bullet-style) caused by angularVelocity over timeStep
glm::quat computeBulletRotationStep(const glm::vec3& angularVelocity, float timeStep);
Expand Down

0 comments on commit ff8c4ca

Please sign in to comment.