Origin changed event

Forum Forums Visual Components 4.1 .NET Addon Programming Origin changed event

This topic contains 4 replies, has 3 voices, and was last updated by Avatar jouha 1 month, 3 weeks ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #15550
    febjc0
    febjc0
    Participant

    I have two component and I need to keep their movement in sync. I know I can get their position changing event by TranslationRotationService, but how can I identify whether the origin of them has changed?

    #15700
    Avatar
    jouha
    Moderator

    Could you tell a bit more about the case? Are you changing origin of components?

    Python has OnSimulationUpdate event in vcScript that is perfect for monitoring any or many component location (PositionMatrix) during simulation run. So, by monitor one component you can set the location of another comp in the event handler by setting its otherComp.PositionMatrix and calling otherComp.update() to update the location.

    I believe in .NET you could utilize IRenderService.OnRequestRender event for similar monitoring and location updating.

    #15729
    febjc0
    febjc0
    Participant

    Yes, I reset the origin of component A and after moving component B by
    B.TransformationInWorld = A.TransformationInWorld;
    I found they are not at the same position.

    #15740
    Jay
    Jay
    Moderator

    I just did a quick test and it seems to work.

     

     

    #15797
    Avatar
    jouha
    Moderator

    Just to add a note here:

    It is different thing to change/manipulate the origin (coordinate system) of a component and to locate/move the component within another coordinate system (e.g. World). In this case you’re not manipulating the origin of the component 😉

    #15869
    Avatar
    Sir_HiraD
    Participant

    do this test

     

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.