Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
2c5bf95
Add entity editing UI HTML to example app
ctrlaltdavid Jun 18, 2023
e8eac6b
Add entity editing permissions facilities
ctrlaltdavid Jun 19, 2023
fd2ed66
Add EntityHostType enumeration
ctrlaltdavid Jun 19, 2023
0d75d79
Add EntityServer.addEntity() API method with stub implementation
ctrlaltdavid Jun 19, 2023
81937c9
Add EntityServer.#addEntityInternal() method
ctrlaltdavid Jun 19, 2023
ed72943
Add local entityHostType entity property
ctrlaltdavid Jun 20, 2023
6b06f99
Fix angularDamping property name
ctrlaltdavid Jun 20, 2023
74d0c51
Rename EntityPropertyFlags to EntityPropertyList to match C++
ctrlaltdavid Jun 26, 2023
97a5676
Tidying
ctrlaltdavid Jun 26, 2023
4979158
Add PropertyFlags.isEmpty()
ctrlaltdavid Jun 27, 2023
154d730
Add EntityPropertyFlags class
ctrlaltdavid Jun 27, 2023
4f849dd
Implement getChangedProperties() for top-level properties
ctrlaltdavid Jun 27, 2023
6944693
Add ByteCountCoded.encode()
ctrlaltdavid Jul 3, 2023
d90190a
Add JSON utility methods for stringifying and parsing bigint values
ctrlaltdavid Jul 3, 2023
227e8e6
Handle stringifying Uuid objects
ctrlaltdavid Jul 3, 2023
50d26ce
Lint
ctrlaltdavid Jul 11, 2023
a8f0583
Revise and expand PropertyFlags implementation
ctrlaltdavid Jul 11, 2023
59f118f
Typos
ctrlaltdavid Jul 11, 2023
b7e8334
Use EntityPropertyFlags instead of PropertyFlags
ctrlaltdavid Jul 11, 2023
8e540a4
Extend and fix property flags methods
ctrlaltdavid Jul 18, 2023
2471ee6
Encode initial EntityEdit properties to packet data
ctrlaltdavid Jul 18, 2023
e3c2791
Add EntityEdit packet writer
ctrlaltdavid Jul 19, 2023
b2bc070
Add EntityEditPacketSender
ctrlaltdavid Jul 23, 2023
ae18a6d
Add EntityServer.editEntity() method
ctrlaltdavid Jul 23, 2023
9656b70
Validate entity properties as they are written
ctrlaltdavid Jul 23, 2023
8603691
Tidying
ctrlaltdavid Jul 24, 2023
80beb45
Add GLMHelper.packOrientationQuatToBytes()
ctrlaltdavid Jul 25, 2023
d783076
Fix entity property name cloneAvatarIdentity -> cloneAvatarEntity
ctrlaltdavid Jul 27, 2023
1d60d33
Fill in writing top-level properties
ctrlaltdavid Jul 27, 2023
f4e1bff
Fill in writing simple entities
ctrlaltdavid Jul 30, 2023
849a4e3
Tighten up float32 validity checks
ctrlaltdavid Jul 30, 2023
621232f
Rename Model entity animation properties
ctrlaltdavid Aug 2, 2023
0b1a9da
Update version number for breaking change
ctrlaltdavid Aug 2, 2023
b0bcabb
Add PropertyFlags or() method
ctrlaltdavid Aug 2, 2023
9bdb475
Add writing Model entity properties
ctrlaltdavid Aug 2, 2023
ded7442
Add writing Zone entity properties
ctrlaltdavid Aug 10, 2023
664ad9b
Tidying
ctrlaltdavid Aug 10, 2023
6a858c4
Tidying
ctrlaltdavid Aug 10, 2023
04d3df3
Fix reading grab properties into a "grab" property
ctrlaltdavid Aug 12, 2023
930a186
Add writing grab entity properties
ctrlaltdavid Aug 13, 2023
69d011e
Add further EntityEdit tests
ctrlaltdavid Aug 14, 2023
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
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ module.exports = {
"@typescript-eslint/no-magic-numbers": [
"error",
{
"ignore": [-1, 0, 1, 2],
"ignore": [-1, 0, 1, 2, "0n", "1n"],
"ignoreEnums": true,
"ignoreNumericLiteralTypes": true,
"ignoreReadonlyClassProperties": true
Expand Down
4 changes: 4 additions & 0 deletions example/interface.css
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ input {
border: dotted 1px #d0d0d0;
}

input:disabled {
color: #808080;
}

button {
width: 88px;
}
Expand Down
34 changes: 34 additions & 0 deletions example/interface.html
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,40 @@ <h3>Entity List</h3>
<tbody>
</tbody>
</table>


<h3>Entity Editing</h3>

<div class="row">
<span>Add:</span>
<button id="addEntityButton" disabled="disabled">Add</button>
<input id="addedEntityID" type="text" readonly="readonly" class="medium"/>
<button id="editAddedEntityButton" disabled="disabled">Edit</button>
<button id="deleteAddedEntityButton" disabled="disabled">Delete</button>
</div>

<div class="row">
<span>Clone added:</span>
<button id="cloneEntityButton" disabled="disabled">Clone</button>
<input id="clonedEntityID" type="text" readonly="readonly" class="medium" />
<button id="editClonedEntityButton" disabled="disabled">Edit</button>
<button id="deleteClonedEntityButton" disabled="disabled">Delete</button>
</div>

<div class="row">
<span>Can rez:</span>
<input id="canRezStatus" type="text" readonly="readonly" class="narrow" />
</div>

<div class="row">
<span>Can rez temp:</span>
<input id="canRezTempStatus" type="text" readonly="readonly" class="narrow" />
</div>

<div class="row">
<span>Can use private:</span>
<input id="canUsePrivateStatus" type="text" readonly="readonly" class="narrow" />
</div>
</div>

<h2>Message Mixer</h2>
Expand Down
46 changes: 43 additions & 3 deletions example/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//

import { Vircadia, DomainServer, Camera, AudioMixer, AvatarMixer, EntityServer, MessageMixer, Vec3, Uuid }
import { Vircadia, DomainServer, Camera, AudioMixer, AvatarMixer, EntityServer, MessageMixer, EntityType, Uuid, Vec3 }
from "../dist/Vircadia.js";

(function () {
Expand Down Expand Up @@ -639,23 +639,34 @@ import { Vircadia, DomainServer, Camera, AudioMixer, AvatarMixer, EntityServer,
const entityListBody = document.querySelector("#entityList > tbody");
let entityIDsList = [];

const addEntityButton = document.getElementById("addEntityButton");
const addedEntityID = document.getElementById("addedEntityID");
const canRezStatus = document.getElementById("canRezStatus");
const canRezTempStatus = document.getElementById("canRezTempStatus");
const canUsePrivateStatus = document.getElementById("canUsePrivateStatus");


// Status

const statusText = document.getElementById("entityServerStatus");

function onStateChanged(state) {
statusText.value = EntityServer.stateToString(state);
if (state === EntityServer.UNAVAILABLE || state === EntityServer.DISCONNECTED) {
const isConnected = state === EntityServer.CONNECTED;
if (!isConnected) {
while (entityListBody.hasChildNodes()) {
entityListBody.removeChild(entityListBody.firstChild);
}
entityIDsList = [];
entitiesCount.value = 0;
}

canRezStatus.disabled = !isConnected;
canRezTempStatus.disabled = !isConnected;
canUsePrivateStatus.disabled = !isConnected;
}
onStateChanged(entityServer.state);
entityServer.onStateChanged = onStateChanged;
onStateChanged(entityServer.state);


// Entity List
Expand Down Expand Up @@ -715,6 +726,35 @@ import { Vircadia, DomainServer, Camera, AudioMixer, AvatarMixer, EntityServer,
entityServer.entityData.connect(onEntityData);


// Entity Editing

addEntityButton.addEventListener("click", () => {
const entityID = entityServer.addEntity({
entityType: EntityType.Shape
});
addedEntityID.value = entityID.stringify();
});

const onCanRezChanged = (canRez) => {
canRezStatus.value = canRez;
addEntityButton.disabled = !entityServer.canRez;
};
entityServer.canRezChanged.connect(onCanRezChanged);
onCanRezChanged(entityServer.canRez);

const onCanRezTempChanged = (canRezTemp) => {
canRezTempStatus.value = canRezTemp;
};
entityServer.canRezTempChanged.connect(onCanRezTempChanged);
onCanRezTempChanged(entityServer.canRezTemp);

const onCanGetAndSetPrivateUserDataChanged = (canGetAndSetPrivateUserData) => {
canUsePrivateStatus.value = canGetAndSetPrivateUserData;
};
entityServer.canGetAndSetPrivateUserDataChanged.connect(onCanGetAndSetPrivateUserDataChanged);
onCanGetAndSetPrivateUserDataChanged(entityServer.canGetAndSetPrivateUserData);


// Game Loop

entityServerGameLoop = () => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vircadia/web-sdk",
"version": "2023.1.2",
"version": "2023.2.0",
"productName": "Vircadia Web SDK",
"description": "Vircadia Web SDK for virtual worlds.",
"author": "DigiSomni LLC | Vircadia Contributors",
Expand Down
Loading