Docs for SKPhysicsBody bodyWithCircleOfRadius: says:
Creates a circular physics body centered on the owning node’s origin.
So is origin a node position? Couldnt find it anywere.
So is origin a node position?
The origin is the point with coordinates (0, 0) in a given coordinate system. However, you typically deal with a number of different coordinate systems when working with computer graphics, and each one has its own origin. For example, every view in a view hierarchy has its own coordinate system. So, you need some context to know exactly which one you're talking about.
From the SKNode docs:
Every node in a node tree provides a coordinate system to its children. After a child is added to the node tree, it is positioned inside its parent’s coordinate system by setting its position properties.
You also commented:
Im confused becouse 'origin' also is mention in SKScene docs, and its different than frames origin
SKScene is a subclass of SKNode, and so it's also the case that every scene provides a coordinate system. This isn't surprising -- a scene is just the root node in a tree of nodes.
Don't confuse the origin of a node's frame with the origin of the node's own coordinate system. A CGRect is defined by two things: a CGPoint called origin, and a CGSize called size. A node's frame is the rectangle that defines the node's bounds in the coordinate system of the parent node. The node's origin might happen to be at the same place as it's frame's origin, but they're not the same thing. For example, the origin of a scene is at it's anchorPoint -- that is, the anchorPoint property of a scene indicates some point in the view that contains the scene, and that point has coordinates (0, 0) in the scene. Neither of these have anything to do with the frame or frame.origin.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With