AGK for Pascal
ContentsIndexHome
PreviousUpNext
TAgkSprite.PhysicsCollidesWith Method

Checks two sprites for a physics sprites.

Syntax
Pascal
function PhysicsCollidesWith(const Other: TAgkSprite; out Collision: TAgkPhysicsCollision): Boolean;
Parameters 
Description 
const Other: TAgkSprite 
the sprite to check for physics collision with this sprite. 
out Collision: TAgkPhysicsCollision 
returns location information about the collision. 
Retuns 
True if the two sprites overlap or False if not. 

This function doesn't do any calculation, it simply looks up the results of the last physics step to determine if the sprites currently overlap. If this function returns True you can use the Collision parameter to get the collision point. If there is more than one point of collision it is not known which point will be returned. You can check the sprite's contact list to get the full list of contact points (see TAgkPhysics.GetFirstContact). If this function returns False, the value of the Collision parameter is undefined. 

This function is affected by group and category settings.

Copyright (c) 2012. All rights reserved.