# IRfCollisionSet Interface Reference

Inherits IUnknown.

List of all members.

## Public Member Functions
HRESULT | InitFnSet ([in] IRsNode *spSpace)
HRESULT | GetFPSCollisions ([in] IRdVertex *pCenter,[in] RtFloat radius,[out] IRdPointArray **ppPoints,[out] RtFloat **depths)
HRESULT | GetFPSCollision ([in] IRdVertex *pCenter,[in] RtFloat radius,[out] IRdVertex **ppPoint,[out] IRdVertex **pNorm,[out] RtFloat *depth)
HRESULT | GetObjectCollision ([in] IRsNode *pObject,[in] RtShort option,[out] IRdCollInfo **ppCollInfo)
HRESULT | GetPeerCollision ([in] IRsNode *pObject1,[in] IRsNode *pObject2,[in] RtShort option,[out] IRdCollInfo **ppCollInfo)
HRESULT | SetFilter ([in] IRsCollisionFilter *pFilter)
HRESULT | GetFPSObjectCollision ([in] IRdVertex *pCenter,[in] RtFloat radius,[out] IRsNode **pObject,[out] IRdVertex **ppPoint,[out] IRdVertex **pNorm,[out] RtFloat *depth)

## Detailed Description

Provides functionality for collision evaluations.

## Member Function Documentation

HRESULT IRfCollisionSet::InitFnSet | ( | [in] IRsNode * | spSpace | ) |

Initializes fn set for given spSpace.

Remarks:
  If spSpace == NULL, fn set is initialized for current Space3D.

Parameters:

  | spSpace | [in] Named space to initialize function-set for.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRfCollisionSet::GetFPSCollisions | ( | [in] IRdVertex * | pCenter,
|  | [in] RtFloat | radius,
|  | [out] IRdPointArray ** | ppPoints,
|  | [out] RtFloat ** | depths |
| ) |  |  |

Returns collisions with scene for FPS object with given center and radius.

Remarks:
  ppPoints array contains collpoint1, collnorm1, collpoint2, collnorm2,....

  Depths array containts penetration depth - depth[0] for collpoint1, depth[1] for collpoint2,....

Parameters:

  | pCenter | [in] .
  | radius | [in] .
  | ppPoints | [out] .
  | depths | [out] .

Returns:
  S_OK - collisions are found S_FALSE - no collisions.

HRESULT IRfCollisionSet::GetFPSCollision | ( | [in] IRdVertex * | pCenter,
|  | [in] RtFloat | radius,
|  | [out] IRdVertex ** | ppPoint,
|  | [out] IRdVertex ** | pNorm,
|  | [out] RtFloat * | depth |
| ) |  |  |

Returns collision with scene for FPS object with given center and radius with the highest penetration depth.

Parameters:

  | pCenter | [in] .
  | radius | [in] .
  | ppPoint | [out] collision point.
  | ppNorm | [out) collision norm.
  | depth | [out] penetration depth.

Returns:
  S_OK - collision is found S_FALSE - no collisions.

HRESULT IRfCollisionSet::GetObjectCollision | ( | [in] IRsNode * | pObject,
|  | [in] RtShort | option,
|  | [out] IRdCollInfo ** | ppCollInfo |
| ) |  |  |

Returns collisions with scene for object.

Parameters:

  | pObject | [in] object.
  | option | [in] collision parameters, IRiPhysicsCommand::RtCollPrecision.
  | ppCollInfo | [out] collision data.

Returns:
  S_OK - collisions are found S_FALSE - no collisions.

HRESULT IRfCollisionSet::GetPeerCollision | ( | [in] IRsNode * | pObject1,
|  | [in] IRsNode * | pObject2,
|  | [in] RtShort | option,
|  | [out] IRdCollInfo ** | ppCollInfo |
| ) |  |  |

Returns collisions between pObject1 and pObject2.

Parameters:

  | pObject1 | [in] object.
  | pObject2 | [in] peer object.
  | option | [in] collision parameters, IRiPhysicsCommand::RtCollPrecision.
  | ppCollInfo | [out] collision data.

Returns:
  S_OK - collisions are found S_FALSE - no collisions.

HRESULT IRfCollisionSet::SetFilter | ( | [in] IRsCollisionFilter * | pFilter | ) |

Sets collisions filter.

Parameters:

  | pFilter | [in] is filter object.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRfCollisionSet::GetFPSObjectCollision | ( | [in] IRdVertex * | pCenter,
|  | [in] RtFloat | radius,
|  | [out] IRsNode ** | pObject,
|  | [out] IRdVertex ** | ppPoint,
|  | [out] IRdVertex ** | pNorm,
|  | [out] RtFloat * | depth |
| ) |  |  |

GetFPSObjectCollision.

Parameters:

  | pCenter | [in] .
  | radius | [in] .
  | pObject | [out] .
  | ppPoint | [out] collision point.
  | ppNorm | [out] collision norm.
  | depth | [out] penetration depth.

Returns:
  S_OK - collision is found S_FALSE - no collisions.