(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=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=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;ldouble distance(string spacePath, Vector3 point)",id:"double-distancestring-spacepath-vector3-point",children:[]},{value:"Vector3 normal(string spacePath, Vector3 point)",id:"vector3-normalstring-spacepath-vector3-point",children:[]},{value:"Vector3 closestPoint(string spacePath, Vector3 point)",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}}]);