-
Notifications
You must be signed in to change notification settings - Fork 0
class_physics2ddirectspacestate
reduz edited this page Feb 23, 2014
·
11 revisions
####Inherits: Object ####Category: Core
Direct access object to a space in the Physics2DServer.
- void
intersect_ray( Vector2 from, Vector2 to, Array exclude=Array(), int umask=0 ) - void
intersect_shape( RID shape, Matrix32 xform, int result_max, Array exclude=Array(), int umask=0 )
Direct access object to a space in the Physics2DServer. It's used mainly to do queries against objects and areas residing in a given space.
Intersect a ray in a given space, the returned object is a dictionary with the following fields:
position: place where ray is stopped
normal: normal of the object at the point where the ray was stopped
shape: shape index of the object agaisnt which the ray was stopped
collider_: collider agaisnt which the ray was stopped
collider_id: collider id of the object agaisnt which the ray was stopped
collider: collider object agaisnt which the ray was stopped
rid: [RID](class_rid) of the object agaisnt which the ray was stopped
If the ray did not intersect anything, then null is returned instead of a [Dictionary](class_dictionary).
- void
intersect_shape( RID shape, Matrix32 xform, int result_max, Array exclude=Array(), int umask=0 )
Intersect a given shape (RID or Shape2D) against the space, the intersected shapes are returned in a special result object.