feat: Update smooth_script
This commit is contained in:
parent
accaa8b37f
commit
38e389606a
|
|
@ -12,10 +12,10 @@ AFRAME.registerComponent("lerpsmooth", {
|
||||||
// if we know about the previous position
|
// if we know about the previous position
|
||||||
if(this.prevPosition) {
|
if(this.prevPosition) {
|
||||||
// smooth position
|
// smooth position
|
||||||
this.target.object3D.position.lerp(this.prevPosition, 0.05)
|
this.target.object3D.position.lerp(this.prevPosition, 0.1)
|
||||||
|
|
||||||
// smooth rotation
|
// smooth rotation
|
||||||
let rot = this.target.object3D.rotation.toVector3().lerp(this.prevRotation, 0.05)
|
let rot = this.target.object3D.rotation.toVector3().lerp(this.prevRotation, 0.1)
|
||||||
this.target.object3D.rotation.setFromVector3(rot)
|
this.target.object3D.rotation.setFromVector3(rot)
|
||||||
}
|
}
|
||||||
// we don't know about the previous position
|
// we don't know about the previous position
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue