Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement objects sticking to solids #1782

Open
weluvgoatz opened this issue Jul 7, 2021 · 1 comment · May be fixed by #2846
Open

Implement objects sticking to solids #1782

weluvgoatz opened this issue Jul 7, 2021 · 1 comment · May be fixed by #2846

Comments

@weluvgoatz
Copy link
Member

In the recent improvements to moving objects, the movement from the moving object is applied to those who stand on it. It would be interesting to add a similar thing but for the sides and bottom of the moving object. This would only apply to objects with a set "sticky" attribute, and would simulate sticking objects to things.
This could apply to dart traps, bumpers, levers, the upcoming crystal shards, and other objects who currently do not stick to the sides of solids and instead simply stand by themselves, which produces unexpected behavior.

@mrkubax10
Copy link
Member

mrkubax10 commented Aug 30, 2021

My idea to implement this is to have struct:

struct StickedObject
{
  MovingObject* m_object;
  Vector m_point;
}

and then additional field std::vector<StickedObject> m_sticked_objects in MovingObject then iterate over this vector and update MovingObjects position this way (pseudocode):
m_sticked_objects[i].m_object->set_pos(get_pos()+m_sticked_objects[i].m_point)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants