|
RayIntersectWorld | |
Status = RayIntersectWorld(WorldIndex, RayX1#, RayY1#, RayX2#, RayY2#) | |
Parameters: WorldIndex = The index of the world you wish to partition RayX1# = The starting X coordinate of ray RayY1# = The starting Y coordinate of ray RayX2# = The ending X coordinate of ray RayY2# = The ending Y coordinate of ray |
|
Returns: Status = Returns 1 when ray hits a line, or 0 when it doesn't |
|
The RayIntersectWorld function checks if a ray intersects a world. The function will return a True(1) if an impact occurs, or False(0). FACTS: * The ray only checks for intersections with visible lines within the world * If an intersection occurs, you can get the intersection point by using the GetIntersectX#(), GetIntersectY#() * If an intersection occurs, you can get the normal at the point of intersection using the GetNormalX# and GetNormalY# functions * If an intersection occurs, you can get World Element index using the GetIntersectObject command * RayIntersectWorld returns the closest impact point to the rays starting position. Mini Tutorial: This example builds a simple world, partitions it, then runs a series of ray intersections upon the world.
|
Related Info: | CreateWorld | GetSpriteCollisionMode | GetWorldElements | GetWorldElementVisible | LineHitShape | LinesIntersect | NewWorld | PartitionWorld | QueryWorldRegion : |
|
|||||||||||||||||||||||||||||||||||||||
(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com |