[{"data":1,"prerenderedAt":659},["ShallowReactive",2],{"navigation":3,"/api/rigid-body/custom-colliders":72,"/api/rigid-body/custom-colliders-surround":654},[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":647,"extension":648,"links":649,"meta":650,"navigation":651,"path":42,"seo":652,"stem":43,"__hash__":653},"docs/2.api/1.rigid-body/2.custom-colliders.md",{"type":75,"value":76,"toc":641},"minimark",[77,81,87,156,166,171,342,351,355,363,369,462,466,575,591,606,610,637],[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,411,427,432,444,453],{"__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,394,398,401,404,408],{"class":100,"line":126},[98,392,393],{"class":104},"    @",[98,395,397],{"class":396},"spNyl","collision-enter",[98,399,400],{"class":104},"=",[98,402,403],{"class":104},"\"",[98,405,407],{"class":406},"sTEyZ","onCollisionEnter",[98,409,410],{"class":104},"\"\n",[98,412,413,415,418,420,422,425],{"class":100,"line":138},[98,414,393],{"class":104},[98,416,417],{"class":396},"collision-exit",[98,419,400],{"class":104},[98,421,403],{"class":104},[98,423,424],{"class":406},"onCollisionExit",[98,426,410],{"class":104},[98,428,429],{"class":100,"line":148},[98,430,431],{"class":104},"  >\n",[98,433,435,437,439,442],{"class":100,"line":434},6,[98,436,129],{"class":104},[98,438,132],{"class":108},[98,440,441],{"class":396}," activeCollision",[98,443,135],{"class":104},[98,445,447,449,451],{"class":100,"line":446},7,[98,448,141],{"class":104},[98,450,121],{"class":108},[98,452,112],{"class":104},[98,454,456,458,460],{"class":100,"line":455},8,[98,457,151],{"class":104},[98,459,109],{"class":108},[98,461,112],{"class":104},[352,463,465],{"id":464},"props","Props",[467,468,469,481,491,509,519,528,537,545,555,565],"field-group",{},[470,471,474],"field",{"name":472,"type":473},"shape","ColliderShape",[78,475,476,477,480],{},"Default: ",[95,478,479],{},"cuboid"," - shape of the collider.",[470,482,485],{"name":483,"type":484},"args","[halfWidth: number, halfHeight: number, halfDepth: number] | [radius: number]",[78,486,476,487,490],{},[95,488,489],{},"[1,1,1]"," - The half-sizes of the collider shapes.",[470,492,495],{"name":493,"type":494},"object","TresObject3D",[78,496,497,498,501,502,501,505,508],{},"Required for certain shapes like ",[95,499,500],{},"trimesh",", ",[95,503,504],{},"hull",[95,506,507],{},"heightfield",".",[470,510,513],{"name":511,"type":512},"friction","number",[78,514,476,515,518],{},[95,516,517],{},"0.5"," - The friction coefficient of this collider. (automatic-collider).",[470,520,522],{"name":521,"type":512},"mass",[78,523,476,524,527],{},[95,525,526],{},"1"," - Mass of the collider. (automatic-collider).",[470,529,531],{"name":530,"type":512},"density",[78,532,476,533,536],{},[95,534,535],{},"0"," - Restitution controls how elastic (aka. bouncy) a contact is. (automatic-collider).",[470,538,540],{"name":539,"type":512},"restitution",[78,541,476,542,544],{},[95,543,526],{}," - The collider density. If non-zero the collider's mass and angular inertia will be added. (automatic-collider).",[470,546,549],{"name":547,"type":548},"activeCollision","boolean",[78,550,476,551,554],{},[95,552,553],{},"false"," - To set the collider receiver/emitter collision events.",[470,556,559],{"name":557,"type":558},"activeCollisionTypes","ActiveCollisionTypes",[78,560,476,561,564],{},[95,562,563],{},"ActiveCollisionTypes.DEFAULT"," - Type of the collision event.",[470,566,569],{"name":567,"type":568},"collisionGroups","number | undefined",[78,570,476,571,574],{},[95,572,573],{},"undefined"," - To specify collision groups.",[576,577,578],"prose-note",{},[78,579,580,581,583,584,587,588,508],{},"If you only want to rely on custom colliders you can set ",[95,582,553],{}," to ",[95,585,586],{},"collider"," props, this way you deactivate the ",[359,589,590],{"href":38},"automatic collider",[78,592,593,594,600,601,508],{},"You can access the\n",[359,595,599],{"href":596,"rel":597},"https://rapier.rs/docs/user_guides/javascript/colliders",[598],"nofollow","Collider"," instance\nwhich offers full control over all the properties & methods available by using\n",[359,602,605],{"href":603,"rel":604},"https://vuejs.org/guide/essentials/template-refs.html#template-refs",[598],"Template refs",[352,607,609],{"id":608},"expose-object","Expose object",[467,611,612,626],{},[470,613,615],{"name":614,"type":599},"instance",[78,616,617,618,620,621],{},"The Rapier ",[95,619,599],{}," instance created for this custom collider. ",[359,622,625],{"href":623,"rel":624},"https://rapier.rs/javascript3d/classes/Collider.html",[598],"See API",[470,627,630],{"name":628,"type":629},"colliderDesc","ColliderDesc",[78,631,632,633],{},"The Rapier collider descriptor used to initialize the collider. ",[359,634,625],{"href":635,"rel":636},"https://rapier.rs/javascript3d/classes/ColliderDesc.html",[598],[638,639,640],"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 .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}",{"title":93,"searchDepth":101,"depth":115,"links":642},[643,644,645,646],{"id":169,"depth":126,"text":170},{"id":354,"depth":115,"text":49},{"id":464,"depth":115,"text":465},{"id":608,"depth":115,"text":609},"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":647},"2iEDJCeo8gjPBta9RSeCcnRuC6Q5lmx8DSLvr_a8tuo",[655,657],{"title":37,"path":38,"stem":39,"description":656,"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":658,"children":-1},"Apply forces and impulses to rigid bodies to drive physics interactions, such as making objects jump or move programmatically.",1781680040529]