GetContact

Category: Objects / Status
Since engine version: 1.0 OC

Description

Determines on which side individual or all vertices of an object are touching the landscape. Directions are specified using CNAT values.

Syntax

int GetContact(int index, int dwCNAT);

Parameters

index:
Index of the vertex to be checked. -1 checks all vertices and returns the result as a bitmask of values combined with OR.
dwCNAT:
[opt] Bit mask of CNAT values which determine which directions to check. If not specified, defaults to the vertices own CNAT mode, i.e. usually the one specified in VertexCNAT in the definition DefCore.txt file. If the vertex does not have any CNAT value, no direction is checked.

Example

protected func ControlUse(object caller)
{
  if (caller->GetContact(-1) & CNAT_Bottom) caller->Jump();
  return true;
}
Script for a jumping pill: if you use it, the clonk jumps if he is standing on the ground.
See also: Contact Attachment, GetMaterial, GetVertex, Stuck
Sven2, 2005-01