Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,4 @@ jobs:
run: npm i

- name: Lint ESLint
run: npm run lint

- name: Continuous Release
run: npx pkg-pr-new publish './packages/lib' --compact
run: npm run lint
30 changes: 30 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish

on:
pull_request:
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout Main
uses: actions/checkout@v4

- name: Setup Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 18.x
cache: 'npm'

- name: Install Dependencies
run: npm i

- name: Continuous Release
run: npx pkg-pr-new publish './packages/lib' --compact
502 changes: 499 additions & 3 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
"name": "playcanvas-react-monorepo",
"description": "A monorepo for PlayCanvas React renderer and examples. Please see the packages directory for more information.",
"private": true,
"repository": {
"type": "git",
"url": "https://github.com/playcanvas/react/tree/main/packages/lib"
},
"workspaces": [
"packages/*"
],
Expand Down
5 changes: 4 additions & 1 deletion packages/docs/src/app/_meta.global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ const examples = {
'model-viewer' : {
href: '/examples/model-viewer'
},
'splats' : {
title: "Splat Viewer",
href: '/examples/splats'
},
'physics' : {
href: '/examples/physics'
},
Expand Down Expand Up @@ -71,7 +75,6 @@ export default {
items: {
...examples,
'splats': {
display: 'hidden'
}
},
},
Expand Down
5 changes: 3 additions & 2 deletions packages/docs/src/components/EnvAtlas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,20 @@

type EnvAtlasComponentsProps = {
src: string;
hideSkybox: boolean;
intensity?: number;
}

const EnvAtlasComponent: FC<EnvAtlasComponentsProps> = ({ src, intensity = 1, ...props }) => {
const EnvAtlasComponent: FC<EnvAtlasComponentsProps> = ({ src, intensity = 1, hideSkybox = true, ...props }) => {

const app = useApp();

useLayoutEffect(() => {
const layer = app?.scene?.layers?.getLayerByName('Skybox');
if(layer){
if(hideSkybox && layer){
layer.enabled = false;
}
app.scene.skyboxIntensity = intensity;

Check warning on line 24 in packages/docs/src/components/EnvAtlas.tsx

View workflow job for this annotation

GitHub Actions / lint

Mutating a value returned from a function whose return value should not be mutated
}, [app]);

const { data } = useEnvAtlas(src);
Expand Down
31 changes: 31 additions & 0 deletions packages/docs/src/content/splats.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
export const Example = () => {

/**
* Loading a Gaussian Splat ply
*/

const splatURL = "https://6rpjo46zo7.ufs.sh/f/dTTBXSHFOX4z7irrg5DfZElT6yeQYKvdjgi5IsoB0cmu9OtF"
const { data: splat } = useSplat(splatURL);

return <Entity>
{/* Create a camera entity */}
<EnvAtlasComponent
src='/environment-map.png'
hideSkybox={false}/>

<Entity>
<Camera fov={30} />
{ splat && <OrbitControls
distanceMin={3}
distanceMax={6} /> }
</Entity>
{/* Create the splat entity */}
<Entity
rotation={[0, -40, 0]}
position={[0.2, -1.7, -6]}>
{ splat && <GSplat asset={splat}/> }
</Entity>
</Entity>
}

<Example />
1 change: 1 addition & 0 deletions packages/lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
"access": "public"
},
"devDependencies": {
"pkg-pr-new": "^0.0.41",
"typescript": "5.7.3"
},
"dependencies": {
Expand Down
Loading