-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
New Entity Framework #5536
Merged
Merged
New Entity Framework #5536
Changes from all commits
Commits
Show all changes
155 commits
Select commit
Hold shift + click to select a range
4a19679
Experimental JSX entity templating
netpro2k 26a565b
Try doing interactable-camera outside of hub.html
netpro2k ebb0a4e
Play with refs and Object3D entities
netpro2k a32dbd7
Check in Dom's code
johnshaughnessy 59eb658
Rewrite single-action buttons using bitECS
johnshaughnessy fc1f4c8
Rewrite the networked object button with bitECS
johnshaughnessy 764e446
Move floaty-object to bitECS land
johnshaughnessy d70e153
Add component inflator map to jsx rendering
johnshaughnessy 160d230
Make mirrors without aframe
johnshaughnessy 7e3ce4c
Remove console logs
johnshaughnessy 1b187fd
WIP Inflating media frames
johnshaughnessy dfabc0d
Media frames mostly working locally
johnshaughnessy 80014d5
Media frames a bit cleaned up
johnshaughnessy 12771dd
Disable physics debug
johnshaughnessy c3875e7
Network media frames
johnshaughnessy 5a90c46
Separate media frame into step, apply, display
johnshaughnessy e491ca3
Cleanup
johnshaughnessy a56a90a
Rename capturedEntity -> captured
johnshaughnessy fcb4ec2
Send media frame isFull. Also requeue messages
johnshaughnessy c1a8d08
Add the desired media frame
johnshaughnessy d268238
Rename originalTargetScale -> scale
johnshaughnessy 49c97d7
Change Networked/DesiredMediaFrame to FrameUpdate
johnshaughnessy 4cd9c70
Update comments about snap to frame
johnshaughnessy 5fdeafb
Leave a note about a bug with re-enqueing network updates
johnshaughnessy c8ca7a4
Change logging
johnshaughnessy 602a689
Send captured nid, not isFull
johnshaughnessy ec26fbf
Remove derived state (FrameUpdate.captured)
johnshaughnessy 618065e
Rename FrameUpdate -> NetworkedMediaFrame
johnshaughnessy af99289
Change NetworkedMediaFrame so that it is not consumed
johnshaughnessy a2c1907
Remove logs
johnshaughnessy 004b8f3
Remove derived captured state from MediaFrame
johnshaughnessy 47e31b9
Correct box calculation when snapping into frame
johnshaughnessy bac2bac
Rename "eid" suffix from variable names
johnshaughnessy f5ea8c1
Don't allow a media frame to capture its ancestor
johnshaughnessy c3e28fb
Snap when we capture an entity
johnshaughnessy 4573887
optimize isAncestor
johnshaughnessy 15fabc6
Fix definition orders in hub.html
johnshaughnessy 2782781
Add support for text component inflation
johnshaughnessy 8535699
slice9 component and start of a button
netpro2k 541c1d4
Move components into bit-components
johnshaughnessy 7cafa96
Reimplement hovering and holding
johnshaughnessy 42d6374
Reorder grab and drops
johnshaughnessy 309bf42
Reimplement constraints
johnshaughnessy 65539d1
Implement network create
johnshaughnessy 44496ee
Add previousState back for old interaction system
netpro2k 1da5563
Fix taking ownership of grabbed objects
netpro2k a48a3ce
Remove concept of "templates" from netcode
netpro2k 3b47cba
Very basic network transform position
netpro2k 909b831
Set unowned bodies kinematic.
johnshaughnessy 28a257b
Use anyAframeEntityWith
johnshaughnessy 377db53
Move stuff around in netcode. No changes
johnshaughnessy 4ee5bda
Moved bit-interaction-system stuff to its own function
johnshaughnessy e645bbb
Implement network delete for new entities
johnshaughnessy e4d9b1c
Change execution order of physicsCompatSystem
netpro2k ed24d85
Handle removing for nested Object3D entities
netpro2k 1f81c08
Rough template for late joiner handling
netpro2k 0e52140
Support for nested networked objects
netpro2k ec6bf39
Clarify comments. Fix a-entity deletion
johnshaughnessy a7d69f4
Implement late-joiner logic
johnshaughnessy d07bd8a
Take ownership of all abandoned network entities
johnshaughnessy 70fe650
Inline some stuff
johnshaughnessy 0a0c78b
Handle clients leaving
johnshaughnessy 3fcc97f
Add resolveRef to inflation
johnshaughnessy 5d62955
Basic render target on camera tool
netpro2k ff051cc
Basic photo snapping
netpro2k 1b1af2c
Basic video snapping state
netpro2k d11e1cc
Fix camera rotation (missing shape)
netpro2k aeee57e
Add camera cancel button. Modify camera timer
johnshaughnessy ecae01d
Button hover coloring
netpro2k 0a73ffc
Fix hovering on legacy buttons
netpro2k 0a2c26f
Remove some dead code
netpro2k 9dcf69e
Remove more dead code
netpro2k da113bc
Basic hand hovering
netpro2k 1cf03e6
WIP trying to fix hand grabbing
netpro2k 1f33af8
Remove double hovering
netpro2k 6bbb466
Port the rest of floaty-object
netpro2k 4c2ff23
Fix/Simplify AppAwareMouse
netpro2k c2aa2f2
Remove uses of tags.data (todo: touch input)
netpro2k dc93e27
Cleanup
netpro2k ff6ecf6
Clenup jsx-entiteis
netpro2k 2246f38
Remove renderAsGLTF
netpro2k 54f2b17
More cleanup
netpro2k 9b14251
Re-implement video recording
netpro2k 9b6fb11
Factor out RenderTargetRecorder
netpro2k 219e078
Add todo about floaty-object race
netpro2k 4f70f93
Camera tool menu should always face player
netpro2k e18d36e
Rework net serialization to do diffing
netpro2k c1dc605
Camera tool menu update not committed
netpro2k 3d280e1
Remove some logs
netpro2k 8fd74e2
Permissions + simplification of netcode
netpro2k 08e4812
Rework pending nid handling. Simplify parting more
netpro2k b4e1082
Only update diff on non full syncs
netpro2k 6c5390f
Update TODOs
netpro2k 35ad56a
Add rotation/scale to NetworkedTransform
netpro2k 97a97dc
Fix physics race in floaty object system
netpro2k e55c46e
Cleanup
netpro2k f0a2819
applyNetworkUpdates -> networkReceiveSystem
netpro2k 720aa06
Handle objects collding with multiple MediaFrames
netpro2k 76a7af6
Point at bitecs branches of aframe and NAF
netpro2k effdfdd
Restore periodic-full-syncs
netpro2k 5d57add
Fix name assignment for jsx-entities
netpro2k 29d1f62
Move pixelsToPNG into RenderTargetRecorder
netpro2k c788146
Fix admin package-lock
netpro2k 1fe0ce7
Tidy up camera UI
netpro2k 461dd56
Limit camera viewfinder updates
netpro2k 548aab4
Only update viewfinders in view
netpro2k 0fb498d
snapshot binding for grabbed camera
netpro2k 9b2d4b8
Don't render spacebubbles in camera tool
netpro2k 46f6213
Remove debug
netpro2k 2e663be
Add tick to time system
netpro2k 92efbaa
Don't hardcode gltf media frame root nid
netpro2k 19dc0a1
Add simple camera toggle
netpro2k 02a68e3
Add /cube command, more work on physics
netpro2k d5ea1bd
Temporarily allow continuous frame snapping
netpro2k eb595fc
Port destroy-at-extreme-distance, use on cubes
netpro2k a50280f
Fix inspecting avatars
netpro2k 12a2624
Fix camera menu rotation
netpro2k d5a9e18
Move camera tool system
netpro2k b6ccc8b
More UI layer. Remove camtool code from billboard.
netpro2k b0f6d3b
Port remaining parts of old camera tool system
netpro2k 85d41c6
Fix some physics system todos
netpro2k afa795f
Fix some jsx reserved properties
netpro2k a5ffc03
Cleanup camera tool media spawning + init
netpro2k ec718d0
Lower default entity count to 10k and add to stats
netpro2k 2dd65f5
Load camera model in a nicer way
netpro2k 68d4460
dispose() GLTFModel, Slice9, and Text. Fix leaks.
netpro2k ef61ab5
Fix leak in aframe slice9
netpro2k dae0649
Correctly dispose() MediaFrame geometry. DRY up.
netpro2k 0be4492
Speed up camera loading a bit
netpro2k 4623cd2
Add a temporary way to rotate camreas with mouse
netpro2k 3fcf9b7
Fix video saving
netpro2k 5cc3bbe
Only show camtool viewfinder n VR when held or rec
netpro2k 7724c6b
Make camtool kinematic on release
netpro2k cee6df7
Rename camtool "schema" to "prefab"
netpro2k c830cc0
Fix spawners
netpro2k 4c812b8
Cleanup unused interaction state
netpro2k 84c96d5
Move inflators out of jsx-entity.js
netpro2k bc6674c
Cleanup media frame previews
netpro2k 8ec30f8
Media Frames should Ignore loading objects
netpro2k 1a6a096
Fix/simplify media frame scaling
netpro2k a3e8175
Add audio recording toggle to camtool, rework UI
netpro2k e88daf9
Render cursor on UI layer
netpro2k 785ec9f
Fix edge case removing object while its loading
netpro2k 1dc43c0
Fix incorrect assumption about layer masks
netpro2k e435a26
Fix interactions on touchscreen
netpro2k dfdb425
Misc cleanups
netpro2k 266eb35
Delint
netpro2k 21d8e26
Cleanup
netpro2k 8433044
Merge remote-tracking branch 'origin/master' into bitecs-experiment
netpro2k bad24f1
Remove isVideoTexture hack from camera tool
netpro2k d72ff01
Hack fix for camera menu matrix update issue
netpro2k feba3df
Fix sRGB encoding on camera tool images
netpro2k 07ec12d
Merge remote-tracking branch 'origin/master' into bitecs-experiment
netpro2k c2b72ad
Update lockfiles to merged versions of aframe/NAF
netpro2k ecd712d
Remove physics debug changes from webpack config
netpro2k File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { addComponent, removeComponent } from "bitecs"; | ||
import { | ||
RemoteRight, | ||
RemoteLeft, | ||
HandRight, | ||
HandLeft, | ||
RemoteHoverTarget, | ||
NotRemoteHoverTarget, | ||
RemoveNetworkedEntityButton, | ||
DestroyAtExtremeDistance | ||
} from "./bit-components"; | ||
|
||
[ | ||
["remote-right", RemoteRight], | ||
["remote-left", RemoteLeft], | ||
["hand-right", HandRight], | ||
["hand-left", HandLeft], | ||
["is-remote-hover-target", RemoteHoverTarget], | ||
["is-not-remote-hover-target", NotRemoteHoverTarget], | ||
["remove-networked-object-button", RemoveNetworkedEntityButton], | ||
["destroy-at-extreme-distances", DestroyAtExtremeDistance] | ||
].forEach(([aframeComponentName, bitecsComponent]) => { | ||
AFRAME.registerComponent(aframeComponentName, { | ||
init: function() { | ||
addComponent(APP.world, bitecsComponent, this.el.object3D.eid); | ||
}, | ||
remove: function() { | ||
removeComponent(APP.world, bitecsComponent, this.el.object3D.eid); | ||
} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
import { defineComponent, setDefaultSize, Types } from "bitecs"; | ||
|
||
// TODO this has to happen before all components are defined. Is there a better spot to be doing this? | ||
setDefaultSize(10000); | ||
|
||
export const $isStringType = Symbol("isStringType"); | ||
|
||
export const Networked = defineComponent({ | ||
id: Types.ui32, | ||
creator: Types.ui32, | ||
owner: Types.ui32, | ||
|
||
lastOwnerTime: Types.ui32 | ||
}); | ||
Networked.id[$isStringType] = true; | ||
Networked.creator[$isStringType] = true; | ||
Networked.owner[$isStringType] = true; | ||
|
||
export const Owned = defineComponent(); | ||
export const NetworkedMediaFrame = defineComponent({ | ||
capturedNid: Types.ui32, | ||
scale: [Types.f32, 3] | ||
}); | ||
NetworkedMediaFrame.capturedNid[$isStringType] = true; | ||
|
||
export const MediaFrame = defineComponent({ | ||
capturedNid: Types.ui32, | ||
scale: [Types.f32, 3], | ||
mediaType: Types.ui8, | ||
bounds: [Types.f32, 3], | ||
preview: Types.eid, | ||
previewingNid: Types.eid | ||
}); | ||
export const Text = defineComponent(); | ||
export const Slice9 = defineComponent({ | ||
insets: [Types.ui32, 4], | ||
size: [Types.f32, 2] | ||
}); | ||
|
||
export const NetworkedTransform = defineComponent({ | ||
position: [Types.f32, 3], | ||
rotation: [Types.f32, 4], | ||
scale: [Types.f32, 3] | ||
}); | ||
|
||
export const AEntity = defineComponent(); | ||
export const Object3DTag = defineComponent(); | ||
export const GLTFModel = defineComponent(); | ||
export const CursorRaycastable = defineComponent(); | ||
export const RemoteHoverTarget = defineComponent(); | ||
export const NotRemoteHoverTarget = defineComponent(); | ||
export const Holdable = defineComponent(); | ||
export const RemoveNetworkedEntityButton = defineComponent(); | ||
export const Interacted = defineComponent(); | ||
|
||
export const HandRight = defineComponent(); | ||
export const HandLeft = defineComponent(); | ||
export const RemoteRight = defineComponent(); | ||
export const RemoteLeft = defineComponent(); | ||
export const HoveredHandRight = defineComponent(); | ||
export const HoveredHandLeft = defineComponent(); | ||
export const HoveredRemoteRight = defineComponent(); | ||
export const HoveredRemoteLeft = defineComponent(); | ||
export const HeldHandRight = defineComponent(); | ||
export const HeldHandLeft = defineComponent(); | ||
export const HeldRemoteRight = defineComponent(); | ||
export const HeldRemoteLeft = defineComponent(); | ||
export const Held = defineComponent(); | ||
export const OffersRemoteConstraint = defineComponent(); | ||
export const HandCollisionTarget = defineComponent(); | ||
export const OffersHandConstraint = defineComponent(); | ||
export const TogglesHoveredActionSet = defineComponent(); | ||
|
||
export const HoverButton = defineComponent({ type: Types.ui8 }); | ||
export const TextButton = defineComponent({ labelRef: Types.eid }); | ||
export const HoldableButton = defineComponent(); | ||
export const SingleActionButton = defineComponent(); | ||
|
||
export const Pen = defineComponent(); | ||
export const HoverMenuChild = defineComponent(); | ||
export const Static = defineComponent(); | ||
export const Inspectable = defineComponent(); | ||
export const PreventAudioBoost = defineComponent(); | ||
export const IgnoreSpaceBubble = defineComponent(); | ||
export const Rigidbody = defineComponent({ | ||
bodyId: Types.ui16, | ||
collisionGroup: Types.ui32, | ||
collisionMask: Types.ui32, | ||
flags: Types.ui8, | ||
gravity: Types.f32 | ||
}); | ||
export const PhysicsShape = defineComponent({ bodyId: Types.ui16, shapeId: Types.ui16, halfExtents: [Types.f32, 3] }); | ||
export const Pinnable = defineComponent(); | ||
export const Pinned = defineComponent(); | ||
export const DestroyAtExtremeDistance = defineComponent(); | ||
|
||
export const MediaLoading = defineComponent(); | ||
|
||
export const FloatyObject = defineComponent({ flags: Types.ui8, releaseGravity: Types.f32 }); | ||
export const MakeKinematicOnRelease = defineComponent(); | ||
|
||
export const CameraTool = defineComponent({ | ||
snapTime: Types.f32, | ||
state: Types.ui8, | ||
captureDurIdx: Types.ui8, | ||
trackTarget: Types.eid, | ||
|
||
snapMenuRef: Types.eid, | ||
button_next: Types.eid, | ||
button_prev: Types.eid, | ||
snapRef: Types.eid, | ||
cancelRef: Types.eid, | ||
recVideoRef: Types.eid, | ||
screenRef: Types.eid, | ||
selfieScreenRef: Types.eid, | ||
cameraRef: Types.eid, | ||
countdownLblRef: Types.eid, | ||
captureDurLblRef: Types.eid, | ||
sndToggleRef: Types.eid | ||
}); | ||
export const MyCameraTool = defineComponent(); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to think up a better pattern for storing system state like this. Here we are putting it on world, in other spots like camera tool we just store it in a module local variable. I think having some pattern for this would be useful.