Files
website/assets/js/57a1f8cb.9da7858d.js
2021-07-22 08:43:46 -05:00

1 line
5.6 KiB
JavaScript

(self.webpackChunkstardust_website=self.webpackChunkstardust_website||[]).push([[925],{3905:function(e,t,r){"use strict";r.d(t,{Zo:function(){return p},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 a(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 c=n.createContext({}),l=function(e){var t=n.useContext(c),r=t;return e&&(r="function"==typeof e?e(t):a(a({},t),e)),r},p=function(e){var t=l(e.components);return n.createElement(c.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},u=n.forwardRef((function(e,t){var r=e.components,o=e.mdxType,i=e.originalType,c=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),u=l(r),f=o,m=u["".concat(c,".").concat(f)]||u[f]||d[f]||i;return r?n.createElement(m,a(a({ref:t},p),{},{components:r})):n.createElement(m,a({ref:t},p))}));function f(e,t){var r=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var i=r.length,a=new Array(i);a[0]=u;var s={};for(var c in t)hasOwnProperty.call(t,c)&&(s[c]=t[c]);s.originalType=e,s.mdxType="string"==typeof e?e:o,a[1]=s;for(var l=2;l<i;l++)a[l]=r[l];return n.createElement.apply(null,a)}return n.createElement.apply(null,r)}u.displayName="MDXCreateElement"},5428:function(e,t,r){"use strict";r.r(t),r.d(t,{frontMatter:function(){return s},contentTitle:function(){return c},metadata:function(){return l},toc:function(){return p},default:function(){return u}});var n=r(2122),o=r(9756),i=(r(7294),r(3905)),a=["components"],s={},c="Field",l={unversionedId:"stardust-protocol/server/types/field/Field",id:"stardust-protocol/server/types/field/Field",isDocsHomePage:!1,title:"Field",description:"Derived from Spatial",source:"@site/docs/stardust-protocol/server/types/field/Field.md",sourceDirName:"stardust-protocol/server/types/field",slug:"/stardust-protocol/server/types/field/Field",permalink:"/docs/stardust-protocol/server/types/field/Field",editUrl:"https://github.com/StardustXR/website/edit/main/docs/stardust-protocol/server/types/field/Field.md",version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"BoxField",permalink:"/docs/stardust-protocol/server/types/field/BoxField"},next:{title:"SphereField",permalink:"/docs/stardust-protocol/server/types/field/SphereField"}},p=[{value:"Derived from Spatial",id:"derived-from-spatial",children:[]},{value:"Methods",id:"methods",children:[{value:"<code>double distance(string spacePath, Vector3 point)</code>",id:"double-distancestring-spacepath-vector3-point",children:[]},{value:"<code>Vector3 normal(string spacePath, Vector3 point)</code>",id:"vector3-normalstring-spacepath-vector3-point",children:[]},{value:"<code>Vector3 closestPoint(string spacePath, Vector3 point)</code>",id:"vector3-closestpointstring-spacepath-vector3-point",children:[]}]}],d={toc:p};function u(e){var t=e.components,r=(0,o.Z)(e,a);return(0,i.kt)("wrapper",(0,n.Z)({},d,r,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"field"},"Field"),(0,i.kt)("h3",{id:"derived-from-spatial"},"Derived from ",(0,i.kt)("a",{parentName:"h3",href:"../Spatial"},"Spatial")),(0,i.kt)("p",null,"Type that contains methods all Fields share. All fields created are under ",(0,i.kt)("inlineCode",{parentName:"p"},"/field"),". See ",(0,i.kt)("a",{parentName:"p",href:"/docs/stardust-protocol/server/objects/field"},"/field")," for the field factory."),(0,i.kt)("h2",{id:"methods"},"Methods"),(0,i.kt)("h3",{id:"double-distancestring-spacepath-vector3-point"},(0,i.kt)("inlineCode",{parentName:"h3"},"double distance(string spacePath, Vector3 point)")),(0,i.kt)("p",null,"Returns the distance from ",(0,i.kt)("inlineCode",{parentName:"p"},"point")," to the surface of the object, positive if the point is outside and negative if inside. When ",(0,i.kt)("inlineCode",{parentName:"p"},"point")," is far enough away the object will give an approximate distance to the origin instead of the surface."),(0,i.kt)("h3",{id:"vector3-normalstring-spacepath-vector3-point"},(0,i.kt)("inlineCode",{parentName:"h3"},"Vector3 normal(string spacePath, Vector3 point)")),(0,i.kt)("p",null,"Returns the normal of ",(0,i.kt)("inlineCode",{parentName:"p"},"point")," compared to the surface of the object. Normal always points toward object."),(0,i.kt)("h3",{id:"vector3-closestpointstring-spacepath-vector3-point"},(0,i.kt)("inlineCode",{parentName:"h3"},"Vector3 closestPoint(string spacePath, Vector3 point)")),(0,i.kt)("p",null,"Returns the closest point from ",(0,i.kt)("inlineCode",{parentName:"p"},"point")," to the surface of the object. Use this instead of ",(0,i.kt)("inlineCode",{parentName:"p"},"distance")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"normal")," when best to limit IPC calls."))}u.isMDXComponent=!0}}]);