Skip to content

JSON .spherical property#591

Closed
abernier wants to merge 1 commit intodevfrom
spherical-state
Closed

JSON .spherical property#591
abernier wants to merge 1 commit intodevfrom
spherical-state

Conversation

@abernier
Copy link
Collaborator

No description provided.

Comment on lines +2947 to +2948
this.rotateTo( obj.spherical[ 2 ], obj.spherical[ 1 ], enableTransition );
this.dollyTo( obj.spherical[ 0 ], enableTransition );
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reuse obj.spherical directly


target : this._targetEnd.toArray(),
position : _v3A.setFromSpherical( this._sphericalEnd ).add( this._targetEnd ).toArray(),
spherical : [ this._sphericalEnd.radius, this._sphericalEnd.phi, this._sphericalEnd.theta ],
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

export spherical property

position: [number, number, number]
} );

export type CameraControlsState = {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a type for the state

Copy link
Collaborator Author

@abernier abernier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a spherical property to the exported .toSON() and consume it inside .fromJSON()

@abernier abernier requested a review from yomotsu July 28, 2025 14:32
@abernier abernier changed the title JSON spherical property JSON .spherical property Jul 28, 2025
@abernier abernier self-assigned this Jul 28, 2025
@abernier
Copy link
Collaborator Author

abernier commented Jul 28, 2025

maybe adding a test could be good, to test once .fromJSON() a known snapshot (created with .toJSON()) CC has the right values...

@abernier abernier closed this Aug 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant