Talking to a single corner of an actors rectangle?

croc0000croc0000 Member Posts: 11
edited August 2016 in Working with GS (Mac)

How do I constrain the behaviour of a corner (bottom-left) of the rectangle that defines my actor?

Comments

  • SocksSocks London, UK.Member Posts: 12,822

    Change the centre-of-mass, and then apply a 'Pin'.

  • croc0000croc0000 Member Posts: 11

    Is it possible to control two corners of an actor?

  • SocksSocks London, UK.Member Posts: 12,822
    edited August 2016

    @croc0000 said:
    Is it possible to control two corners of an actor?

    'control' is an entirely arbitrary idea ! Without context It could mean anything.

  • croc0000croc0000 Member Posts: 11

    Sorry. Apply constraint rules to two corners. The idea being both the front and back forks of a bike. I can attach the bike frame to the front wheel, but I have been trying to constrain the frame to follow both the wheels and I need to differentiate between the front of the rectangle and the back.

  • croc0000croc0000 Member Posts: 11

    Could I constrain the max X and min Y of the frame to the front wheel and the Min X and Min Y to the back? I was trying stuff like that, but it didn't seem to work?

  • SocksSocks London, UK.Member Posts: 12,822
    edited August 2016

    @croc0000 said:
    Could I constrain the max X and min Y of the frame to the front wheel and the Min X and Min Y to the back? I was trying stuff like that, but it didn't seem to work?

    Min and max are mathematical functions, like multiply, add, sin or floor.

    max(A,B) returns the larger value of A and B.
    min(A,B) returns the smaller value of A and B.

    Example:

    max (100,30) = 100
    max (100,109) = 109
    max (22,9) = 22

    min (100,30) = 30
    min (100,109) = 100
    min (22,9) = 9

    What do you mean by 'the max X and min Y of the frame' ?

  • croc0000croc0000 Member Posts: 11

    Of the bike frame (actor) that is "hopefully sitting "on" the wheels. In other words, the bottom left (minX,minY of the actor) constrained to back wheel, and bottom right (maxX,minY of the same actor) constrained to front wheel.

  • SocksSocks London, UK.Member Posts: 12,822
    edited August 2016

    @croc0000 said:
    . . . the bottom left (minX,minY of the actor) constrained to back wheel, and bottom right (maxX,minY of the same actor) . . .

    Min does not mean the leftmost or lowermost coordinate of an actor nor does Max mean the rightmost or uppermost coordinate of an actor, the min and max functions have nothing to do with actor coordinates.

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    how about constraining the bike frame to the front wheel and the back wheel to the bike frame?

  • croc0000croc0000 Member Posts: 11

    I understand what your saying Socks, thank you. I tried that jamie, but the frame wouldn't rotate around the front wheel, once I constrained it. And the bounce of the back wheel created issues with it's attachment to the Frame,... or it would just sit in the middle of the frame

  • SocksSocks London, UK.Member Posts: 12,822
    edited August 2016

    @croc0000 said:
    I understand what your saying Socks, thank you. I tried that jamie, but the frame wouldn't rotate around the front wheel, once I constrained it. And the bounce of the back wheel created issues with it's attachment to the Frame,... or it would just sit in the middle of the frame

    Did you try my suggestion from the other thread ?

  • croc0000croc0000 Member Posts: 11

    Your bike looks and works great. I will post no more.

  • SocksSocks London, UK.Member Posts: 12,822

    @croc0000 said:
    Your bike looks and works great. I will post no more.

    You can do it mathematically if you really want to, it's not too complicated, just a little trigonometry and a few constrains, but the 'mechanical' route using a collision shape to hold the bike to the wheels is much easier, requires no rules, behaviours or any kind of code at all and works really well, I'd personally go the mechanical route, but like I say you can position the bike elements with maths too.

Sign In or Register to comment.