[{"data":1,"prerenderedAt":654},["ShallowReactive",2],{"navigation":3,"/api/rigid-body/custom-colliders":72,"/api/rigid-body/custom-colliders-surround":649},[4,22],{"title":5,"path":6,"stem":7,"children":8},"Getting Started","/getting-started","1.getting-started/1.index",[9,10,14,18],{"title":5,"path":6,"stem":7},{"title":11,"path":12,"stem":13},"Installation Guide","/getting-started/installation","1.getting-started/2.installation",{"title":15,"path":16,"stem":17},"Usage","/getting-started/usage","1.getting-started/3.usage",{"title":19,"path":20,"stem":21},"How it works","/getting-started/how-it-works","1.getting-started/how-it-works",{"title":23,"path":24,"stem":25,"children":26},"Api","/api","2.api",[27,30,64,68],{"title":28,"path":24,"stem":29},"Physics","2.api/index",{"title":31,"path":32,"stem":33,"children":34},"Rigid body","/api/rigid-body","2.api/1.rigid-body/index",[35,36,40,44,48,52,56,60],{"title":31,"path":32,"stem":33},{"title":37,"path":38,"stem":39},"Automatic colliders","/api/rigid-body/automatic-colliders","2.api/1.rigid-body/1.automatic-colliders",{"title":41,"path":42,"stem":43},"Custom colliders","/api/rigid-body/custom-colliders","2.api/1.rigid-body/2.custom-colliders",{"title":45,"path":46,"stem":47},"Forces","/api/rigid-body/forces","2.api/1.rigid-body/3.forces",{"title":49,"path":50,"stem":51},"Collisions","/api/rigid-body/collisions","2.api/1.rigid-body/4.collisions",{"title":53,"path":54,"stem":55},"Sensor","/api/rigid-body/sensor","2.api/1.rigid-body/5.sensor",{"title":57,"path":58,"stem":59},"Contact force","/api/rigid-body/contact-force","2.api/1.rigid-body/6.contact-force",{"title":61,"path":62,"stem":63},"Instance rigid body","/api/rigid-body/instance-rigid-body","2.api/1.rigid-body/7.instance-rigid-body",{"title":65,"path":66,"stem":67},"Joints","/api/joint","2.api/2.joint",{"title":69,"path":70,"stem":71},"UseRapier","/api/use-rapier","2.api/3.use-rapier",{"id":73,"title":41,"body":74,"description":642,"extension":643,"links":644,"meta":645,"navigation":646,"path":42,"seo":647,"stem":43,"__hash__":648},"docs/2.api/1.rigid-body/2.custom-colliders.md",{"type":75,"value":76,"toc":636},"minimark",[77,81,87,156,166,171,342,351,355,363,369,457,461,570,586,601,605,632],[78,79,80],"p",{},"You can add colliders that are not tied to a 3D mesh, this way you can create\nyour own collider shape.",[82,83,84],"scene-wrapper",{},[85,86],"demos-custom-colliders",{},[88,89,94],"pre",{"className":90,"code":91,"language":92,"meta":93,"style":93},"language-vue shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u003Ctemplate>\n  \u003CRigidBody>\n    \u003CBallCollider />\n  \u003C/RigidBody>\n\u003C/template>\n","vue","",[95,96,97,113,124,136,146],"code",{"__ignoreMap":93},[98,99,102,106,110],"span",{"class":100,"line":101},"line",1,[98,103,105],{"class":104},"sMK4o","\u003C",[98,107,109],{"class":108},"swJcz","template",[98,111,112],{"class":104},">\n",[98,114,116,119,122],{"class":100,"line":115},2,[98,117,118],{"class":104},"  \u003C",[98,120,121],{"class":108},"RigidBody",[98,123,112],{"class":104},[98,125,127,130,133],{"class":100,"line":126},3,[98,128,129],{"class":104},"    \u003C",[98,131,132],{"class":108},"BallCollider",[98,134,135],{"class":104}," />\n",[98,137,139,142,144],{"class":100,"line":138},4,[98,140,141],{"class":104},"  \u003C/",[98,143,121],{"class":108},[98,145,112],{"class":104},[98,147,149,152,154],{"class":100,"line":148},5,[98,150,151],{"class":104},"\u003C/",[98,153,109],{"class":108},[98,155,112],{"class":104},[157,158,159],"warning",{},[78,160,161,162,165],{},"Custom collider needs to be child of a ",[95,163,164],{},"Rigid-body"," component.",[167,168,170],"h3",{"id":169},"available-as-component","Available as component",[172,173,174,188],"table",{},[175,176,177],"thead",{},[178,179,180,185],"tr",{},[181,182,184],"th",{"align":183},"left","Prop",[181,186,187],{"align":183},"Description",[189,190,191,202,212,222,232,242,252,262,272,282,292,302,312,322,332],"tbody",{},[178,192,193,199],{},[194,195,196],"td",{"align":183},[95,197,198],{},"\u003CCuboidCollider>",[194,200,201],{"align":183},"Box shape",[178,203,204,209],{},[194,205,206],{"align":183},[95,207,208],{},"\u003CBallCollider>",[194,210,211],{"align":183},"Sphere shape",[178,213,214,219],{},[194,215,216],{"align":183},[95,217,218],{},"\u003CCapsuleCollider>",[194,220,221],{"align":183},"Capsule shape",[178,223,224,229],{},[194,225,226],{"align":183},[95,227,228],{},"\u003CConeCollider>",[194,230,231],{"align":183},"Cone shape",[178,233,234,239],{},[194,235,236],{"align":183},[95,237,238],{},"\u003CCylinderCollider>",[194,240,241],{"align":183},"Cylinder shape",[178,243,244,249],{},[194,245,246],{"align":183},[95,247,248],{},"\u003CConvexHullCollider>",[194,250,251],{"align":183},"The smallest convex shape that contains all the given points.",[178,253,254,259],{},[194,255,256],{"align":183},[95,257,258],{},"\u003CConvexMeshCollider>",[194,260,261],{"align":183},"Convex mesh generated from the provided mesh geometry.",[178,263,264,269],{},[194,265,266],{"align":183},[95,267,268],{},"\u003CTrimeshCollider>",[194,270,271],{"align":183},"A set of indices indicating what vertex is used by what triangle.",[178,273,274,279],{},[194,275,276],{"align":183},[95,277,278],{},"\u003CHeightfieldCollider>",[194,280,281],{"align":183},"Large rectangle in the X-Z plane, subdivided in a grid pattern at regular intervals",[178,283,284,289],{},[194,285,286],{"align":183},[95,287,288],{},"\u003CPolylineCollider>",[194,290,291],{"align":183},"Polyline generated from line segments defined by points.",[178,293,294,299],{},[194,295,296],{"align":183},[95,297,298],{},"\u003CRoundConeCollider>",[194,300,301],{"align":183},"Rounded cone shape.",[178,303,304,309],{},[194,305,306],{"align":183},[95,307,308],{},"\u003CRoundConvexHullCollider>",[194,310,311],{"align":183},"Rounded convex hull generated from points.",[178,313,314,319],{},[194,315,316],{"align":183},[95,317,318],{},"\u003CRoundConvexMeshCollider>",[194,320,321],{"align":183},"Rounded convex mesh generated from mesh geometry.",[178,323,324,329],{},[194,325,326],{"align":183},[95,327,328],{},"\u003CRoundCuboidCollider>",[194,330,331],{"align":183},"Rounded box shape.",[178,333,334,339],{},[194,335,336],{"align":183},[95,337,338],{},"\u003CRoundCylinderCollider>",[194,340,341],{"align":183},"Rounded cylinder shape.",[157,343,344],{},[78,345,346,347,350],{},"Avoid using ",[95,348,349],{},"\u003CTrimeshCollider >"," with dynamic bodies, since the performance get compromised",[352,353,49],"h2",{"id":354},"collisions",[78,356,357,358,362],{},"Similar to ",[359,360,361],"a",{"href":50},"how collisions work in rigid-bodies"," you\ncan set a custom collider to receive collisions events.",[78,364,365,366,368],{},"Be aware that the event will be emitted by the ",[95,367,121],{}," parent",[88,370,372],{"className":90,"code":371,"language":92,"meta":93,"style":93},"\u003Ctemplate>\n  \u003CRigidBody\n    @collision-enter=\"onCollisionEnter\"\n    @collision-exit=\"onCollisionExit\"\n  >\n    \u003CBallCollider activeCollision />\n  \u003C/RigidBody>\n\u003C/template>\n",[95,373,374,382,389,408,422,427,439,448],{"__ignoreMap":93},[98,375,376,378,380],{"class":100,"line":101},[98,377,105],{"class":104},[98,379,109],{"class":108},[98,381,112],{"class":104},[98,383,384,386],{"class":100,"line":115},[98,385,118],{"class":104},[98,387,388],{"class":108},"RigidBody\n",[98,390,391,395,398,401,405],{"class":100,"line":126},[98,392,394],{"class":393},"spNyl","    @collision-enter",[98,396,397],{"class":104},"=",[98,399,400],{"class":104},"\"",[98,402,404],{"class":403},"sfazB","onCollisionEnter",[98,406,407],{"class":104},"\"\n",[98,409,410,413,415,417,420],{"class":100,"line":138},[98,411,412],{"class":393},"    @collision-exit",[98,414,397],{"class":104},[98,416,400],{"class":104},[98,418,419],{"class":403},"onCollisionExit",[98,421,407],{"class":104},[98,423,424],{"class":100,"line":148},[98,425,426],{"class":104},"  >\n",[98,428,430,432,434,437],{"class":100,"line":429},6,[98,431,129],{"class":104},[98,433,132],{"class":108},[98,435,436],{"class":393}," activeCollision",[98,438,135],{"class":104},[98,440,442,444,446],{"class":100,"line":441},7,[98,443,141],{"class":104},[98,445,121],{"class":108},[98,447,112],{"class":104},[98,449,451,453,455],{"class":100,"line":450},8,[98,452,151],{"class":104},[98,454,109],{"class":108},[98,456,112],{"class":104},[352,458,460],{"id":459},"props","Props",[462,463,464,476,486,504,514,523,532,540,550,560],"field-group",{},[465,466,469],"field",{"name":467,"type":468},"shape","ColliderShape",[78,470,471,472,475],{},"Default: ",[95,473,474],{},"cuboid"," - shape of the collider.",[465,477,480],{"name":478,"type":479},"args","[halfWidth: number, halfHeight: number, halfDepth: number] | [radius: number]",[78,481,471,482,485],{},[95,483,484],{},"[1,1,1]"," - The half-sizes of the collider shapes.",[465,487,490],{"name":488,"type":489},"object","TresObject3D",[78,491,492,493,496,497,496,500,503],{},"Required for certain shapes like ",[95,494,495],{},"trimesh",", ",[95,498,499],{},"hull",[95,501,502],{},"heightfield",".",[465,505,508],{"name":506,"type":507},"friction","number",[78,509,471,510,513],{},[95,511,512],{},"0.5"," - The friction coefficient of this collider. (automatic-collider).",[465,515,517],{"name":516,"type":507},"mass",[78,518,471,519,522],{},[95,520,521],{},"1"," - Mass of the collider. (automatic-collider).",[465,524,526],{"name":525,"type":507},"density",[78,527,471,528,531],{},[95,529,530],{},"0"," - Restitution controls how elastic (aka. bouncy) a contact is. (automatic-collider).",[465,533,535],{"name":534,"type":507},"restitution",[78,536,471,537,539],{},[95,538,521],{}," - The collider density. If non-zero the collider's mass and angular inertia will be added. (automatic-collider).",[465,541,544],{"name":542,"type":543},"activeCollision","boolean",[78,545,471,546,549],{},[95,547,548],{},"false"," - To set the collider receiver/emitter collision events.",[465,551,554],{"name":552,"type":553},"activeCollisionTypes","ActiveCollisionTypes",[78,555,471,556,559],{},[95,557,558],{},"ActiveCollisionTypes.DEFAULT"," - Type of the collision event.",[465,561,564],{"name":562,"type":563},"collisionGroups","number | undefined",[78,565,471,566,569],{},[95,567,568],{},"undefined"," - To specify collision groups.",[571,572,573],"prose-note",{},[78,574,575,576,578,579,582,583,503],{},"If you only want to rely on custom colliders you can set ",[95,577,548],{}," to ",[95,580,581],{},"collider"," props, this way you deactivate the ",[359,584,585],{"href":38},"automatic collider",[78,587,588,589,595,596,503],{},"You can access the\n",[359,590,594],{"href":591,"rel":592},"https://rapier.rs/docs/user_guides/javascript/colliders",[593],"nofollow","Collider"," instance\nwhich offers full control over all the properties & methods available by using\n",[359,597,600],{"href":598,"rel":599},"https://vuejs.org/guide/essentials/template-refs.html#template-refs",[593],"Template refs",[352,602,604],{"id":603},"expose-object","Expose object",[462,606,607,621],{},[465,608,610],{"name":609,"type":594},"instance",[78,611,612,613,615,616],{},"The Rapier ",[95,614,594],{}," instance created for this custom collider. ",[359,617,620],{"href":618,"rel":619},"https://rapier.rs/javascript3d/classes/Collider.html",[593],"See API",[465,622,625],{"name":623,"type":624},"colliderDesc","ColliderDesc",[78,626,627,628],{},"The Rapier collider descriptor used to initialize the collider. ",[359,629,620],{"href":630,"rel":631},"https://rapier.rs/javascript3d/classes/ColliderDesc.html",[593],[633,634,635],"style",{},"html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}",{"title":93,"searchDepth":101,"depth":115,"links":637},[638,639,640,641],{"id":169,"depth":126,"text":170},{"id":354,"depth":115,"text":49},{"id":459,"depth":115,"text":460},{"id":603,"depth":115,"text":604},"Add custom colliders not tied to a 3D mesh to define precise collision shapes using cuboid, ball, capsule, hull, trimesh, and other built-in collider types.","md",null,{},true,{"title":41,"description":642},"xwZ0_neaw3mDoxEkh0fhj9WY-PLavjzKoUg86FWRZ4U",[650,652],{"title":37,"path":38,"stem":39,"description":651,"children":-1},"Automatically generated colliders that fit your mesh shape when a RigidBody is created, with support for cuboid, ball, capsule, and other preset shapes.",{"title":45,"path":46,"stem":47,"description":653,"children":-1},"Apply forces and impulses to rigid bodies to drive physics interactions, such as making objects jump or move programmatically.",1789116600848]