Skip to content

Commit

Permalink
add tag to actor
Browse files Browse the repository at this point in the history
  • Loading branch information
idkiller committed Apr 29, 2021
1 parent cc302f5 commit 3dea785
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions public/sceneapp-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"Name": "sticker",
"UseObjectDetection": true,
"AuthoringTool": "object-sticker"
}
8 changes: 6 additions & 2 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default class Ideas {
private async started() {
console.log("START Application");
/*
const note = new Note(this.ctx, this.assets, "this is a test note\nthis is a test note\nthis is a test note\nthis is a test note", 0.2, 0.2, {x: 0, y: 0, z: 0}, `postit.png`);
const note = new Note(this.ctx, this.assets, "this is a test note\nthis is a test note\nthis is a test note\nthis is a test note", 0.2, 0.2, {x: 0, y: 0, z: 0}, `postit.png`, undefined, 'keyboard');
note.show();
*/
}
Expand Down Expand Up @@ -144,7 +144,7 @@ export default class Ideas {
`l: ${memo.locationId.substr(- 10)}\n` +
`t: ${memo.linkedObjectType}\n` +
memo.contents,
0.2, 0.2, {x: 0, y: 0, z: 0}, `${memo.textureType}.png`, user.user);
0.2, 0.2, {x: 0, y: 0, z: 0}, `${memo.textureType}.png`, user.user, memo.linkedObjectType);
this.userObjects[userId].push({
memoId: memo.id,
type: memo.linkedObjectType,
Expand All @@ -153,6 +153,9 @@ export default class Ideas {
});
console.log(`object is created : ${memo.linkedObjectType} - ${memo.permission} - [${memo.contents}] - ${user.user.name} - ${options.userId}`);

obj.show();

/*
for (let i = this.userMap[userId].remainedPositions.length - 1; i >= 0; i--) {
const p = this.userMap[userId].remainedPositions[i];
if (p.locationId === locationId && p.type === memo.linkedObjectType) {
Expand All @@ -163,6 +166,7 @@ export default class Ideas {
break;
}
}
*/
}
}
});
Expand Down
6 changes: 4 additions & 2 deletions src/note.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export class Note implements Component {
private height: number,
private position: { x: number, y: number, z: number },
private bgImg?: string,
private user?: MRE.User) {
private user?: MRE.User,
private objectName?: string) {
this.bgImg = !this.bgImg ? "postit.png" : this.bgImg;
}

Expand Down Expand Up @@ -71,7 +72,8 @@ export class Note implements Component {

this.plane = MRE.Actor.Create(this.ctx, {
actor: {
name: 'Note',
name: `ATDO-${this.objectName}`,
tag: 'AttachToDetectedObject',
exclusiveToUser: this.user ? this.user.id : undefined,
appearance: {
meshId: this.planeMesh.id,
Expand Down

0 comments on commit 3dea785

Please sign in to comment.