Results 1 to 3 of 3

Thread: Behaviour of <rigid_constraint>s and <instance_rigid_body>s

  1. #1
    Junior Member
    Join Date
    Apr 2011
    Posts
    3

    Behaviour of <rigid_constraint>s and <instance_rigid_body>s

    Hello

    I am implementing an import/export module to COLLADA Physics and have a problem with <rigid_constraint>s. The <attachment> and <ref_attachment> refer to a <rigid_body> specifically. But as I understand it, a given <rigid_body> can be instantiated multiple times in a scene. This poses a conflict, since a constraint doesn't make much sense anymore if it links more than 2 bodies, imho.

    What behaviour is intended? Should the attachments refer to <instance_rigid_body>s instead? Is it illegal to use other than 1 instance when a body is constrained?


    Less urgent question: If a <rigid_body> is part of a <physics_model>, which is instantiated in a <physics_scene>, but it there is no corresponding <instance_rigid_body>, is the body part of the scene anyway (without any modifications?) Currently I'm implementing it as not, since this wouldn't fit conceptually with multiple instantiation, but I'm not sure.

    I would greatly appreciate it if someone could clarify this for me.

  2. #2
    Senior Member
    Join Date
    Aug 2004
    Location
    California
    Posts
    771

    Re: Behaviour of <rigid_constraint>s and <instance_rigid_bod

    Quote Originally Posted by Yla
    I am implementing an import/export module to COLLADA Physics and have a problem with <rigid_constraint>s. The <attachment> and <ref_attachment> refer to a <rigid_body> specifically. But as I understand it, a given <rigid_body> can be instantiated multiple times in a scene. This poses a conflict, since a constraint doesn't make much sense anymore if it links more than 2 bodies, imho.
    COLLADA is declarative and does not mandate any particular method or rule for instantiation. Instantiation is application defined as to how much of the representation is shared or copied between instances.
    Quote Originally Posted by Yla
    What behaviour is intended? Should the attachments refer to <instance_rigid_body>s instead? Is it illegal to use other than 1 instance when a body is constrained?
    No, the description is declarative showing the relationships defined by the author of the content. How an application instantiates that description, and how many times, is left to the application (use-case). Since physics engines are not standardized, the <instance_rigid_constraint> element has a child <extra> element in which to describe per-instance data (overrides).
    Quote Originally Posted by Yla
    Less urgent question: If a <rigid_body> is part of a <physics_model>, which is instantiated in a <physics_scene>, but it there is no corresponding <instance_rigid_body>, is the body part of the scene anyway (without any modifications?) Currently I'm implementing it as not, since this wouldn't fit conceptually with multiple instantiation, but I'm not sure.
    Yes, in that case it is an inline or embedded declaration. This is as opposed to declaring things in library elements and instantiating them in the appropriate places.

    Think of the declarations in the document as prototypes (Builder Design Pattern) or templates from which you instantiate the objects you will actually manipulate in the application.

    I hope that helps.

  3. #3
    Junior Member
    Join Date
    Apr 2011
    Posts
    3

    Re: Behaviour of <rigid_constraint>s and <instance_rigid_bod

    Thank you for the answers.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •