Skip to content

Commit f1f9554

Browse files
XEOK-197 Implement SectionPlane::roll (sync'd with ::quaternion and ::dir)
1 parent 910394c commit f1f9554

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/viewer/scene/sectionPlane/SectionPlane.js

+27
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,29 @@ class SectionPlane extends Component {
172172
return this._state.quaternion;
173173
}
174174

175+
/**
176+
* Sets the roll of this SectionPlane's plane.
177+
*
178+
* Default value is ````0````.
179+
*
180+
* @param {Number[]} value New roll.
181+
*/
182+
set roll(value) {
183+
this._state.roll = value || 0;
184+
this._onDirRollUpdated();
185+
}
186+
187+
/**
188+
* Gets the roll of this SectionPlane's plane.
189+
*
190+
* Default value is ````0````.
191+
*
192+
* @returns {Number[]} value Current roll.
193+
*/
194+
get roll() {
195+
return this._state.roll;
196+
}
197+
175198
/**
176199
* Sets the direction of this SectionPlane's plane.
177200
*
@@ -181,6 +204,10 @@ class SectionPlane extends Component {
181204
*/
182205
set dir(value) {
183206
this._state.dir.set(value || front);
207+
this._onDirRollUpdated();
208+
}
209+
210+
_onDirRollUpdated() {
184211
math.vec3PairToQuaternion(back, this._state.dir, this._state.quaternion);
185212

186213
tempVec4a[0] = 0;

0 commit comments

Comments
 (0)