Skip to content

Comments

Added optional delta simulating a drag effect upon collision#20

Open
Maririri wants to merge 1 commit intomainfrom
show-object-motion-with-delay
Open

Added optional delta simulating a drag effect upon collision#20
Maririri wants to merge 1 commit intomainfrom
show-object-motion-with-delay

Conversation

@Maririri
Copy link
Collaborator

No description provided.

…alculations in GameObject and Collisions. A delta can optionally be set for each Motion, simulating a drag effect upon collision.
@Maririri Maririri requested a review from anastasiak2512 March 26, 2024 16:44
pos_.calculate(msec);
pos_.setValue(pos_.getValue() + speed_.getValue() * (msec / 1000.));

if (QVector2D(speed_.getValue()).length() < 0.03) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will reset the delta if magnitude of speed vector is less than some threshold. However, the exact threshold value might need some adjustment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant