1 line
4.7 KiB
JavaScript
1 line
4.7 KiB
JavaScript
(self.webpackChunkstardust_website=self.webpackChunkstardust_website||[]).push([[734],{3905:function(e,t,r){"use strict";r.d(t,{Zo:function(){return u},kt:function(){return f}});var n=r(7294);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var a=n.createContext({}),l=function(e){var t=n.useContext(a),r=t;return e&&(r="function"==typeof e?e(t):c(c({},t),e)),r},u=function(e){var t=l(e.components);return n.createElement(a.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var r=e.components,o=e.mdxType,i=e.originalType,a=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),d=l(r),f=o,m=d["".concat(a,".").concat(f)]||d[f]||p[f]||i;return r?n.createElement(m,c(c({ref:t},u),{},{components:r})):n.createElement(m,c({ref:t},u))}));function f(e,t){var r=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var i=r.length,c=new Array(i);c[0]=d;var s={};for(var a in t)hasOwnProperty.call(t,a)&&(s[a]=t[a]);s.originalType=e,s.mdxType="string"==typeof e?e:o,c[1]=s;for(var l=2;l<i;l++)c[l]=r[l];return n.createElement.apply(null,c)}return n.createElement.apply(null,r)}d.displayName="MDXCreateElement"},1524:function(e,t,r){"use strict";r.r(t),r.d(t,{frontMatter:function(){return s},contentTitle:function(){return a},metadata:function(){return l},toc:function(){return u},default:function(){return d}});var n=r(2122),o=r(9756),i=(r(7294),r(3905)),c=["components"],s={},a="/lifecycle",l={unversionedId:"stardust-protocol/server/objects/lifecycle",id:"stardust-protocol/server/objects/lifecycle",isDocsHomePage:!1,title:"/lifecycle",description:"Object representing the life cycle of the Stardust server, from start to each frame to end.",source:"@site/docs/stardust-protocol/server/objects/lifecycle.md",sourceDirName:"stardust-protocol/server/objects",slug:"/stardust-protocol/server/objects/lifecycle",permalink:"/docs/stardust-protocol/server/objects/lifecycle",editUrl:"https://github.com/StardustXR/website/edit/main/docs/stardust-protocol/server/objects/lifecycle.md",version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"/input",permalink:"/docs/stardust-protocol/server/objects/input"},next:{title:"/model",permalink:"/docs/stardust-protocol/server/objects/model"}},u=[{value:"Signals",id:"signals",children:[{value:"<code>subscribeLogicStep(string path, string method)</code>",id:"subscribelogicstepstring-path-string-method",children:[]}]}],p={toc:u};function d(e){var t=e.components,r=(0,o.Z)(e,c);return(0,i.kt)("wrapper",(0,n.Z)({},p,r,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"lifecycle"},"/lifecycle"),(0,i.kt)("p",null,"Object representing the life cycle of the Stardust server, from start to each frame to end."),(0,i.kt)("h2",{id:"signals"},"Signals"),(0,i.kt)("h3",{id:"subscribelogicstepstring-path-string-method"},(0,i.kt)("inlineCode",{parentName:"h3"},"subscribeLogicStep(string path, string method)")),(0,i.kt)("p",null,"Executes ",(0,i.kt)("inlineCode",{parentName:"p"},"method")," on object at ",(0,i.kt)("inlineCode",{parentName:"p"},"path")," on the client when the main logic loop of the server starts each frame."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"method")," must have arguments of ",(0,i.kt)("inlineCode",{parentName:"p"},"(double delta, double timeToRender)"),". "),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"delta")," gives the time in seconds between the current time and the last time the logic loop executed while ",(0,i.kt)("inlineCode",{parentName:"p"},"timeToRender")," gives the time in ms since epoch when the current frame is expected to reach the user's eyes (returns 0 for now)."))}d.isMDXComponent=!0}}]); |