Buckets:
ktongue/docker_container / simsite /frontend /node_modules /three /src /extras /curves /CubicBezierCurve.js
| import { Curve } from '../core/Curve.js'; | |
| import { CubicBezier } from '../core/Interpolations.js'; | |
| import { Vector2 } from '../../math/Vector2.js'; | |
| class CubicBezierCurve extends Curve { | |
| constructor( v0 = new Vector2(), v1 = new Vector2(), v2 = new Vector2(), v3 = new Vector2() ) { | |
| super(); | |
| this.isCubicBezierCurve = true; | |
| this.type = 'CubicBezierCurve'; | |
| this.v0 = v0; | |
| this.v1 = v1; | |
| this.v2 = v2; | |
| this.v3 = v3; | |
| } | |
| getPoint( t, optionalTarget = new Vector2() ) { | |
| const point = optionalTarget; | |
| const v0 = this.v0, v1 = this.v1, v2 = this.v2, v3 = this.v3; | |
| point.set( | |
| CubicBezier( t, v0.x, v1.x, v2.x, v3.x ), | |
| CubicBezier( t, v0.y, v1.y, v2.y, v3.y ) | |
| ); | |
| return point; | |
| } | |
| copy( source ) { | |
| super.copy( source ); | |
| this.v0.copy( source.v0 ); | |
| this.v1.copy( source.v1 ); | |
| this.v2.copy( source.v2 ); | |
| this.v3.copy( source.v3 ); | |
| return this; | |
| } | |
| toJSON() { | |
| const data = super.toJSON(); | |
| data.v0 = this.v0.toArray(); | |
| data.v1 = this.v1.toArray(); | |
| data.v2 = this.v2.toArray(); | |
| data.v3 = this.v3.toArray(); | |
| return data; | |
| } | |
| fromJSON( json ) { | |
| super.fromJSON( json ); | |
| this.v0.fromArray( json.v0 ); | |
| this.v1.fromArray( json.v1 ); | |
| this.v2.fromArray( json.v2 ); | |
| this.v3.fromArray( json.v3 ); | |
| return this; | |
| } | |
| } | |
| export { CubicBezierCurve }; | |
Xet Storage Details
- Size:
- 1.32 kB
- Xet hash:
- 856c265dbcd081ac973032a8dc38267f88552a6992e00483f11cec7565c31717
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.