Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p2pcf Networking + Core blocks + Character Controller + Kitchen Sink #7

Draft
wants to merge 50 commits into
base: scene-composition
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
84be0c4
working p2pcf room with post slugs
antpb Aug 22, 2022
162091f
we have cube
antpb Aug 23, 2022
0c6cd30
working webrtc movement
antpb Aug 23, 2022
ea3b04f
adds rotation data to messages
antpb Aug 26, 2022
79ee101
let there be janky avatars
antpb Aug 26, 2022
9ee9510
clean up comments
antpb Aug 26, 2022
d91736b
adds physics controller movement
antpb Aug 28, 2022
3301559
dont lose the weekends work this pr adds raycast based controller
antpb Aug 29, 2022
7a97e3b
adds rotations on key press
antpb Aug 30, 2022
ee6fa3a
Usdz support (#9)
antpb Sep 2, 2022
ed764f6
Merge remote-tracking branch 'origin/main' into networking-scene-comp…
antpb Sep 4, 2022
0253340
restore array merge for uploads (#10)
antpb Sep 4, 2022
1d9c80a
Merge remote-tracking branch 'origin/main' into networking-scene-comp…
antpb Sep 4, 2022
93a57be
adds scaffolding for portal block
antpb Sep 4, 2022
db3f419
fixes sky bug and adds acessibility features to model block
antpb Sep 10, 2022
59ba020
fixes sky again
antpb Sep 10, 2022
7e2462f
fixes animations for model block
antpb Sep 10, 2022
4619e17
big changes to viewer and random cleanup
antpb Sep 16, 2022
4bc0bb0
revamp editor view
antpb Sep 21, 2022
eaa0287
adds editor styling
antpb Sep 22, 2022
dac1ad9
styles editor
antpb Sep 23, 2022
6276dda
adds html block and transform controls for models
antpb Sep 28, 2022
7a7dc7f
adds transform instancing for editor and adds rotation properties to …
antpb Sep 29, 2022
a18f414
fix edit models
antpb Oct 1, 2022
58f2f67
adds resizable component
antpb Oct 1, 2022
5830f1f
adds instnaced object for same object
antpb Oct 3, 2022
8f3eb3c
checking in progress to revamp frontend loading and character controller
antpb Oct 5, 2022
8c6c77a
adds image editor view
antpb Oct 6, 2022
a1d7e5b
fixes innerBlock updates for portal block
antpb Oct 6, 2022
e9b1080
adds image edit side changes and new name property for models
antpb Oct 12, 2022
0323460
remove p2pcf worker
antpb Oct 12, 2022
5e1ad72
adds name property to models for ease of editing
antpb Oct 13, 2022
dba240a
check in character controller progress
antpb Oct 19, 2022
8921670
adds scale controls
antpb Oct 21, 2022
ad868d9
fixes scaling logic
antpb Oct 21, 2022
f83a8ba
renames category and adds enter button
antpb Oct 25, 2022
75160ca
turns on networking and restructures editor transform gizmo logic
antpb Oct 28, 2022
5dc8f65
limits inner blocks to environments
antpb Nov 2, 2022
b2c1edf
adds default avatar and profile picture
antpb Nov 2, 2022
3e12a3b
semi working multiplayer default avatars
antpb Nov 3, 2022
1acb162
cleanup some logs
antpb Nov 4, 2022
076cce3
add back in yarn.lock
antpb Nov 4, 2022
060d529
revamps portals to have offsets
antpb Nov 5, 2022
dcf7702
add support for thirdroom links
antpb Nov 5, 2022
f20e76a
adds eslint
antpb Nov 6, 2022
42e8abf
prettier
antpb Nov 6, 2022
0ec711b
cleanup
antpb Nov 6, 2022
b808abd
fixes controls and cleanup
antpb Nov 6, 2022
c183a9f
removes old component structure
antpb Nov 6, 2022
5ce78f9
scaffold shadows need to fix this mess
antpb Nov 7, 2022
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
4 changes: 4 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": [ "plugin:@wordpress/eslint-plugin/recommended" ]
}

6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"semi": true,
"singleQuote": false,
"trailingComma": "none"
}

6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint",
"editor.codeActionsOnSave": {
"source.fixAll": true
},
}
31 changes: 26 additions & 5 deletions admin/three-object-viewer-settings/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
useAnimations,
} from '@react-three/drei';
import * as THREE from 'three';
import defaultAikonaut from '../../inc/avatars/mummy.vrm';
import defaultProfileVRM from '../../inc/avatars/3ov_default_avatar.vrm';

function SavedObject( props ) {
const [ url, set ] = useState( props.url );
Expand All @@ -20,7 +20,7 @@ function SavedObject( props ) {
useThree( ( { camera } ) => {
camera.add( listener );
} );
const fallbackURL = threeObjectPlugin + defaultAikonaut;
const fallbackURL = threeObjectPlugin + defaultProfileVRM;
const playerURL = props.url ? props.url : fallbackURL;

const someSceneState = useLoader( GLTFLoader, playerURL, ( loader ) => {
Expand All @@ -40,6 +40,25 @@ function SavedObject( props ) {
}
}

function CreateImage() {
const { gl, scene, camera } = useThree()
let getImageData = true;
if(gl){
if(getImageData == true) {
window.setTimeout(function () {
const url = gl.domElement.toDataURL();
const link = document.getElementById('download');

// const link = document.createElement('a');
link.setAttribute('href', url);
link.setAttribute('target', '_blank');
link.setAttribute('download', "download the scene image");
}, 200);
getImageData = false;
}
}
}

//Main component for admin page app
export default function App({ getSettings, updateSettings }) {

Expand Down Expand Up @@ -87,7 +106,6 @@ export default function App({ getSettings, updateSettings }) {

// Get media attachment details from the frame state
var attachment = frame.state().get('selection').first().toJSON();
// console.log(attachment);
setDefaultVRM(attachment.url);
// Send the attachment URL to our custom image input field.
});
Expand All @@ -108,22 +126,25 @@ export default function App({ getSettings, updateSettings }) {
<div>
<h2>Three Object Viewer Settings</h2>
</div>
<div><a id="download">download the thing</a></div>
<div>
<h3>Avatar and World Defaults</h3>
<p>This avatar will be used for guest visitors or logged in users that have not set their main avatar in the user profile page.</p>
</div>
<div>
<label htmlFor="defaultVRM"><b>Default VRM: </b></label>
<Canvas
camera={ { fov: 40, position: [0, 0, 10], zoom: 1} }
camera={ { fov: 40, position: [0, 0, 10], zoom: 1} }
gl={{ preserveDrawingBuffer: true }}
shadowMap
style={ {
backgroundColor: '#6a737c',
margin: '0',
height: '450px',
width: '40%',
} }
>
>
<CreateImage/>
<ambientLight intensity={ 0.5 } />
<directionalLight
intensity={ 0.6 }
Expand Down
Loading