When working with pure, unwrapped Box2D and Cocos2D, I used to be able to get the reaction force on a joint with a beautiful function called GetReactionForce. I've recently started trying Sprite Kit physics and I don't seem to find a similar thing. As far as I know there's no ready one. Is there a way I can achieve this in Sprite Kit somehow? The physics engine is still Box2D but not all the capabilities have been made available. I think it could be done using the properties like mass, density, velocity etc. of the bodies forming joint. But I have no idea how.
Box2D Joint.GetReactionForce equivalent in Sprite Kit
242 Views Asked by Mikayil Abdullayev At
1
There are 1 best solutions below
Related Questions in BOX2D
- Can't resolve undefined reference to box2D C++
- Box2D not simulating
- How to create a non-standard shape in a box2d python. Namely, a figure in the shape like Г, T, Z, like in Tetris?
- Is it possible to implement interaction pybox2d and pygame
- sync of body and sprites for animation?
- How to know which side of a ChainShape is being collided with?
- Why is this object not recognized?
- Box2d body's velocity slows down without any force applied
- Why does my installation of box2d fail even though I already have swig installed
- Box2d body, preservation of b2BodyDef, b2Shape, and b2FixtureDef
- error while installing pip install gymnasium[box2d]
- Ground Box doesn't work in LibGdx and Box2D with Scene2d
- LibGDX Displaying UI elements in game world
- LibGDX camera.project() is not working properly
- My LibGDX game project is rendering only the background image
Related Questions in SPRITE-KIT
- Label not showing on Tutorial SKScene
- How to create a mini-map of a SpriteKit scene using a different camera position
- Get name of SKTextureatlas
- Determine whether player character is at rest on static node
- How to detect the location of a mouseDown event for a iOS App using Swift?
- Update node's physicsbody with texture animation?
- How to detect touch inputs in SKScene on watchOS SpriteKit?
- Get actual size of applied texture to physicsBody?
- Changing a texture on a custom spritenode class drops the framerate, but only the first time?
- Swift Playground does not find SpriteKit particle file
- Why is SKTextureAtlas(dictionary:) Crashing
- SpriteKit animations freeze in second window on second display on Apple Silicon
- How to prevent SpriteKit overlay in SceneKit to get all key down events
- How can I Wrap a SKScene around a SCNNode as its texture?
- Prevent SpriteKit Metal Renderer from Exceeding Texture Size limit
Related Questions in REVOLUTE-JOINTS
- Processing raw Mocap data into a Skeletal Joints (BVH)
- Gravity Compensation with Orocos PyKDL always gives Zero
- How do I reset a Box2d RevoluteJoint to its original state properly?
- Revolute constraint in Phaser 3
- HingeJoint2D isn't working with Box Collider2D in Unity
- How to control Revolute joint using input button?
- How to set back and forth motion in revolute joint Libgdx?
- Revolute joints jump out of frame - vrep, bullet engine
- Andengine - RevoluteJointDef torque
- Why does wheel movement in Box2d doesn't cause car to move?
- How do I set a RevoluteJoint angle and velocity exactly?
- Unstable b2RevoluteJoint Box2D
- Catapult Arm rotation - libgdx and box2d
- Fire event when reach certain angle in revolute joint
- Revolute Joints in box2d
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
It's not readily available and I can't think of a way to emulate or work around it using Sprite Kit's built-in physics.
That said it's fairly easy to just ignore Sprite Kit's physics and instead embed Box2D (or Chipmunk) in your app. You can step the world in the scene's didSimulatePhysics message (gets called even with physicsWorld property being nil). You can store references to nodes inside the body's userData, and after stepping enumerate the bodies and update their node's (obtained from body's userData) position and zRotation properties.
Those are the essential steps. Just because Sprite Kit has physics built-in doesn't mean you can't use other physics engines.