PageSourceSearch

https://rapier.rs/assets/js/55923cba.62aa20bb.js

js rapier.rs collected 2026-09-24 19:27:14 UTC 8,834 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkrapier=self.webpackChunkrapier||[]).push([[6109],{8828:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>i,contentTitle:()=>o,default:()=>h,frontMatter:()=>s,metadata:()=>l,toc:()=>c});var a=r(4848),n=r(8453);r(1470),r(9365);const s={},o=void 0,l={id:"user_guides/javascript/character_controller_stairs",title:"character_controller_stairs",description:"If enabled, the autostep setting allows the character to climb stairs automatically and walk over small obstacles.",source:"@site/docs/user_guides/javascript/character_controller_stairs.mdx",sourceDirName:"user_guides/javascript",slug:"/user_guides/javascript/character_controller_stairs",permalink:"/docs/user_guides/javascript/character_controller_stairs",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{}},i={},c=[];function u(e){const t={a:"a",admonition:"admonition",code:"code",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,n.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(t.p,{children:["If enabled, the ",(0,a.jsx)(t.strong,{children:"autostep"})," setting allows the character to climb stairs automatically and walk over small obstacles.\nAutostepping requires the following parameters:"]}),"\n",(0,a.jsxs)(t.ul,{children:["\n",(0,a.jsxs)(t.li,{children:["The ",(0,a.jsx)(t.strong,{children:"maximum height"})," the character can step over. If the vertical movement needed to step over this obstacle is larger\nthan this value, then the character will be stopped by the obstacle."]}),"\n",(0,a.jsxs)(t.li,{children:["The ",(0,a.jsx)(t.strong,{children:"minimum (horizontal) width"})," available on top of the obstacle. If, after the character is teleported on top of the obstacle, it\ncannot move forward by a distance larger than this minimum width, then the character will just be stopped by the obstacle\n(without being moved to the top of the obstacle)."]}),"\n",(0,a.jsxs)(t.li,{children:["Whether or not autostepping is ",(0,a.jsx)(t.strong,{children:"enabled for dynamic bodies"}),". If it is not enabled for dynamic bodies, the character\nwon\u2019t attempt to automatically step over small dynamic bodies. Disabling this can be useful if we want the character to\npush these small objects (see ",(0,a.jsx)(t.a,{href:"/docs/user_guides/javascript/character_controller#collisions",children:"collisions"}),") instead of just stepping over them."]}),"\n"]}),"\n",(0,a.jsx)(t.p,{children:"The following depicts (top) one configuration where all the autostepping conditions are satisfied, and, (bottom) two\nconfigurations where these conditions are not all satisfied (left: because the width of the step is too small, right:\nbecause the height of the step is too large):"}),"\n",(0,a.jsx)(t.p,{children:(0,a.jsx)(t.img,{alt:"autostepping",src:r(4036).A+"",width:"1368",height:"794"})}),"\n",(0,a.jsx)(t.admonition,{type:"info",children:(0,a.jsx)(t.p,{children:"Autostepping will only activate if the character is touching the floor right before the obstacle.\nThis prevents the player from being teleported on to of a platform while it is in the air."})}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-js",children:"let characterController = world.createCharacterController(0.01);\n// Autostep if the step height is smaller than 0.5, its width is larger than 0.2,\n// and allow stepping on dynamic bodies.\ncharacterController.enableAutostep(0.5, 0.2, true);\n// Disable autostep.\ncharacterController.disableAutostep();\n"})})]})}function h(e={}){const{wrapper:t}={...(0,n.R)(),...e.components};return t?(0,a.jsx)(t,{...e,children:(0,a.jsx)(u,{...e})}):u(e)}},9365:(e,t,r)=>{r.d(t,{A:()=>o});r(6540);var a=r(8215);const n={tabItem:"tabItem_Ymn6"};var s=r(4848);function o(e){let{children:t,hidden:r,className:o}=e;return(0,s.jsx)("div",{role:"tabpanel",className:(0,a.A)(n.tabItem,o),hidden:r,children:t})}},1470:(e,t,r)=>{r.d(t,{A:()=>y});var a=r(6540),n=r(8215),s=r(3104),o=r(6347),l=r(205),i=r(7485),c=r(1682),u=r(679);function h(e){return a.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,a.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad <Tabs>
1 child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function d(e){const{values:t,children:r}=e;return(0,a.useMemo)((()=>{const e=t??function(e){return h(e).map((e=>{let{props:{value:t,label:r,attributes:a,default:n}}=e;return{value:t,label:r,attributes:a,default:n}}))}(r);return function(e){const t=(0,c.XI)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in <Tabs>. Every value needs to be unique.`)}(e),e}),[t,r])}function p(e){let{value:t,tabValues:r}=e;return r.some((e=>e.value===t))}function f(e){let{queryString:t=!1,groupId:r}=e;const n=(0,o.W6)(),s=function(e){let{queryString:t=!1,groupId:r}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!r)throw new Error('Docusaurus error: The <Tabs> component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:t,groupId:r});return[(0,i.aZ)(s),(0,a.useCallback)((e=>{if(!s)return;const t=new URLSearchParams(n.location.search);t.set(s,e),n.replace({...n.location,search:t.toString()})}),[s,n])]}function m(e){const{defaultValue:t,queryString:r=!1,groupId:n}=e,s=d(e),[o,i]=(0,a.useState)((()=>function(e){let{defaultValue:t,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(t){if(!p({value:t,tabValues:r}))throw new Error(`Docusaurus error: The <Tabs> has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const a=r.find((e=>e.default))??r[0];if(!a)throw new Error("Unexpected error: 0 tabValues");return a.value}({defaultValue:t,tabValues:s}))),[c,h]=f({queryString:r,groupId:n}),[m,b]=function(e){let{groupId:t}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(t),[n,s]=(0,u.Dv)(r);return[n,(0,a.useCallback)((e=>{r&&s.set(e)}),[r,s])]}({groupId:n}),g=(()=>{const e=c??m;return p({value:e,tabValues:s})?e:null})();(0,l.A)((()=>{g&&i(g)}),[g]);return{selectedValue:o,selectValue:(0,a.useCallback)((e=>{if(!p({value:e,tabValues:s}))throw new Error(`Can't select invalid tab value=${e}`);i(e),h(e),b(e)}),[h,b,s]),tabValues:s}}var b=r(2303);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var v=r(4848);function w(e){let{className:t,block:r,selectedValue:a,selectValue:o,tabValues:l}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,s.a_)(),u=e=>{const t=e.currentTarget,r=i.indexOf(t),n=l[r].value;n!==a&&(c(t),o(n))},h=e=>{let t=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const r=i.indexOf(e.currentTarget)+1;t=i[r]??i[0];break}case"ArrowLeft":{const r=i.indexOf(e.currentTarget)-1;t=i[r]??i[i.length-1];break}}t?.focus()};return(0,v.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,n.A)("tabs",{"tabs--block":r},t),children:l.map((e=>{let{value:t,label:r,attributes:s}=e;return(0,v.jsx)("li",{role:"tab",tabIndex:a===t?0:-1,"aria-selected":a===t,ref:e=>i.push(e),onKeyDown:h,onClick:u,...s,className:(0,n.A)("tabs__item",g.tabItem,s?.className,{"tabs__item--active":a===t}),children:r??t},t)}))})}function j(e){let{lazy:t,children:r,selectedValue:s}=e;const o=(Array.isArray(r)?r:[r]).filter(Boolean);if(t){const e=o.find((e=>e.props.value===s));return e?(0,a.cloneElement)(e,{className:(0,n.A)("margin-top--md",e.props.className)}):null}return(0,v.jsx)("div",{className:"margin-top--md",children:o.map(((e,t)=>(0,a.cloneElement)(e,{key:t,hidden:e.props.value!==s})))})}function x(e){const t=m(e);return(0,v.jsxs)("div",{className:(0,n.A)("tabs-container",g.tabList),children:[(0,v.jsx)(w,{...t,...e}),(0,v.jsx)(j,{...t,...e})]})}function y(e){const t=(0,b.A)();return(0,v.jsx)(x,{...e,children:h(e.children)},String(t))}},4036:(e,t,r)=>{r.d(t,{A:()=>a});const a=r.p+"assets/images/cct_autostep-24533af597f246c979b8fc75801cc289.
1svg"},8453:(e,t,r)=>{r.d(t,{R:()=>o,x:()=>l});var a=r(6540);const n={},s=a.createContext(n);function o(e){const t=a.useContext(s);return a.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:o(e.components),a.createElement(s.Provider,{value:t},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.