mirror of
https://github.com/anatolykopyl/vue-three-d-mockup.git
synced 2026-03-26 12:55:08 +00:00
Added a build process
This commit is contained in:
@@ -4,6 +4,19 @@ export default class MockupModel extends Group {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.home = {
|
||||
position: {
|
||||
x: 0,
|
||||
y: 0,
|
||||
z: 0,
|
||||
},
|
||||
rotation: {
|
||||
x: 0,
|
||||
y: 0,
|
||||
z: 0,
|
||||
},
|
||||
};
|
||||
|
||||
this.speed = {
|
||||
x: 0,
|
||||
y: 0,
|
||||
@@ -19,13 +32,14 @@ export default class MockupModel extends Group {
|
||||
|
||||
floatAnim() {
|
||||
const maxSpeed = 0.1;
|
||||
const acceleration = 0.01;
|
||||
|
||||
if (this.position.y < -2) {
|
||||
this.acceleration.y = 0.01;
|
||||
this.acceleration.y = acceleration;
|
||||
}
|
||||
|
||||
if (this.position.y > 2) {
|
||||
this.acceleration.y = -0.01;
|
||||
this.acceleration.y = -acceleration;
|
||||
}
|
||||
|
||||
this.speed.y = Math.min(this.speed.y + this.acceleration.y, maxSpeed);
|
||||
|
||||
Reference in New Issue
Block a user