Back to main page

Contact buffer

The contact buffer is used to return a number of contact points from a collision test.

Unlike the string buffer, the contact buffer counts from 0 instead of 1.

int GetLengthOfContactBuffer(void);

Returns the number of contacts in the contact buffer.

int ReadFromContactBuffer_BodyA(int Index);

0 <= Index < number of contacts in the buffer.

Returns ID of body A from the contact at Index.

int ReadFromContactBuffer_BodyB(int Index);

0 <= Index < number of contacts in the buffer.

Returns ID of body B from the contact at Index.

void ReadFromContactBuffer_Position_OutV3(int Index);

0 <= Index < number of contacts in the buffer.

Writes the position of the collision from the contact at Index to (X,Y,Z) in the matrix buffer.

void ReadFromContactBuffer_Normal_OutV3(int Index);

Since the collision have two bodies, the normal is depending on which body is A and which body is B.

0 <= Index < number of contacts in the buffer.

Writes the normal of the collision from the contact at Index to (X,Y,Z) in the matrix buffer.

float ReadFromContactBuffer_Impulse(int Index);

0 <= Index < number of contacts in the buffer.

Returns the impulse from the contact at Index.

Methods including "_OutCB" returns the number of contacts in the contact buffer and write the results in the contact buffer.