Edit

Share via


SKPhysicsWorld.GetBody Method

Definition

Overloads

GetBody(CGPoint)

Returns the first SKPhysicsBody found that contains a point.

GetBody(CGRect)

Returns the first SKPhysicsBody whose shape intersects a rectangle.

GetBody(CGPoint, CGPoint)

Returns the first SKPhysicsBody that intersects a ray defined by two points.

GetBody(CGPoint)

Returns the first SKPhysicsBody found that contains a point.

[Foundation.Export("bodyAtPoint:")]
public virtual SpriteKit.SKPhysicsBody GetBody (CoreGraphics.CGPoint point);
abstract member GetBody : CoreGraphics.CGPoint -> SpriteKit.SKPhysicsBody
override this.GetBody : CoreGraphics.CGPoint -> SpriteKit.SKPhysicsBody

Parameters

point
CGPoint

Returns

Attributes

See also

  • <xref:SpriteKit.SKPhysicsWorld.EnumerateBodies(System.Drawing.PointF%2cSpriteKit.SKPhysicsWorldBodiesEnumeratorHandler)>

Applies to

GetBody(CGRect)

Returns the first SKPhysicsBody whose shape intersects a rectangle.

[Foundation.Export("bodyInRect:")]
public virtual SpriteKit.SKPhysicsBody GetBody (CoreGraphics.CGRect rect);
abstract member GetBody : CoreGraphics.CGRect -> SpriteKit.SKPhysicsBody
override this.GetBody : CoreGraphics.CGRect -> SpriteKit.SKPhysicsBody

Parameters

rect
CGRect

Returns

Attributes

See also

  • <xref:SpriteKit.SKPhysicsWorld.EnumerateBodies(System.Drawing.RectangleF%2cSpriteKit.SKPhysicsWorldBodiesEnumeratorHandler)>

Applies to

GetBody(CGPoint, CGPoint)

Returns the first SKPhysicsBody that intersects a ray defined by two points.

[Foundation.Export("bodyAlongRayStart:end:")]
public virtual SpriteKit.SKPhysicsBody GetBody (CoreGraphics.CGPoint rayStart, CoreGraphics.CGPoint rayEnd);
abstract member GetBody : CoreGraphics.CGPoint * CoreGraphics.CGPoint -> SpriteKit.SKPhysicsBody
override this.GetBody : CoreGraphics.CGPoint * CoreGraphics.CGPoint -> SpriteKit.SKPhysicsBody

Parameters

rayStart
CGPoint
rayEnd
CGPoint

Returns

Attributes

Remarks

Note that this method returns bodies along a ray, which starts at start but extends infinitely past end.

See also

  • <xref:SpriteKit.SKPhysicsWorld.EnumerateBodies(System.Drawing.PointF%2c+System.Drawing.PointF%2cSpriteKit.SKPhysicsWorldBodiesEnumeratorHandler)>

Applies to