PageSourceSearch

https://tresjs.org/_nuxt/Z_iAnPki.js

js tresjs.org collected 2026-09-25 19:45:28 UTC 2,931 bytes, 1 lines download raw bytes

1import{P as v,R as u,S as g,_ as x}from"./qlyfzP0o.js";import{aw as S,o as k,q as M,t,B as e,v as B,x as s,y as o,Q as C,cc as w,F as d,s as i,g as z,aO as A}from"./Cr3hWB_6.js";import{_ as G}from"./1Mje7mq2.js";import{O}from"./wbTHiZj4.js";const P=A(G),D={class:"relative h-full w-full overflow-hidden"},E={class:"absolute top-3 left-3 z-10 flex items-center gap-2 text-xs"},r=1.4,p=5,J=S({__name:"EmbedSceneRapierJoints",setup(N){const y=i(null),c=i(null),f=i(null),m=i(null),l=i(!0),b=[[0,-r/2,0],[0,r/2,0]],a=z(()=>({transparent:l.value,opacity:l.value?.35:1}));function h(){const _=m.value?.instance;_&&_.applyImpulse({x:18,y:4,z:(Math.random()-.5)*12},!0)}return(_,n)=>{const R=x,T=P;return k(),M("div",D,[t("div",E,[t("button",{type:"button",class:"cursor-pointer rounded-md bg-zinc-900/80 px-3 py-1.5 font-medium text-white backdrop-blur transition hover:bg-zinc-900",onClick:h}," Give it a push "),t("button",{type:"button",class:"cursor-pointer rounded-md bg-zinc-900/80 px-3 py-1.5 font-medium text-white backdrop-blur transition hover:bg-zinc-900",onClick:n[0]||(n[0]=j=>l.value=!e(l))},B(e(l)?"Hide":"Show")+" colliders ",1)]),s(T,{"clear-color":"#82DBC5"},{default:o(()=>[n[5]||(n[5]=t("TresPerspectiveCamera",{position:[1,3.2,9],"look-at":[0,3,0]},null,-1)),s(e(O),{target:[0,3,0],"enable-pan":!1}),(k(),C(w,null,{default:o(()=>[s(e(v),{debug:e(l)},{default:o(()=>[s(e(u),{ref_key:"anchorRef",ref:y,type:"kinematic",position:[0,p,0]},{default:o(()=>[t("TresMesh",null,[n[1]||(n[1]=t("TresBoxGeometry",{args:[1,.5,1]},null,-1)),t("TresMeshStandardMaterial",d({color:"#f4f4f4"},e(a)),null,16)])]),_:1},8,["position"]),s(e(u),{ref_key:"linkARef",ref:c,collider:"ball",position:[0,p-r,0]},{default:o(()=>[t("TresMesh",null,[n[2]||(n[2]=t("TresSphereGeometry",{args:[.5,32,32]},null,-1)),t("TresMeshStandardMaterial",d({color:"#5672cd"},e(a)),null,16)])]),_:1},8,["position"]),s(e(u),{ref_key:"linkBRef",ref:f,collider:"ball",position:[0,p-r*2,0]},{default:o(()=>[t("TresMesh",null,[n[3]||(n[3]=t("TresSphereGeometry",{args:[.5,32,32]},null,-1)),t("TresMeshStandardMaterial",d({color:"#5672cd"},e(a)),null,16)])]),_:1},8,["position"]),s(e(u),{ref_key:"linkCRef",ref:m,collider:"ball",position:[0,p-r*3,0],restitution:.4},{default:o(()=>[t("TresMesh",null,[n[4]||(n[4]=t("TresSphereGeometry",{args:[.5,32,32]},null,-1)),t("TresMeshStandardMaterial",d({color:"#ff5d8f"},e(a)),null,16)])]),_:1},8,["position"]),s(e(g),{bodies:[e(y)?.instance,e(c)?.instance],params:b},null,8,["bodies"]),s(e(g),{bodies:[e(c)?.instance,e(f)?.instance],params:b},null,8,["bodies"]),s(e(g),{bodies:[e(f)?.instance,e(m)?.instance],params:b},null,8,["bodies"]),s(R,{size:16,height:3})]),_:1},8,["debug"])]),_:1})),n[6]||(n[6]=t("TresAmbientLight",{intensity:.6},null,-1)),n[7]||(n[7]=t("TresDirectionalLight",{position:[5,10,5],intensity:1.5},null,-1))]),_:1})])}}}),q=Object.assign(J,{__name:"BlogEmbedSceneRapierJoints"});export{q as default};

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.