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

Custom display name & chat bubbles (#125) #187

Merged
merged 7 commits into from
Jan 31, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix type check
MarcusLongmuir committed Jan 31, 2025
commit 7a729d2e6f8dff5d3a418e83c18645d1c3c8d115
25 changes: 11 additions & 14 deletions packages/3d-web-client-core/src/character/Character.ts
Original file line number Diff line number Diff line change
@@ -17,21 +17,22 @@ export type AnimationConfig = {
doubleJumpAnimationFileUrl: string;
};

export type CharacterDescription = {
meshFileUrl?: string;
mmlCharacterUrl?: string;
mmlCharacterString?: string;
} & (
export type CharacterDescription =
| {
meshFileUrl: string;
mmlCharacterString?: null;
mmlCharacterUrl?: null;
}
| {
mmlCharacterUrl: string;
}
| {
meshFileUrl?: null;
mmlCharacterString: string;
mmlCharacterUrl?: null;
}
);
| {
meshFileUrl?: null;
mmlCharacterString?: null;
mmlCharacterUrl: string;
};

export type CharacterConfig = {
username: string;
@@ -161,11 +162,7 @@ export class Character extends Group {
const tooltip = new CharacterTooltip({
maxWidth: 1000,
secondsToFadeOut: 10,
color: {
r: 0.125,
g: 0.125,
b: 0.125,
},
color: new Color(0.125, 0.125, 0.125),
});
this.add(tooltip);
this.chatTooltips.push(tooltip);
16 changes: 9 additions & 7 deletions packages/3d-web-client-core/src/character/CharacterModel.ts
Original file line number Diff line number Diff line change
@@ -229,17 +229,19 @@ export class CharacterModel {
}

private cleanAnimationClips(
skeletalMesh: Object3D,
skeletalMesh: Object3D | null,
animationClip: AnimationClip,
keepRootBonePositionAnimation: boolean,
): AnimationClip {
const availableBones = new Set<string>();
skeletalMesh.traverse((child) => {
const asBone = child as Bone;
if (asBone.isBone) {
availableBones.add(child.name);
}
});
if (skeletalMesh) {
skeletalMesh.traverse((child) => {
const asBone = child as Bone;
if (asBone.isBone) {
availableBones.add(child.name);
}
});
}
animationClip.tracks = animationClip.tracks.filter((track) => {
const [trackName, trackProperty] = track.name.split(".");
if (keepRootBonePositionAnimation && trackName === "root" && trackProperty === "position") {
1 change: 0 additions & 1 deletion packages/3d-web-client-core/src/mml/MMLCompositionScene.ts
Original file line number Diff line number Diff line change
@@ -99,7 +99,6 @@ export class MMLCompositionScene {
hasGraphicsAdapter(): boolean {
return true;
},
getRootContainer: () => this.group,
addCollider: (object: Object3D, mElement: MElement<ThreeJSGraphicsAdapter>) => {
this.config.collisionsManager.addMeshesGroup(object as Group, mElement);
},
19 changes: 10 additions & 9 deletions packages/3d-web-user-networking/src/UserNetworkingMessages.ts
Original file line number Diff line number Diff line change
@@ -13,21 +13,22 @@ export type UserNetworkingIdentityMessage = {
id: number;
};

export type CharacterDescription = {
meshFileUrl?: string;
mmlCharacterUrl?: string;
mmlCharacterString?: string;
} & (
export type CharacterDescription =
| {
meshFileUrl: string;
mmlCharacterString?: null;
mmlCharacterUrl?: null;
}
| {
mmlCharacterUrl: string;
}
| {
meshFileUrl?: null;
mmlCharacterString: string;
mmlCharacterUrl?: null;
}
);
| {
meshFileUrl?: null;
mmlCharacterString?: null;
mmlCharacterUrl: string;
};

export type UserNetworkingProfileMessage = {
type: typeof USER_NETWORKING_USER_PROFILE_MESSAGE_TYPE;