Gathering detailed insights and metrics for @antpb/xr-publisher
Gathering detailed insights and metrics for @antpb/xr-publisher
Gathering detailed insights and metrics for @antpb/xr-publisher
Gathering detailed insights and metrics for @antpb/xr-publisher
npm install @antpb/xr-publisher
Typescript
Module System
Node Version
NPM Version
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
21
XR Publisher is a powerful JavaScript library for creating immersive 3D virtual worlds with support for VR, networking, and AI-powered NPCs. Built on top of React and Three.js, it provides a declarative way to build interactive 3D environments.
STILL IN DEVELOPMENT USE AT YOUR OWN RISK OF FREQENT CHANGES - DEVELOPMENT IS ON THE BRANCH "development" wait until there is a release before using in production
1import { XRPublisher } from 'xr-publisher';
1const publisher = new XRPublisher({ 2 threeObjectPlugin: 'path/to/plugin', 3 defaultAvatarAnimation: '', 4 defaultAvatar: 'path/to/default/avatar.vrm', 5 multiplayerAccess: 'loggedIn', 6 camCollisions: true, 7 enableAI: true, 8 enableNetworking: false, 9 enableVoiceChat: false 10}); 11 12publisher.init();
Worlds are constructed using custom HTML web componentsgit. Here's a basic example:
1<three-environment-block 2 devicetarget="vr" 3 threeobjecturl="path/to/world.glb" 4 scale="1" 5 positiony="-1" 6 rotationy="0" 7 animations="" 8 camcollisions="1"> 9 10 <!-- Networking configuration --> 11 <three-networking-block 12 participantlimit="5" 13 customavatars="1"> 14 </three-networking-block> 15 16 <!-- 3D Models --> 17 <three-model-block 18 threeobjecturl="path/to/model.glb" 19 scalex="1" 20 scaley="1" 21 scalez="1" 22 positionx="0" 23 positiony="0" 24 positionz="0" 25 animations="" 26 collidable="1"> 27 </three-model-block> 28 29 <!-- Sky configuration --> 30 <three-sky-block 31 distance="170000" 32 rayleigh="1" 33 sunpositionx="0" 34 sunpositiony="1" 35 sunpositionz="-10000"> 36 </three-sky-block> 37</three-environment-block>
The main container for your 3D world:
1<three-environment-block> 2 <!-- World contents go here --> 3</three-environment-block>
Attributes:
devicetarget
: Set to "vr" for VR supportthreeobjecturl
: URL to the main world model (GLB format)scale
: World scale factorpositiony
: Vertical positionrotationy
: Rotation around Y axiscamcollisions
: Enable/disable camera collisionsEnables multiplayer functionality:
1<three-networking-block> 2</three-networking-block>
Attributes:
participantlimit
: Maximum number of concurrent userscustomavatars
: Enable custom avatar uploadsAdd 3D models to your world:
1<three-model-block> 2</three-model-block>
Attributes:
threeobjecturl
: URL to the model filescalex/y/z
: Scale in each dimensionpositionx/y/z
: Position in 3D spacerotationx/y/z
: Rotation around each axisanimations
: Animation names to playcollidable
: Enable physics collisionsAdd interactive AI characters:
1<three-npc-block 2 threeobjecturl="path/to/avatar.vrm" 3 name="NPCName" 4 defaultmessage="Hello!" 5 personality="..." 6 objectawareness="1"> 7</three-npc-block>
<three-sky-block>
: Configure skybox and lighting<three-audio-block>
: Add spatial audio<three-video-block>
: Add video elements<three-image-block>
: Add image planes<three-text-block>
: Add 3D text<three-portal-block>
: Create teleport pointsThe library includes a physics system based on Rapier. To make objects collidable:
collidable
attribute on model blockscamcollisions="1"
Players can customize their appearance using VRM models:
NPCs can be configured with personality traits and conversation topics:
1const npcConfig = { 2 name: "Character", 3 topics: ["topic1", "topic2"], 4 personality: { 5 adjectives: ["friendly", "helpful"], 6 style: { 7 chat: ["Be enthusiastic", "Use emojis"] 8 } 9 } 10};
For multiplayer environments:
GPL-3.0
For questions and support:
No vulnerabilities found.
No security vulnerabilities found.