GetContact

Category: Objects / Status
Since engine version: 5.1 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, all directions are 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