speed vectors + better scene selection
This commit is contained in:
@@ -88,6 +88,7 @@ class KeyframeView extends WindozDomContent {
|
||||
kfName: kfData.info.ekf_name,
|
||||
prevKfId: kfData.info.ekf_prev_uuid,
|
||||
}
|
||||
this.outputs.kfName.value = kfData.info.ekf_name
|
||||
this.kfArena.reloadAgents(kfData.agents)
|
||||
}
|
||||
|
||||
@@ -124,9 +125,24 @@ class KeyframeView extends WindozDomContent {
|
||||
}
|
||||
|
||||
onPropsChanged(evt, comp){
|
||||
console.log('onPropsChanged', comp, evt)
|
||||
console.log('onPropsChanged', comp.name, comp.value)
|
||||
if(this.currentlySelectedAid && this.kfArena.agents[this.currentlySelectedAid]){
|
||||
|
||||
const AgentValues = this.getFieldsValues('div[data-output="agentProperties"]')
|
||||
this.kfArena.agents[this.currentlySelectedAid].values = AgentValues
|
||||
const val = Number.parseInt(comp.value, 10)
|
||||
if((comp.name.startsWith('position.')) && (!Number.isNaN(val))){
|
||||
this.kfArena.moveAgent(this.currentlySelectedAid, {
|
||||
x: this.getFieldValue('div[data-output="agentProperties"]', 'position.x'),
|
||||
y: this.getFieldValue('div[data-output="agentProperties"]', 'position.y'),
|
||||
z: this.getFieldValue('div[data-output="agentProperties"]', 'position.z'),
|
||||
})
|
||||
} else if((comp.name.startsWith('speed.')) && (!Number.isNaN(val))){
|
||||
this.kfArena.changeAgentSpeed(this.currentlySelectedAid, {
|
||||
x: this.getFieldValue('div[data-output="agentProperties"]', 'speed.x'),
|
||||
y: this.getFieldValue('div[data-output="agentProperties"]', 'speed.y'),
|
||||
z: this.getFieldValue('div[data-output="agentProperties"]', 'speed.z'),
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user