Tao.Ode SDK Documentation

Ode.dGeomSetOffsetPosition Method 

Geom Offset Overview Geom offsets allow geom objects to be offset from a body's position. This is useful for cases where an object has an offset centre of mass, or is made up out of several geoms each with their own local position. Native support for geom offsets means that the geomTransform container is now obselete. The real advantage over geomTransform is that there is a much easier interface for setting, getting, and modifying a geom's offset from its body. The elimination of geomTransform simplifies callbacks which no longer have to special case that geom class type. In terms of performance, the new code has a negligible performance difference and a memory improvement compared to using a geomTransform. Geom Offset and Bodies An offset only makes sense for geoms which are connected to bodies. It is an error to attempt to set an offset for a geom which is not connected to a body. When a geom is disconnected from a body, any offset will be automatically eliminated. Thus, the possible states a geom can be in are: * Geom * Geom on body * Geom on body, with an offset To create an offset, just call one of the geomSetOffset functions. The offset will be automatically created if it does not yet exist. Geom offsets are normally set by specifying the offset in local coordinates. An extra set of functions are provided to allow an offset to be determined by providing world coordinates and subtracting them from the current body position. These second set of functions, geomSetOffsetWorldPosition(),etc, allow the user to essentially say "keep the body where it is, and move its geom to this position in the world". Set the local offset position of a geom from its body. After this call, the geom will be at a new position determined from the body's position and the offset. The geom must be attached to a body. If the geom did not have an offset, it is automatically created.

[Visual Basic]
Public Shared Sub dGeomSetOffsetPosition( _
   ByVal geom As IntPtr, _
   ByVal x As Single, _
   ByVal y As Single, _
   ByVal z As Single _
)
[C#]
public static void dGeomSetOffsetPosition(
   IntPtr geom,
   float x,
   float y,
   float z
);

Parameters

geom
the geom to set
x
the new X coordinate
y
the new Y coordinate
z
the new Z coordinate

See Also

Ode Class | Tao.Ode Namespace