[{"data":1,"prerenderedAt":858},["ShallowReactive",2],{"navigation":3,"/api/rigid-body":72,"/api/rigid-body-surround":853},[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":31,"body":74,"description":846,"extension":847,"links":848,"meta":849,"navigation":850,"path":32,"seo":851,"stem":33,"__hash__":852},"docs/2.api/1.rigid-body/index.md",{"type":75,"value":76,"toc":837},"minimark",[77,93,110,116,121,136,250,254,264,267,397,402,461,472,476,696,715,719,777,781,833],[78,79,80,84,85,88,89,92],"p",{},[81,82,83],"code",{},"@tresjs/rapier"," provides a ",[81,86,87],{},"RigidBody"," component compatible with the ",[81,90,91],{},"Tresjs","\necosystem, with the advantage of making the \"bound\" between the two worlds\n(physic world and our 3D scene).",[94,95,96],"prose-note",{},[78,97,98,99,102,103],{},"The information on this page is a summary of the ",[100,101,87],"strong",{}," instance, please check the ",[104,105,109],"a",{"href":106,"rel":107},"https://rapier.rs/docs/user_guides/javascript/rigid_bodies",[108],"nofollow","original Rapier documentation",[111,112,113],"scene-wrapper",{},[114,115],"demos-rigid-body",{},[117,118,120],"h2",{"id":119},"basic-usage","Basic usage",[78,122,123,124,126,127,129,130,135],{},"To use a ",[81,125,87],{}," component, import it from\n",[81,128,83],{}," and then pass the element you want to attach via\n",[104,131,134],{"href":132,"rel":133},"https://vuejs.org/guide/components/slots.html#scoped-slots",[108],"slot",".",[137,138,143],"pre",{"className":139,"code":140,"language":141,"meta":142,"style":142},"language-vue shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u003Ctemplate>\n  \u003CRigidBody>\n    \u003CTresMesh :position=\"[0, 8, 0]\">\n      \u003CTresTorusGeometry />\n      \u003CTresMeshNormalMaterial />\n    \u003C/TresMesh>\n  \u003C/RigidBody>\n\u003C/template>\n","vue","",[81,144,145,161,171,198,210,220,230,240],{"__ignoreMap":142},[146,147,150,154,158],"span",{"class":148,"line":149},"line",1,[146,151,153],{"class":152},"sMK4o","\u003C",[146,155,157],{"class":156},"swJcz","template",[146,159,160],{"class":152},">\n",[146,162,164,167,169],{"class":148,"line":163},2,[146,165,166],{"class":152},"  \u003C",[146,168,87],{"class":156},[146,170,160],{"class":152},[146,172,174,177,180,184,187,190,194,196],{"class":148,"line":173},3,[146,175,176],{"class":152},"    \u003C",[146,178,179],{"class":156},"TresMesh",[146,181,183],{"class":182},"spNyl"," :position",[146,185,186],{"class":152},"=",[146,188,189],{"class":152},"\"",[146,191,193],{"class":192},"sfazB","[0, 8, 0]",[146,195,189],{"class":152},[146,197,160],{"class":152},[146,199,201,204,207],{"class":148,"line":200},4,[146,202,203],{"class":152},"      \u003C",[146,205,206],{"class":156},"TresTorusGeometry",[146,208,209],{"class":152}," />\n",[146,211,213,215,218],{"class":148,"line":212},5,[146,214,203],{"class":152},[146,216,217],{"class":156},"TresMeshNormalMaterial",[146,219,209],{"class":152},[146,221,223,226,228],{"class":148,"line":222},6,[146,224,225],{"class":152},"    \u003C/",[146,227,179],{"class":156},[146,229,160],{"class":152},[146,231,233,236,238],{"class":148,"line":232},7,[146,234,235],{"class":152},"  \u003C/",[146,237,87],{"class":156},[146,239,160],{"class":152},[146,241,243,246,248],{"class":148,"line":242},8,[146,244,245],{"class":152},"\u003C/",[146,247,157],{"class":156},[146,249,160],{"class":152},[117,251,253],{"id":252},"types","Types",[78,255,256,257,259,260,263],{},"We can specify which kind of ",[81,258,87],{}," type we want. By default is set to ",[81,261,262],{},"Dynamic","(see below).",[78,265,266],{},"A basic floor example with type fixed:",[137,268,270],{"className":139,"code":269,"language":141,"meta":142,"style":142},"\u003Ctemplate>\n  \u003CRigidBody type=\"fixed\">\n    \u003CTresMesh :position=\"[0, 0, 0]\">\n      \u003CTresPlaneGeometry :args=\"[20, 20, 20]\" :rotate-x=\"-Math.PI / 2\" />\n      \u003CTresMeshBasicMaterial color=\"#f4f4f4\" />\n    \u003C/TresMesh>\n  \u003C/RigidBody>\n\u003C/template>\n",[81,271,272,280,300,319,352,373,381,389],{"__ignoreMap":142},[146,273,274,276,278],{"class":148,"line":149},[146,275,153],{"class":152},[146,277,157],{"class":156},[146,279,160],{"class":152},[146,281,282,284,286,289,291,293,296,298],{"class":148,"line":163},[146,283,166],{"class":152},[146,285,87],{"class":156},[146,287,288],{"class":182}," type",[146,290,186],{"class":152},[146,292,189],{"class":152},[146,294,295],{"class":192},"fixed",[146,297,189],{"class":152},[146,299,160],{"class":152},[146,301,302,304,306,308,310,312,315,317],{"class":148,"line":173},[146,303,176],{"class":152},[146,305,179],{"class":156},[146,307,183],{"class":182},[146,309,186],{"class":152},[146,311,189],{"class":152},[146,313,314],{"class":192},"[0, 0, 0]",[146,316,189],{"class":152},[146,318,160],{"class":152},[146,320,321,323,326,329,331,333,336,338,341,343,345,348,350],{"class":148,"line":200},[146,322,203],{"class":152},[146,324,325],{"class":156},"TresPlaneGeometry",[146,327,328],{"class":182}," :args",[146,330,186],{"class":152},[146,332,189],{"class":152},[146,334,335],{"class":192},"[20, 20, 20]",[146,337,189],{"class":152},[146,339,340],{"class":182}," :rotate-x",[146,342,186],{"class":152},[146,344,189],{"class":152},[146,346,347],{"class":192},"-Math.PI / 2",[146,349,189],{"class":152},[146,351,209],{"class":152},[146,353,354,356,359,362,364,366,369,371],{"class":148,"line":212},[146,355,203],{"class":152},[146,357,358],{"class":156},"TresMeshBasicMaterial",[146,360,361],{"class":182}," color",[146,363,186],{"class":152},[146,365,189],{"class":152},[146,367,368],{"class":192},"#f4f4f4",[146,370,189],{"class":152},[146,372,209],{"class":152},[146,374,375,377,379],{"class":148,"line":222},[146,376,225],{"class":152},[146,378,179],{"class":156},[146,380,160],{"class":152},[146,382,383,385,387],{"class":148,"line":232},[146,384,235],{"class":152},[146,386,87],{"class":156},[146,388,160],{"class":152},[146,390,391,393,395],{"class":148,"line":242},[146,392,245],{"class":152},[146,394,157],{"class":156},[146,396,160],{"class":152},[398,399,401],"h3",{"id":400},"available-types","Available types",[403,404,405,418],"table",{},[406,407,408],"thead",{},[409,410,411,415],"tr",{},[412,413,252],"th",{"align":414},"left",[412,416,417],{"align":414},"Description",[419,420,421,431,441,451],"tbody",{},[409,422,423,428],{},[424,425,426],"td",{"align":414},[81,427,262],{},[424,429,430],{"align":414},"Indicates that the body is affected by external forces and contacts.",[409,432,433,438],{},[424,434,435],{"align":414},[81,436,437],{},"Fixed",[424,439,440],{"align":414},"Indicates the body cannot move. It acts as if it has an infinite mass and will not be affected by any force.",[409,442,443,448],{},[424,444,445],{"align":414},[81,446,447],{},"KinematicPositionBased",[424,449,450],{"align":414},"Indicates that the body position must not be altered by the physics engine.",[409,452,453,458],{},[424,454,455],{"align":414},[81,456,457],{},"KinematicVelocityBased",[424,459,460],{"align":414},"Indicates that the body velocity must not be altered by the physics engine.",[462,463,464],"info",{},[78,465,466,467],{},"Both position-based and velocity-based kinematic bodies are mostly the\nsame. Choosing between both is mostly a matter of preference between\nposition-based control and velocity-based control.\nMore info at ",[104,468,471],{"href":469,"rel":470},"https://rapier.rs/docs/user_guides/javascript/rigid_bodies#rigid-body-type",[108],"Rigid-body type",[117,473,475],{"id":474},"props","Props",[477,478,479,495,505,517,528,536,544,552,562,570,580,588,598,606,614,623,631,639,647,655,665,675,681],"field-group",{},[480,481,484],"field",{"name":482,"type":483},"type","RigidBodyType",[78,485,486,487,490,491,494],{},"Default: ",[81,488,489],{},"dynamic"," - ",[81,492,493],{},"rigidBody"," type.",[480,496,499],{"name":497,"type":498},"collider","ColliderShape | false",[78,500,486,501,504],{},[81,502,503],{},"cuboid"," - automatic collider.",[480,506,509],{"name":507,"type":508},"gravityScale","number",[78,510,486,511,514,515,135],{},[81,512,513],{},"1"," - gravity for the ",[81,516,493],{},[480,518,520],{"name":519,"type":508},"additionalMass",[78,521,486,522,525,526,135],{},[81,523,524],{},"0"," - add extra mass to the ",[81,527,493],{},[480,529,531],{"name":530,"type":508},"linearDamping",[78,532,486,533,535],{},[81,534,524],{}," - set the linear damping.",[480,537,539],{"name":538,"type":508},"angularDamping",[78,540,486,541,543],{},[81,542,524],{}," - set the angular damping.",[480,545,547],{"name":546,"type":508},"dominanceGroup",[78,548,486,549,551],{},[81,550,524],{}," - set the dominance group.",[480,553,556],{"name":554,"type":555},"linvel","TresVector3 | THREE.Vector3",[78,557,486,558,561],{},[81,559,560],{},"x: 0, y: 0, z: 0"," - linear velocity.",[480,563,565],{"name":564,"type":555},"angvel",[78,566,486,567,569],{},[81,568,560],{}," - angular velocity.",[480,571,574],{"name":572,"type":573},"enabledRotations","[x: boolean, y: boolean, z: boolean]",[78,575,486,576,579],{},[81,577,578],{},"{x: true, y: true, z: true }"," - enable rotations in specific axis.",[480,581,583],{"name":582,"type":573},"enabledTranslations",[78,584,486,585,587],{},[81,586,578],{}," - enable translations in specific axis.",[480,589,592],{"name":590,"type":591},"lockTranslations","boolean",[78,593,486,594,597],{},[81,595,596],{},"false"," - Lock all translations.",[480,599,601],{"name":600,"type":591},"lockRotations",[78,602,486,603,605],{},[81,604,596],{}," - Lock all rotations.",[480,607,609],{"name":608,"type":591},"enableCcd",[78,610,486,611,613],{},[81,612,596],{}," - Enable continuous collision detection.",[480,615,617],{"name":616,"type":508},"friction",[78,618,486,619,622],{},[81,620,621],{},"0.5"," - The friction coefficient of this collider. (automatic-collider).",[480,624,626],{"name":625,"type":508},"mass",[78,627,486,628,630],{},[81,629,513],{}," - Mass of the collider. (automatic-collider).",[480,632,634],{"name":633,"type":508},"density",[78,635,486,636,638],{},[81,637,524],{}," - Restitution controls how elastic (aka. bouncy) a contact is. (automatic-collider).",[480,640,642],{"name":641,"type":508},"restitution",[78,643,486,644,646],{},[81,645,513],{}," - The collider density. If non-zero the collider's mass and angular inertia will be added. (automatic-collider).",[480,648,650],{"name":649,"type":591},"activeCollision",[78,651,486,652,654],{},[81,653,596],{}," - To set the collider receiver/emitter collision events (automatic-collider).",[480,656,659],{"name":657,"type":658},"activeCollisionTypes","ActiveCollisionTypes",[78,660,486,661,664],{},[81,662,663],{},"ActiveCollisionTypes.DEFAULT"," - Type of the collision event. (automatic-collider).",[480,666,669],{"name":667,"type":668},"collisionGroups","number | undefined",[78,670,486,671,674],{},[81,672,673],{},"undefined"," - To specify collision groups. (automatic-collider).",[480,676,677],{"name":649,"type":591},[78,678,486,679,654],{},[81,680,596],{},[480,682,684],{"name":683,"type":591},"activeContactForce",[78,685,486,686,688,689,692,693,135],{},[81,687,596],{}," - Enables contact-force events. Required to use the ",[81,690,691],{},"@contact-force"," event. See ",[104,694,695],{"href":58},"Contact Force",[94,697,698],{},[78,699,700,701,703,704,709,710,135],{},"The ",[81,702,493],{}," instance has many other functions, please check the\n",[104,705,708],{"href":706,"rel":707},"https://rapier.rs/docs/api/javascript/JavaScript3D/",[108],"official docs"," for a\ncomplete list, if you need them, you can\nuse",[104,711,714],{"href":712,"rel":713},"https://vuejs.org/guide/essentials/template-refs.html#template-refs",[108],"Template ref",[117,716,718],{"id":717},"events","Events",[477,720,721,733,743,758,770],{},[480,722,725],{"name":723,"type":724},"collision-enter","(payload: { source: SourceTarget, target: SourceTarget }) => void",[78,726,727,728,730,731,135],{},"Triggered when a collider starts colliding with another collider. Requires ",[81,729,649],{}," prop to be set. See ",[104,732,49],{"href":50},[480,734,736],{"name":735,"type":724},"collision-exit",[78,737,738,739,730,741,135],{},"Triggered when a collider stops colliding with another collider. Requires ",[81,740,649],{},[104,742,49],{"href":50},[480,744,746],{"name":745,"type":724},"intersection-enter",[78,747,748,749,751,752,755,756,135],{},"Triggered when a sensor collider starts intersecting another collider. Requires ",[81,750,649],{}," and ",[81,753,754],{},"sensor"," props. See ",[104,757,53],{"href":54},[480,759,761],{"name":760,"type":724},"intersection-exit",[78,762,763,764,751,766,755,768,135],{},"Triggered when a sensor collider stops intersecting another collider. Requires ",[81,765,649],{},[81,767,754],{},[104,769,53],{"href":54},[480,771,774],{"name":772,"type":773},"contact-force","(payload: ContactForcePayload) => void",[78,775,776],{},"Triggered every simulation step while two colliders are in contact and the force exceeds the threshold.",[117,778,780],{"id":779},"expose-object","Expose object",[477,782,783,796,807,818],{},[480,784,786],{"name":785,"type":87},"instance",[78,787,700,788,790,791],{},[81,789,87],{}," instance created by Rapier. ",[104,792,795],{"href":793,"rel":794},"https://rapier.rs/javascript3d/classes/RigidBody.html",[108],"See API",[480,797,800],{"name":798,"type":799},"rigidBodyDesc","RigidBodyDesc",[78,801,802,803],{},"The Rapier rigid-body descriptor used to initialize the body. ",[104,804,795],{"href":805,"rel":806},"https://rapier.rs/javascript3d/classes/RigidBodyDesc.html",[108],[480,808,811],{"name":809,"type":810},"context","RigidBodyContext",[78,812,813,814,817],{},"Collider context information (",[81,815,816],{},"colliderInfos",") associated with this rigid body.",[480,819,822],{"name":820,"type":821},"group","TresObject3D",[78,823,824,825,828,829],{},"Parent Three.js object/group (",[81,826,827],{},"parentObject",") that contains the bound scene node. ",[104,830,795],{"href":831,"rel":832},"https://threejs.org/docs/#api/en/core/Object3D",[108],[834,835,836],"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 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}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);}",{"title":142,"searchDepth":149,"depth":163,"links":838},[839,840,843,844,845],{"id":119,"depth":163,"text":120},{"id":252,"depth":163,"text":253,"children":841},[842],{"id":400,"depth":173,"text":401},{"id":474,"depth":163,"text":475},{"id":717,"depth":163,"text":718},{"id":779,"depth":163,"text":780},"The real-time simulation of rigid-bodies subjected to forces and contacts is the main feature of a physics engine for video-games, robotics, or animation.","md",null,{},true,{"title":31,"description":846},"rajGsRBPislAXPaHwRKNgw3IaUCSqlg7z06qhTemJQ4",[854,856],{"title":28,"path":24,"stem":29,"description":855,"children":-1},"The main component for render.",{"title":37,"path":38,"stem":39,"description":857,"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.",1789116600847]