GetContact

Category: Objects / Status
Since engine version: 4.9.5.0 CE

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 (object pObject, int iVertex, int dwCNAT);

Parameters

pObject:
[opt] Object of which to get collision information. Can be 0 in local calls.
iVertex:
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 0, all directions are checked.

Example

protected func Activate(object pCaller)
  {
  [Hopp!]
  if (GetContact(pCaller, -1) & CNAT_Bottom) return(pCaller->Jump());
  return(false);
  }
Script for a jumping pill: if you activate it with double dig, the clonk jumps if he is standing on the ground.
See also: Contact Attachment, GetMaterial, GetVertex, Stuck
Sven2, Januar 2005