[{"data":1,"prerenderedAt":145},["ShallowReactive",2],{"embed-rapier-wrecking-ball":3},{"id":4,"title":5,"author":6,"body":9,"date":127,"description":128,"extension":129,"featured":130,"lastUpdated":131,"meta":132,"navigation":135,"path":136,"responsive":130,"seo":137,"stem":138,"tags":139,"thumbnail":143,"__hash__":144},"experiments\u002Fexperiments\u002Frapier-wrecking-ball.md","Rapier Wrecking Ball",[7,8],"jaime-bboyjt","alvarosabu",{"type":10,"value":11,"toc":119},"minimark",[12,25,30,33,37,95,99],[13,14,15,16,20,21,24],"p",{},"A wrecking ball demo using ",[17,18,19],"code",{},"@tresjs\u002Frapier"," and a ",[17,22,23],{},"SphericalJoint"," to simulate a pendulum. The heavy ball is attached to a fixed anchor point and swings through a wall of stacked boxes.",[26,27,29],"h3",{"id":28},"what-youll-see","What You'll See",[13,31,32],{},"A dark metallic sphere hanging from a chain, swinging like a pendulum and smashing through a wall of stacked boxes. Gravity and collision responses are handled entirely by Rapier's physics engine.",[26,34,36],{"id":35},"technical-implementation","Technical Implementation",[38,39,40,56,61,72,86],"ul",{},[41,42,43,47,48,51,52,55],"li",{},[44,45,46],"strong",{},"Fixed anchor"," — a ",[17,49,50],{},"type=\"fixed\""," ",[17,53,54],{},"RigidBody"," acts as the immovable pivot point.",[41,57,58,60],{},[44,59,23],{}," — connects the anchor to the ball, allowing free rotation while constraining the distance (ball-and-socket).",[41,62,63,47,66,51,69,71],{},[44,64,65],{},"Dynamic ball",[17,67,68],{},"type=\"dynamic\"",[17,70,54],{}," with configurable mass that swings as a pendulum.",[41,73,74,77,78,81,82,85],{},[44,75,76],{},"Chain visual"," — an ",[17,79,80],{},"InstancedMesh"," of cylinder segments updated every frame via ",[17,83,84],{},"onBeforeRender",", alternating rotation to mimic chain links.",[41,87,88,91,92,94],{},[44,89,90],{},"Destructible wall"," — a configurable grid of independent ",[17,93,68],{}," rigid bodies with adjustable mass that react to collisions.",[26,96,98],{"id":97},"key-features","Key Features",[38,100,101,106,113,116],{},[41,102,103,105],{},[17,104,23],{}," for pendulum-style constraints",[41,107,108,110,111],{},[17,109,80],{}," chain updated in real-time via ",[17,112,84],{},[41,114,115],{},"Configurable grid size, ball size, ball mass, and box mass via GUI controls",[41,117,118],{},"Physics-driven rigid body stacking and destruction",{"title":120,"searchDepth":121,"depth":121,"links":122},"",2,[123,125,126],{"id":28,"depth":124,"text":29},3,{"id":35,"depth":124,"text":36},{"id":97,"depth":124,"text":98},"2026-05-22","A physics-driven wrecking ball suspended from an anchor point by a spherical joint, swinging to demolish a destructible wall of stacked boxes. Built with @tresjs\u002Frapier.","md",false,"2026-05-24",{"slug":133,"status":134},"rapier-wrecking-ball","draft",true,"\u002Fexperiments\u002Frapier-wrecking-ball",{"title":5,"description":128},"experiments\u002Frapier-wrecking-ball",[140,141,142],"physics","rapier","joints","\u002Fexperiments\u002Frapier-wrecking-ball.webp","MvOkQCCtrxr-OqbwU4BsnEGoUGlKaStNtR0KarpaWJk",1792681429665]