[ODE] Origin of Composite
czb182 at hotmail.com
Wed Aug 9 12:55:30 MST 2006
So, you mean take into account the offset of the main geom and where i want
its point of reference when position all my other geoms? I really would
like to not do that, as that just gets messy in the code. If I could use
that offset for original geom, it would save me from having to move all
This from Wiki:
A geometry transform 'T' is a geom that encapsulates another geom 'E',
allowing E to be positioned and rotated arbitrarily with respect to its
point of reference.
This sounds exactly like what I need, but its doesn't seem to work like I
want. Let me see if I understand this. I create transform and then create
a geom to go in that transform. I set geom posistion which sets in relative
to transform position. Then I insert transform to body. If then set body
position, which moves transform up and then the geom which the transform
contains is moved with regard to the transform.
THe only problem with this is that get position of that body returns
position of transform, and not geom contained, which has that offset. So if
i move body up by 1, and transform geom is moved -.5 with relation,
dbodygetposition will still return 1, instead of 0.5. Can I somehow shift
the mass of the geom by the same amout I transform to accomplish this? I'm
not sure how important mass distribution is at this point, and doin't know
if it would mess something up in my simulation, buts its worth a shot.
Reason this is important, is that my object is referenced across many files
and classes, I would rather not have some global shift variables to move all
additional objects by, which i suppose I might end up doing if theres no
more elegant solution.
>From: "Jon Watte (ODE)" <hplus-ode at mindcontrol.org>
>To: "Chris M." <czb182 at hotmail.com>
>CC: ode at q12.org
>Subject: Re: [ODE] Origin of Composite
>Date: Wed, 09 Aug 2006 09:28:35 -0700
>Chris M. wrote:
>>Well, I'm trying not to worry about mass distribution just yet, but is it
>>necessary to just the point of reference?
>The center of mass will always be at the point returned by
>dBodyGetPosition() (and set by dBodySetPosition). Thus, all geoms are
>placed relative to the center of mass. So, to "move" the center of mass,
>just "counter-move" the geoms.
> / h+
More information about the ODE