setup instance lock for scene editing
This commit is contained in:
parent
edfa41f7dc
commit
9b26aa7629
|
@ -6,6 +6,14 @@ import {fetchObj, loadObj} from './objutils';
|
||||||
* @param {any} context the program context
|
* @param {any} context the program context
|
||||||
*/
|
*/
|
||||||
export function initParams(context: any) {
|
export function initParams(context: any) {
|
||||||
|
let instanceNumber = parseFloat(<string>$('#instance').val());
|
||||||
|
if (($('input[name=instance]:checked', '#instanceoptions').val() ==
|
||||||
|
'one')) {
|
||||||
|
instanceNumber = 1;
|
||||||
|
} else if (($('input[name=instance]:checked', '#instanceoptions').val() ==
|
||||||
|
'zero')) {
|
||||||
|
instanceNumber = 0;
|
||||||
|
}
|
||||||
context.params = {
|
context.params = {
|
||||||
distance: parseFloat(<string>$('#distance').val()) +
|
distance: parseFloat(<string>$('#distance').val()) +
|
||||||
parseFloat(<string>$('#distancefine').val()),
|
parseFloat(<string>$('#distancefine').val()),
|
||||||
|
@ -29,7 +37,7 @@ export function initParams(context: any) {
|
||||||
z: parseFloat(<string>$('#scalez').val()),
|
z: parseFloat(<string>$('#scalez').val()),
|
||||||
},
|
},
|
||||||
rotSpeed: parseFloat(<string>$('#rotspeed').val()),
|
rotSpeed: parseFloat(<string>$('#rotspeed').val()),
|
||||||
instanceNumber: parseFloat(<string>$('#instance').val()),
|
instanceNumber: instanceNumber,
|
||||||
squareRotation: 0,
|
squareRotation: 0,
|
||||||
camRot: {
|
camRot: {
|
||||||
x: 0,
|
x: 0,
|
||||||
|
|
|
@ -28,7 +28,10 @@ export function uiUpdateParams(params: any) {
|
||||||
params.circleSize = parseFloat(<string>$('#circlesize').val());
|
params.circleSize = parseFloat(<string>$('#circlesize').val());
|
||||||
});
|
});
|
||||||
$('#instance').on('input', () => {
|
$('#instance').on('input', () => {
|
||||||
params.instanceNumber = parseFloat(<string>$('#instance').val());
|
if ($('input[name=instance]:checked', '#instanceoptions').val() ==
|
||||||
|
'normal') {
|
||||||
|
params.instanceNumber = parseFloat(<string>$('#instance').val());
|
||||||
|
}
|
||||||
});
|
});
|
||||||
$('#rotx').on('input', () => {
|
$('#rotx').on('input', () => {
|
||||||
params.rot.x = parseFloat(<string>$('#rotx').val());
|
params.rot.x = parseFloat(<string>$('#rotx').val());
|
||||||
|
@ -63,6 +66,18 @@ export function uiUpdateParams(params: any) {
|
||||||
$('#fov').on('input', () => {
|
$('#fov').on('input', () => {
|
||||||
params.fov = parseFloat(<string>$('#fov').val());
|
params.fov = parseFloat(<string>$('#fov').val());
|
||||||
});
|
});
|
||||||
|
$('#instanceoptions input').on('change', () => {
|
||||||
|
if ($('input[name=instance]:checked', '#instanceoptions').val() ==
|
||||||
|
'normal') {
|
||||||
|
params.instanceNumber = parseFloat(<string>$('#instance').val());
|
||||||
|
} else if (
|
||||||
|
($('input[name=instance]:checked', '#instanceoptions').val() ==
|
||||||
|
'one')) {
|
||||||
|
params.instanceNumber = 1;
|
||||||
|
} else {
|
||||||
|
params.instanceNumber = 0;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -50,6 +50,16 @@
|
||||||
<div style='display: inline;'>Change instances number: </div>
|
<div style='display: inline;'>Change instances number: </div>
|
||||||
<input type="range" min="1" max="180" value="9" step='1' class="slider" id="instance">
|
<input type="range" min="1" max="180" value="9" step='1' class="slider" id="instance">
|
||||||
</div>
|
</div>
|
||||||
|
<div class='ui-block'>
|
||||||
|
<form id="instanceoptions">
|
||||||
|
<input type="radio" id="normal" name="instance" value="normal" checked>
|
||||||
|
<label for="normal">Use instance slider</label>
|
||||||
|
<input type="radio" id="one" name="instance" value="one">
|
||||||
|
<label for="one">Lock to one working instance</label>
|
||||||
|
<input type="radio" id="zero" name="instance" value="zero">
|
||||||
|
<label for="zero">Do not show working instance</label>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
<div class='ui-block'>
|
<div class='ui-block'>
|
||||||
<div style='display: inline;'>Change rotation: </div>
|
<div style='display: inline;'>Change rotation: </div>
|
||||||
<div style='display: inline;'>X: </div>
|
<div style='display: inline;'>X: </div>
|
||||||
|
|
Loading…
Reference in New Issue