Applications use the methods of the IDirect3DRMPicked2Array interface to organize pick objects and to return more information about the pick objects. See IDirect3DRMPickedArray for more information about picking.
You can use the IDirect3DRMFrame3::RayPick method to retrieve an IDirect3DRMPicked2Array interface, and then call the IDirect3DRMPicked2Array::GetPick method to retrieve an IDirect3DRMFrameArray interface, a visual object, and information about the object intersected by the ray, including the face and group identifiers, pick position, and horizontal and vertical texture coordinates for the vertex, vertex normal, and color of the object. The array of frames is the path through the hierarchy leading to the visual object.
The D3DRMPICKDESC2 structure returned by IDirect3DRMPicked2Array::GetPick contains the face and group identifiers, pick position, horizontal and vertical texture coordinates for the vertex, vertex normal, and color of the intersected objects. A pointer to this interface pointer is returned in the IDirect3DRMFrame3::RayPick method during ray picks.
The IDirect3DRMPicked2Array interface supports the following methods:
GetPick |
GetSize |
The IDirect3DRMPicked2Array interface, like all COM interfaces, inherits the IUnknown interface methods. The IUnknown interface supports the following three methods:
AddRef |
QueryInterface |
Release |
The Direct3DRMPicked2Array object is obtained by calling the IDirect3DRMFrame3::RayPick method.
Retrieves the Direct3DRMVisual and Direct3DRMFrame objects intersected by the specified pick.
Syntax
HRESULT GetPick(
DWORD index,
LPDIRECT3DRMVISUAL *lplpVisual,
LPDIRECT3DRMFRAMEARRAY *lplpFrameArray,
LPD3DRMPICKDESC2 lpD3DRMPickDesc2
);
Parameters
- index
- Index into the pick array identifying the pick for which information will be retrieved.
- lplpVisual
- Address that will contain a pointer to the Direct3DRMVisual object associated with the specified pick.
- lplpFrameArray
- Address that will contain a pointer to the Direct3DRMFrameArray object associated with the specified pick.
- lpD3DRMPickDesc
- Address of a D3DRMPICKDESC2 structure specifying the face and group identifiers, pick position, horizontal and vertical texture coordinates for the vertex, vertex normal, and color of the intersected objects.
Return Value
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Return Values.
Remarks
This method is similar to IDirect3DRMPickedArray::GetPick except that it retrieves the u- and v-values in a D3DRMPICKDESC2 structure rather than a D3DRMPICKDESC structure.
See Also
Retrieves the number of elements contained in a Direct3DRMPicked2Array object.
Syntax
DWORD GetSize( );
Return Value
Returns the number of elements.
Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.