Skip to content

Commit

Permalink
fix!: upgrade mc version, simplify demo, and fix resize bug
Browse files Browse the repository at this point in the history
  • Loading branch information
prieston committed Mar 24, 2022
1 parent cd158aa commit 6f5bef8
Show file tree
Hide file tree
Showing 26 changed files with 197 additions and 403 deletions.
171 changes: 0 additions & 171 deletions demo/animations/index.js

This file was deleted.

Binary file removed demo/assets/Soldier.glb
Binary file not shown.
Binary file removed demo/assets/images/dc-logo-transparent.jpg
Binary file not shown.
Binary file removed demo/assets/images/dc-logo.jpg
Binary file not shown.
Binary file removed demo/assets/images/donkey clip logo.png
Binary file not shown.
20 changes: 0 additions & 20 deletions demo/assets/images/donkey clip logo.svg

This file was deleted.

Binary file removed demo/assets/man.glb
Binary file not shown.
Binary file removed demo/assets/scene.glb
Binary file not shown.
Binary file removed demo/assets/skeleton.glb
Binary file not shown.
Binary file removed demo/assets/sound/applsci-10-03826-v2.pdf
Binary file not shown.
Binary file removed demo/assets/sound/desert-wind.mp3
Binary file not shown.
Binary file removed demo/assets/sound/intro-sound.mp3
Binary file not shown.
Binary file removed demo/assets/sound/walk-grass.mp3
Binary file not shown.
25 changes: 25 additions & 0 deletions demo/entities.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
export const mainScene = {
id: "main-scene",
model: {
id: "main-scene",
loader: "GLTFLoader",
file: "https://donkey-spaces.ams3.cdn.digitaloceanspaces.com/assets/threejs-plugin/christmas-village.glb",
},
settings: {
position: { x: 0, y: 0, z: 0 },
},
};

export const man = {
id: "man",
model: {
id: "man",
loader: "GLTFLoader",
file: "https://donkey-spaces.ams3.cdn.digitaloceanspaces.com/assets/threejs-plugin/man.glb",
},
settings: {
position: { x: 4, y: 0, z: -6 },
rotation: { x: 0, y: -Math.PI / 2.5, z: 0 },
scale: { x: 0.01, y: 0.01, z: 0.01 },
},
};
53 changes: 0 additions & 53 deletions demo/entities/index.js

This file was deleted.

31 changes: 0 additions & 31 deletions demo/helpers.js

This file was deleted.

68 changes: 68 additions & 0 deletions demo/incidents.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import { loadPlugin } from "@donkeyclip/motorcortex";
import threeDef from "../src/index";
const threejs = loadPlugin(threeDef);

/* configuration and helper functions */
export const cameraInitialPosition = { x: -50, y: 20, z: 20 };
const cameraAnimation = (position, duration) =>
new threejs.ObjectAnimation(
{
animatedAttrs: {
targetEntity: "!#man",
position,
},
},
{
selector: "!#camera_1",
duration,
}
);

/* actual incidents */
export const animateScene = new threejs.MorphAnimation(
{
attrs: {
singleLoopDuration: 1000,
animationName: "Idle",
},
animatedAttrs: {
time: 10000,
},
},
{
selector: "!#main-scene",
duration: 10000,
}
);
export const animateMan = new threejs.MorphAnimation(
{
attrs: {
singleLoopDuration: 1000,
animationName: "armature|walk",
},
animatedAttrs: {
time: 10000,
},
},
{
selector: "!#man",
duration: 10000,
}
);
export const moveMan = new threejs.ObjectAnimation(
{
animatedAttrs: {
position: { x: -10, y: 0, z: -1 },
},
},
{
selector: "!#man",
duration: 10000,
}
);
export const cameraZoomIn = () =>
cameraAnimation({ x: -20, y: 20, z: 20 }, 5000);

export const cameraGoDown = () => cameraAnimation({ x: -19, y: 2, z: 4 }, 2000);
export const cameraWatchMan = () =>
cameraAnimation({ x: -19, y: 2, z: 4 }, 3000);
14 changes: 14 additions & 0 deletions demo/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
html,
body {
font-size: 14px;
width: 100%;
height: 100%;
margin: 0;
background-color: #282828;
}

#clip {
background-color: #000;
width: 100%;
height: 100%;
}
Loading

0 comments on commit 6f5bef8

Please sign in to comment.