Avatar Component
This is a virtual avatar component. We support ArkComponent
, which can quickly generate virtual avatar, edit avatar, and interact with each other.
Usage
1. Create component manually
import { ArkComponent } from "@oasis-engine/ark";
const arkComponent = entity.addComponent(ArkComponent);
arkComponent.modelUrl = "***";
arkComponent.playAnimation("***");
arkComponent.faceEditor("***", 0.5);
arkComponent.useSSSMaterial();
2. Use low code mode
to edit the products exported by the Ark platform
import { ArkComponent } from "@oasis-engine/ark";
const handleSceneLoaded = (oasis) => {
const rootEntity = oasis.engine.sceneManager.activeScene.getRootEntity();
const avatarEntity = rootEntity.findByName("avatar");
const avatar = avatarEntity.getComponent(ArkComponent);
avatar.***();
avatar.***();
};
npm
The ark component is published on npm with full typing support. To install, use:
npm install @oasis-engine/ark -S
This will allow you to import ark component entirely using:
import { ArkComponent } from "@oasis-engine/ark";
API
You can download ArkComponent
by following the steps above, and then operate according to the typescript