0.7.2 • Published 1 year ago

@oasis-engine/ark v0.7.2

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

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);

// init avatar
arkComponent.replaceModel("***").then(() => {
  // play animation, actions can be bone-mapped
  const animationList = arkComponent.animationNameList;
  const clipName1 = animationList[0];
  const duration = arkComponent.getAnimationDuration(clipName1);
  arkComponent.animator.play(clipName1);

  // Edit blendShape by name.
  const bsNameList = arkComponent.blendShapeNameList;
  arkComponent.editBlendShape("bs1", 0.5);
  arkComponent.getBlendShapeValue("bs1"); // 0.5

  // Use some ark materials
  arkComponent.useSSSMaterial();

  // ... reference to typescript in ArkComponent ...
});

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);

  // use avatar capabilities in ArkComponent.
  avatar.onReady.then(()=>{
    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

0.9.0-beta.1

1 year ago

0.9.0-beta.0

1 year ago

0.8.0-beta.0

2 years ago

0.8.0-beta.3

2 years ago

0.8.0-beta.1

2 years ago

0.8.0-beta.2

2 years ago

0.0.20

2 years ago

0.0.20-beta.0

2 years ago

0.0.16

2 years ago

0.0.17

2 years ago

0.0.18

2 years ago

0.0.19

2 years ago

0.7.2

2 years ago

0.7.1

2 years ago

0.7.0

2 years ago

0.0.10

2 years ago

0.0.11

2 years ago

0.0.12

2 years ago

0.0.13

2 years ago

0.0.14

2 years ago

0.0.15

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago